ent

package
v0.0.0-...-5b7c39b Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeCurrencyRate = "CurrencyRate"
	TypeIco          = "Ico"
	TypeIcoCoupon    = "IcoCoupon"
	TypeIcoHistory   = "IcoHistory"
	TypeIcoRound     = "IcoRound"
	TypeTransaction  = "Transaction"
	TypeUserWallet   = "UserWallet"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type 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
	// CurrencyRate is the client for interacting with the CurrencyRate builders.
	CurrencyRate *CurrencyRateClient
	// Ico is the client for interacting with the Ico builders.
	Ico *IcoClient
	// IcoCoupon is the client for interacting with the IcoCoupon builders.
	IcoCoupon *IcoCouponClient
	// IcoHistory is the client for interacting with the IcoHistory builders.
	IcoHistory *IcoHistoryClient
	// IcoRound is the client for interacting with the IcoRound builders.
	IcoRound *IcoRoundClient
	// Transaction is the client for interacting with the Transaction builders.
	Transaction *TransactionClient
	// UserWallet is the client for interacting with the UserWallet builders.
	UserWallet *UserWalletClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	CurrencyRate.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 CurrencyRate

type CurrencyRate struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Symbol holds the value of the "symbol" field.
	Symbol string `json:"symbol,omitempty"`
	// Rate holds the value of the "rate" field.
	Rate string `json:"rate,omitempty"`
	// ExpiredAt holds the value of the "expired_at" field.
	ExpiredAt *time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

CurrencyRate is the model entity for the CurrencyRate schema.

func (*CurrencyRate) ExecContext

func (c *CurrencyRate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRate) QueryContext

func (c *CurrencyRate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRate) String

func (cr *CurrencyRate) String() string

String implements the fmt.Stringer.

func (*CurrencyRate) Unwrap

func (cr *CurrencyRate) Unwrap() *CurrencyRate

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

func (cr *CurrencyRate) Update() *CurrencyRateUpdateOne

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

func (*CurrencyRate) Value

func (cr *CurrencyRate) Value(name string) (ent.Value, error)

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

type CurrencyRateClient

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

CurrencyRateClient is a client for the CurrencyRate schema.

func NewCurrencyRateClient

func NewCurrencyRateClient(c config) *CurrencyRateClient

NewCurrencyRateClient returns a client for the CurrencyRate from the given config.

func (*CurrencyRateClient) Create

Create returns a builder for creating a CurrencyRate entity.

func (*CurrencyRateClient) CreateBulk

func (c *CurrencyRateClient) CreateBulk(builders ...*CurrencyRateCreate) *CurrencyRateCreateBulk

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

func (*CurrencyRateClient) Delete

Delete returns a delete builder for CurrencyRate.

func (*CurrencyRateClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CurrencyRateClient) DeleteOneID

func (c *CurrencyRateClient) DeleteOneID(id int) *CurrencyRateDeleteOne

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

func (*CurrencyRateClient) ExecContext

func (c *CurrencyRateClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateClient) Get

Get returns a CurrencyRate entity by its id.

func (*CurrencyRateClient) GetX

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

func (*CurrencyRateClient) Hooks

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

Hooks returns the client hooks.

func (*CurrencyRateClient) Intercept

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

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

func (*CurrencyRateClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CurrencyRateClient) MapCreateBulk

func (c *CurrencyRateClient) MapCreateBulk(slice any, setFunc func(*CurrencyRateCreate, int)) *CurrencyRateCreateBulk

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

Query returns a query builder for CurrencyRate.

func (*CurrencyRateClient) QueryContext

func (c *CurrencyRateClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateClient) Update

Update returns an update builder for CurrencyRate.

func (*CurrencyRateClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CurrencyRateClient) UpdateOneID

func (c *CurrencyRateClient) UpdateOneID(id int) *CurrencyRateUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CurrencyRateClient) Use

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

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

type CurrencyRateCreate

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

CurrencyRateCreate is the builder for creating a CurrencyRate entity.

func (*CurrencyRateCreate) Exec

func (crc *CurrencyRateCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CurrencyRateCreate) ExecContext

func (c *CurrencyRateCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateCreate) ExecX

func (crc *CurrencyRateCreate) ExecX(ctx context.Context)

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

func (*CurrencyRateCreate) Mutation

func (crc *CurrencyRateCreate) Mutation() *CurrencyRateMutation

Mutation returns the CurrencyRateMutation object of the builder.

func (*CurrencyRateCreate) OnConflict

func (crc *CurrencyRateCreate) OnConflict(opts ...sql.ConflictOption) *CurrencyRateUpsertOne

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

client.CurrencyRate.Create().
	SetCreatedAt(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.CurrencyRateUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*CurrencyRateCreate) OnConflictColumns

func (crc *CurrencyRateCreate) OnConflictColumns(columns ...string) *CurrencyRateUpsertOne

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

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

func (*CurrencyRateCreate) QueryContext

func (c *CurrencyRateCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateCreate) Save

Save creates the CurrencyRate in the database.

func (*CurrencyRateCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CurrencyRateCreate) SetCreatedAt

func (crc *CurrencyRateCreate) SetCreatedAt(t time.Time) *CurrencyRateCreate

SetCreatedAt sets the "created_at" field.

func (*CurrencyRateCreate) SetExpiredAt

func (crc *CurrencyRateCreate) SetExpiredAt(t time.Time) *CurrencyRateCreate

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateCreate) SetNillableCreatedAt

func (crc *CurrencyRateCreate) SetNillableCreatedAt(t *time.Time) *CurrencyRateCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CurrencyRateCreate) SetNillableExpiredAt

func (crc *CurrencyRateCreate) SetNillableExpiredAt(t *time.Time) *CurrencyRateCreate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*CurrencyRateCreate) SetNillableUpdatedAt

func (crc *CurrencyRateCreate) SetNillableUpdatedAt(t *time.Time) *CurrencyRateCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CurrencyRateCreate) SetRate

func (crc *CurrencyRateCreate) SetRate(s string) *CurrencyRateCreate

SetRate sets the "rate" field.

func (*CurrencyRateCreate) SetSymbol

func (crc *CurrencyRateCreate) SetSymbol(s string) *CurrencyRateCreate

SetSymbol sets the "symbol" field.

func (*CurrencyRateCreate) SetUpdatedAt

func (crc *CurrencyRateCreate) SetUpdatedAt(t time.Time) *CurrencyRateCreate

SetUpdatedAt sets the "updated_at" field.

type CurrencyRateCreateBulk

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

CurrencyRateCreateBulk is the builder for creating many CurrencyRate entities in bulk.

func (*CurrencyRateCreateBulk) Exec

func (crcb *CurrencyRateCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CurrencyRateCreateBulk) ExecContext

func (c *CurrencyRateCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateCreateBulk) ExecX

func (crcb *CurrencyRateCreateBulk) ExecX(ctx context.Context)

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

func (*CurrencyRateCreateBulk) OnConflict

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

client.CurrencyRate.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.CurrencyRateUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*CurrencyRateCreateBulk) OnConflictColumns

func (crcb *CurrencyRateCreateBulk) OnConflictColumns(columns ...string) *CurrencyRateUpsertBulk

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

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

func (*CurrencyRateCreateBulk) QueryContext

func (c *CurrencyRateCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateCreateBulk) Save

Save creates the CurrencyRate entities in the database.

func (*CurrencyRateCreateBulk) SaveX

func (crcb *CurrencyRateCreateBulk) SaveX(ctx context.Context) []*CurrencyRate

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

type CurrencyRateDelete

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

CurrencyRateDelete is the builder for deleting a CurrencyRate entity.

func (*CurrencyRateDelete) Exec

func (crd *CurrencyRateDelete) Exec(ctx context.Context) (int, error)

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

func (*CurrencyRateDelete) ExecContext

func (c *CurrencyRateDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateDelete) ExecX

func (crd *CurrencyRateDelete) ExecX(ctx context.Context) int

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

func (*CurrencyRateDelete) QueryContext

func (c *CurrencyRateDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateDelete) Where

Where appends a list predicates to the CurrencyRateDelete builder.

type CurrencyRateDeleteOne

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

CurrencyRateDeleteOne is the builder for deleting a single CurrencyRate entity.

func (*CurrencyRateDeleteOne) Exec

func (crdo *CurrencyRateDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CurrencyRateDeleteOne) ExecX

func (crdo *CurrencyRateDeleteOne) ExecX(ctx context.Context)

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

func (*CurrencyRateDeleteOne) Where

Where appends a list predicates to the CurrencyRateDelete builder.

type CurrencyRateGroupBy

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

CurrencyRateGroupBy is the group-by builder for CurrencyRate entities.

func (*CurrencyRateGroupBy) Aggregate

func (crgb *CurrencyRateGroupBy) Aggregate(fns ...AggregateFunc) *CurrencyRateGroupBy

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

func (*CurrencyRateGroupBy) Bool

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

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

func (*CurrencyRateGroupBy) BoolX

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

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

func (*CurrencyRateGroupBy) Bools

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

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

func (*CurrencyRateGroupBy) BoolsX

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

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

func (*CurrencyRateGroupBy) Float64

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

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

func (*CurrencyRateGroupBy) Float64X

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

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

func (*CurrencyRateGroupBy) Float64s

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

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

func (*CurrencyRateGroupBy) Float64sX

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

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

func (*CurrencyRateGroupBy) Int

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

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

func (*CurrencyRateGroupBy) IntX

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

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

func (*CurrencyRateGroupBy) Ints

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

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

func (*CurrencyRateGroupBy) IntsX

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

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

func (*CurrencyRateGroupBy) Scan

func (crgb *CurrencyRateGroupBy) Scan(ctx context.Context, v any) error

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

func (*CurrencyRateGroupBy) ScanX

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

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

func (*CurrencyRateGroupBy) String

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

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

func (*CurrencyRateGroupBy) StringX

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

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

func (*CurrencyRateGroupBy) Strings

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

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

func (*CurrencyRateGroupBy) StringsX

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

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

type CurrencyRateMutation

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

CurrencyRateMutation represents an operation that mutates the CurrencyRate nodes in the graph.

func (*CurrencyRateMutation) AddField

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

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

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

func (*CurrencyRateMutation) AddedField

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

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

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

func (*CurrencyRateMutation) AddedIDs

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

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

func (*CurrencyRateMutation) ClearEdge

func (m *CurrencyRateMutation) 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 (*CurrencyRateMutation) ClearExpiredAt

func (m *CurrencyRateMutation) ClearExpiredAt()

ClearExpiredAt clears the value of the "expired_at" field.

func (*CurrencyRateMutation) ClearField

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

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

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

func (*CurrencyRateMutation) ClearedFields

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

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

func (CurrencyRateMutation) Client

func (m CurrencyRateMutation) 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 (*CurrencyRateMutation) CreatedAt

func (m *CurrencyRateMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CurrencyRateMutation) EdgeCleared

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

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

func (*CurrencyRateMutation) ExecContext

func (c *CurrencyRateMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateMutation) ExpiredAt

func (m *CurrencyRateMutation) ExpiredAt() (r time.Time, exists bool)

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*CurrencyRateMutation) ExpiredAtCleared

func (m *CurrencyRateMutation) ExpiredAtCleared() bool

ExpiredAtCleared returns if the "expired_at" field was cleared in this mutation.

func (*CurrencyRateMutation) Field

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

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

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

func (*CurrencyRateMutation) Fields

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

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

func (m *CurrencyRateMutation) 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 (*CurrencyRateMutation) OldCreatedAt

func (m *CurrencyRateMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the CurrencyRate entity. If the CurrencyRate 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 (*CurrencyRateMutation) OldExpiredAt

func (m *CurrencyRateMutation) OldExpiredAt(ctx context.Context) (v *time.Time, err error)

OldExpiredAt returns the old "expired_at" field's value of the CurrencyRate entity. If the CurrencyRate 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 (*CurrencyRateMutation) OldField

func (m *CurrencyRateMutation) 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 (*CurrencyRateMutation) OldRate

func (m *CurrencyRateMutation) OldRate(ctx context.Context) (v string, err error)

OldRate returns the old "rate" field's value of the CurrencyRate entity. If the CurrencyRate 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 (*CurrencyRateMutation) OldSymbol

func (m *CurrencyRateMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the CurrencyRate entity. If the CurrencyRate 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 (*CurrencyRateMutation) OldUpdatedAt

func (m *CurrencyRateMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the CurrencyRate entity. If the CurrencyRate 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 (*CurrencyRateMutation) Op

func (m *CurrencyRateMutation) Op() Op

Op returns the operation name.

func (*CurrencyRateMutation) QueryContext

func (c *CurrencyRateMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateMutation) Rate

func (m *CurrencyRateMutation) Rate() (r string, exists bool)

Rate returns the value of the "rate" field in the mutation.

func (*CurrencyRateMutation) RemovedEdges

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

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

func (*CurrencyRateMutation) RemovedIDs

func (m *CurrencyRateMutation) 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 (*CurrencyRateMutation) ResetCreatedAt

func (m *CurrencyRateMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CurrencyRateMutation) ResetEdge

func (m *CurrencyRateMutation) 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 (*CurrencyRateMutation) ResetExpiredAt

func (m *CurrencyRateMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" field.

func (*CurrencyRateMutation) ResetField

func (m *CurrencyRateMutation) 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 (*CurrencyRateMutation) ResetRate

func (m *CurrencyRateMutation) ResetRate()

ResetRate resets all changes to the "rate" field.

func (*CurrencyRateMutation) ResetSymbol

func (m *CurrencyRateMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*CurrencyRateMutation) ResetUpdatedAt

func (m *CurrencyRateMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CurrencyRateMutation) SetCreatedAt

func (m *CurrencyRateMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CurrencyRateMutation) SetExpiredAt

func (m *CurrencyRateMutation) SetExpiredAt(t time.Time)

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateMutation) SetField

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

func (m *CurrencyRateMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CurrencyRateMutation) SetRate

func (m *CurrencyRateMutation) SetRate(s string)

SetRate sets the "rate" field.

func (*CurrencyRateMutation) SetSymbol

func (m *CurrencyRateMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*CurrencyRateMutation) SetUpdatedAt

func (m *CurrencyRateMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CurrencyRateMutation) Symbol

func (m *CurrencyRateMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (CurrencyRateMutation) Tx

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

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

func (*CurrencyRateMutation) Type

func (m *CurrencyRateMutation) Type() string

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

func (*CurrencyRateMutation) UpdatedAt

func (m *CurrencyRateMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CurrencyRateMutation) Where

Where appends a list predicates to the CurrencyRateMutation builder.

func (*CurrencyRateMutation) WhereP

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

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

type CurrencyRateQuery

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

CurrencyRateQuery is the builder for querying CurrencyRate entities.

func (*CurrencyRateQuery) Aggregate

func (crq *CurrencyRateQuery) Aggregate(fns ...AggregateFunc) *CurrencyRateSelect

Aggregate returns a CurrencyRateSelect configured with the given aggregations.

func (*CurrencyRateQuery) All

func (crq *CurrencyRateQuery) All(ctx context.Context) ([]*CurrencyRate, error)

All executes the query and returns a list of CurrencyRates.

func (*CurrencyRateQuery) AllX

func (crq *CurrencyRateQuery) AllX(ctx context.Context) []*CurrencyRate

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

func (*CurrencyRateQuery) Clone

func (crq *CurrencyRateQuery) Clone() *CurrencyRateQuery

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

func (*CurrencyRateQuery) Count

func (crq *CurrencyRateQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CurrencyRateQuery) CountX

func (crq *CurrencyRateQuery) CountX(ctx context.Context) int

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

func (*CurrencyRateQuery) ExecContext

func (c *CurrencyRateQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateQuery) Exist

func (crq *CurrencyRateQuery) Exist(ctx context.Context) (bool, error)

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

func (*CurrencyRateQuery) ExistX

func (crq *CurrencyRateQuery) ExistX(ctx context.Context) bool

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

func (*CurrencyRateQuery) First

func (crq *CurrencyRateQuery) First(ctx context.Context) (*CurrencyRate, error)

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

func (*CurrencyRateQuery) FirstID

func (crq *CurrencyRateQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CurrencyRateQuery) FirstIDX

func (crq *CurrencyRateQuery) FirstIDX(ctx context.Context) int

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

func (*CurrencyRateQuery) FirstX

func (crq *CurrencyRateQuery) FirstX(ctx context.Context) *CurrencyRate

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

func (*CurrencyRateQuery) GroupBy

func (crq *CurrencyRateQuery) GroupBy(field string, fields ...string) *CurrencyRateGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CurrencyRate.Query().
	GroupBy(currencyrate.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CurrencyRateQuery) IDs

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

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

func (*CurrencyRateQuery) IDsX

func (crq *CurrencyRateQuery) IDsX(ctx context.Context) []int

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

func (*CurrencyRateQuery) Limit

func (crq *CurrencyRateQuery) Limit(limit int) *CurrencyRateQuery

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

func (*CurrencyRateQuery) Modify

func (crq *CurrencyRateQuery) Modify(modifiers ...func(s *sql.Selector)) *CurrencyRateSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*CurrencyRateQuery) Offset

func (crq *CurrencyRateQuery) Offset(offset int) *CurrencyRateQuery

Offset to start from.

func (*CurrencyRateQuery) Only

func (crq *CurrencyRateQuery) Only(ctx context.Context) (*CurrencyRate, error)

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

func (*CurrencyRateQuery) OnlyID

func (crq *CurrencyRateQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CurrencyRateQuery) OnlyIDX

func (crq *CurrencyRateQuery) OnlyIDX(ctx context.Context) int

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

func (*CurrencyRateQuery) OnlyX

func (crq *CurrencyRateQuery) OnlyX(ctx context.Context) *CurrencyRate

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

func (*CurrencyRateQuery) Order

Order specifies how the records should be ordered.

func (*CurrencyRateQuery) QueryContext

func (c *CurrencyRateQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateQuery) Select

func (crq *CurrencyRateQuery) Select(fields ...string) *CurrencyRateSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.CurrencyRate.Query().
	Select(currencyrate.FieldCreatedAt).
	Scan(ctx, &v)

func (*CurrencyRateQuery) Unique

func (crq *CurrencyRateQuery) Unique(unique bool) *CurrencyRateQuery

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

Where adds a new predicate for the CurrencyRateQuery builder.

type CurrencyRateSelect

type CurrencyRateSelect struct {
	*CurrencyRateQuery
	// contains filtered or unexported fields
}

CurrencyRateSelect is the builder for selecting fields of CurrencyRate entities.

func (*CurrencyRateSelect) Aggregate

func (crs *CurrencyRateSelect) Aggregate(fns ...AggregateFunc) *CurrencyRateSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CurrencyRateSelect) Bool

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

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

func (*CurrencyRateSelect) BoolX

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

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

func (*CurrencyRateSelect) Bools

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

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

func (*CurrencyRateSelect) BoolsX

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

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

func (CurrencyRateSelect) ExecContext

func (c CurrencyRateSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateSelect) Float64

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

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

func (*CurrencyRateSelect) Float64X

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

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

func (*CurrencyRateSelect) Float64s

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

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

func (*CurrencyRateSelect) Float64sX

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

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

func (*CurrencyRateSelect) Int

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

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

func (*CurrencyRateSelect) IntX

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

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

func (*CurrencyRateSelect) Ints

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

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

func (*CurrencyRateSelect) IntsX

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

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

func (*CurrencyRateSelect) Modify

func (crs *CurrencyRateSelect) Modify(modifiers ...func(s *sql.Selector)) *CurrencyRateSelect

Modify adds a query modifier for attaching custom logic to queries.

func (CurrencyRateSelect) QueryContext

func (c CurrencyRateSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateSelect) Scan

func (crs *CurrencyRateSelect) Scan(ctx context.Context, v any) error

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

func (*CurrencyRateSelect) ScanX

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

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

func (*CurrencyRateSelect) String

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

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

func (*CurrencyRateSelect) StringX

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

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

func (*CurrencyRateSelect) Strings

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

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

func (*CurrencyRateSelect) StringsX

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

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

type CurrencyRateUpdate

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

CurrencyRateUpdate is the builder for updating CurrencyRate entities.

func (*CurrencyRateUpdate) ClearExpiredAt

func (cru *CurrencyRateUpdate) ClearExpiredAt() *CurrencyRateUpdate

ClearExpiredAt clears the value of the "expired_at" field.

func (*CurrencyRateUpdate) Exec

func (cru *CurrencyRateUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CurrencyRateUpdate) ExecContext

func (c *CurrencyRateUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateUpdate) ExecX

func (cru *CurrencyRateUpdate) ExecX(ctx context.Context)

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

func (*CurrencyRateUpdate) Modify

func (cru *CurrencyRateUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *CurrencyRateUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*CurrencyRateUpdate) Mutation

func (cru *CurrencyRateUpdate) Mutation() *CurrencyRateMutation

Mutation returns the CurrencyRateMutation object of the builder.

func (*CurrencyRateUpdate) QueryContext

func (c *CurrencyRateUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateUpdate) Save

func (cru *CurrencyRateUpdate) Save(ctx context.Context) (int, error)

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

func (*CurrencyRateUpdate) SaveX

func (cru *CurrencyRateUpdate) SaveX(ctx context.Context) int

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

func (*CurrencyRateUpdate) SetExpiredAt

func (cru *CurrencyRateUpdate) SetExpiredAt(t time.Time) *CurrencyRateUpdate

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateUpdate) SetNillableExpiredAt

func (cru *CurrencyRateUpdate) SetNillableExpiredAt(t *time.Time) *CurrencyRateUpdate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*CurrencyRateUpdate) SetNillableRate

func (cru *CurrencyRateUpdate) SetNillableRate(s *string) *CurrencyRateUpdate

SetNillableRate sets the "rate" field if the given value is not nil.

func (*CurrencyRateUpdate) SetNillableSymbol

func (cru *CurrencyRateUpdate) SetNillableSymbol(s *string) *CurrencyRateUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*CurrencyRateUpdate) SetRate

func (cru *CurrencyRateUpdate) SetRate(s string) *CurrencyRateUpdate

SetRate sets the "rate" field.

func (*CurrencyRateUpdate) SetSymbol

func (cru *CurrencyRateUpdate) SetSymbol(s string) *CurrencyRateUpdate

SetSymbol sets the "symbol" field.

func (*CurrencyRateUpdate) SetUpdatedAt

func (cru *CurrencyRateUpdate) SetUpdatedAt(t time.Time) *CurrencyRateUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CurrencyRateUpdate) Where

Where appends a list predicates to the CurrencyRateUpdate builder.

type CurrencyRateUpdateOne

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

CurrencyRateUpdateOne is the builder for updating a single CurrencyRate entity.

func (*CurrencyRateUpdateOne) ClearExpiredAt

func (cruo *CurrencyRateUpdateOne) ClearExpiredAt() *CurrencyRateUpdateOne

ClearExpiredAt clears the value of the "expired_at" field.

func (*CurrencyRateUpdateOne) Exec

func (cruo *CurrencyRateUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CurrencyRateUpdateOne) ExecContext

func (c *CurrencyRateUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CurrencyRateUpdateOne) ExecX

func (cruo *CurrencyRateUpdateOne) ExecX(ctx context.Context)

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

func (*CurrencyRateUpdateOne) Modify

func (cruo *CurrencyRateUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *CurrencyRateUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*CurrencyRateUpdateOne) Mutation

func (cruo *CurrencyRateUpdateOne) Mutation() *CurrencyRateMutation

Mutation returns the CurrencyRateMutation object of the builder.

func (*CurrencyRateUpdateOne) QueryContext

func (c *CurrencyRateUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CurrencyRateUpdateOne) Save

Save executes the query and returns the updated CurrencyRate entity.

func (*CurrencyRateUpdateOne) SaveX

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

func (*CurrencyRateUpdateOne) Select

func (cruo *CurrencyRateUpdateOne) Select(field string, fields ...string) *CurrencyRateUpdateOne

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

func (*CurrencyRateUpdateOne) SetExpiredAt

func (cruo *CurrencyRateUpdateOne) SetExpiredAt(t time.Time) *CurrencyRateUpdateOne

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateUpdateOne) SetNillableExpiredAt

func (cruo *CurrencyRateUpdateOne) SetNillableExpiredAt(t *time.Time) *CurrencyRateUpdateOne

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*CurrencyRateUpdateOne) SetNillableRate

func (cruo *CurrencyRateUpdateOne) SetNillableRate(s *string) *CurrencyRateUpdateOne

SetNillableRate sets the "rate" field if the given value is not nil.

func (*CurrencyRateUpdateOne) SetNillableSymbol

func (cruo *CurrencyRateUpdateOne) SetNillableSymbol(s *string) *CurrencyRateUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*CurrencyRateUpdateOne) SetRate

SetRate sets the "rate" field.

func (*CurrencyRateUpdateOne) SetSymbol

SetSymbol sets the "symbol" field.

func (*CurrencyRateUpdateOne) SetUpdatedAt

func (cruo *CurrencyRateUpdateOne) SetUpdatedAt(t time.Time) *CurrencyRateUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CurrencyRateUpdateOne) Where

Where appends a list predicates to the CurrencyRateUpdate builder.

type CurrencyRateUpsert

type CurrencyRateUpsert struct {
	*sql.UpdateSet
}

CurrencyRateUpsert is the "OnConflict" setter.

func (*CurrencyRateUpsert) ClearExpiredAt

func (u *CurrencyRateUpsert) ClearExpiredAt() *CurrencyRateUpsert

ClearExpiredAt clears the value of the "expired_at" field.

func (*CurrencyRateUpsert) SetExpiredAt

func (u *CurrencyRateUpsert) SetExpiredAt(v time.Time) *CurrencyRateUpsert

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateUpsert) SetRate

SetRate sets the "rate" field.

func (*CurrencyRateUpsert) SetSymbol

func (u *CurrencyRateUpsert) SetSymbol(v string) *CurrencyRateUpsert

SetSymbol sets the "symbol" field.

func (*CurrencyRateUpsert) SetUpdatedAt

func (u *CurrencyRateUpsert) SetUpdatedAt(v time.Time) *CurrencyRateUpsert

SetUpdatedAt sets the "updated_at" field.

func (*CurrencyRateUpsert) UpdateExpiredAt

func (u *CurrencyRateUpsert) UpdateExpiredAt() *CurrencyRateUpsert

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

func (*CurrencyRateUpsert) UpdateRate

func (u *CurrencyRateUpsert) UpdateRate() *CurrencyRateUpsert

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

func (*CurrencyRateUpsert) UpdateSymbol

func (u *CurrencyRateUpsert) UpdateSymbol() *CurrencyRateUpsert

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

func (*CurrencyRateUpsert) UpdateUpdatedAt

func (u *CurrencyRateUpsert) UpdateUpdatedAt() *CurrencyRateUpsert

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

type CurrencyRateUpsertBulk

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

CurrencyRateUpsertBulk is the builder for "upsert"-ing a bulk of CurrencyRate nodes.

func (*CurrencyRateUpsertBulk) ClearExpiredAt

func (u *CurrencyRateUpsertBulk) ClearExpiredAt() *CurrencyRateUpsertBulk

ClearExpiredAt clears the value of the "expired_at" field.

func (*CurrencyRateUpsertBulk) DoNothing

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

func (*CurrencyRateUpsertBulk) Exec

Exec executes the query.

func (*CurrencyRateUpsertBulk) ExecX

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

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

func (*CurrencyRateUpsertBulk) Ignore

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

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

func (*CurrencyRateUpsertBulk) SetExpiredAt

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateUpsertBulk) SetRate

SetRate sets the "rate" field.

func (*CurrencyRateUpsertBulk) SetSymbol

SetSymbol sets the "symbol" field.

func (*CurrencyRateUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*CurrencyRateUpsertBulk) Update

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

func (*CurrencyRateUpsertBulk) UpdateExpiredAt

func (u *CurrencyRateUpsertBulk) UpdateExpiredAt() *CurrencyRateUpsertBulk

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

func (*CurrencyRateUpsertBulk) UpdateNewValues

func (u *CurrencyRateUpsertBulk) UpdateNewValues() *CurrencyRateUpsertBulk

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

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

func (*CurrencyRateUpsertBulk) UpdateRate

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

func (*CurrencyRateUpsertBulk) UpdateSymbol

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

func (*CurrencyRateUpsertBulk) UpdateUpdatedAt

func (u *CurrencyRateUpsertBulk) UpdateUpdatedAt() *CurrencyRateUpsertBulk

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

type CurrencyRateUpsertOne

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

CurrencyRateUpsertOne is the builder for "upsert"-ing

one CurrencyRate node.

func (*CurrencyRateUpsertOne) ClearExpiredAt

func (u *CurrencyRateUpsertOne) ClearExpiredAt() *CurrencyRateUpsertOne

ClearExpiredAt clears the value of the "expired_at" field.

func (*CurrencyRateUpsertOne) DoNothing

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

func (*CurrencyRateUpsertOne) Exec

Exec executes the query.

func (*CurrencyRateUpsertOne) ExecX

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

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

func (*CurrencyRateUpsertOne) ID

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

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

func (*CurrencyRateUpsertOne) IDX

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

func (*CurrencyRateUpsertOne) Ignore

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

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

func (*CurrencyRateUpsertOne) SetExpiredAt

SetExpiredAt sets the "expired_at" field.

func (*CurrencyRateUpsertOne) SetRate

SetRate sets the "rate" field.

func (*CurrencyRateUpsertOne) SetSymbol

SetSymbol sets the "symbol" field.

func (*CurrencyRateUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*CurrencyRateUpsertOne) Update

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

func (*CurrencyRateUpsertOne) UpdateExpiredAt

func (u *CurrencyRateUpsertOne) UpdateExpiredAt() *CurrencyRateUpsertOne

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

func (*CurrencyRateUpsertOne) UpdateNewValues

func (u *CurrencyRateUpsertOne) UpdateNewValues() *CurrencyRateUpsertOne

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

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

func (*CurrencyRateUpsertOne) UpdateRate

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

func (*CurrencyRateUpsertOne) UpdateSymbol

func (u *CurrencyRateUpsertOne) UpdateSymbol() *CurrencyRateUpsertOne

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

func (*CurrencyRateUpsertOne) UpdateUpdatedAt

func (u *CurrencyRateUpsertOne) UpdateUpdatedAt() *CurrencyRateUpsertOne

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

type CurrencyRates

type CurrencyRates []*CurrencyRate

CurrencyRates is a parsable slice of CurrencyRate.

type Hook

type Hook = ent.Hook

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

type Ico

type Ico struct {

	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// RoundID holds the value of the "round_id" field.
	RoundID int32 `json:"round_id,omitempty"`
	// RoundName holds the value of the "round_name" field.
	RoundName string `json:"round_name,omitempty"`
	// Price holds the value of the "price" field.
	Price string `json:"price,omitempty"`
	// NumToken holds the value of the "num_token" field.
	NumToken string `json:"num_token,omitempty"`
	// NumSub holds the value of the "num_sub" field.
	NumSub int32 `json:"num_sub,omitempty"`
	// PriceGap holds the value of the "price_gap" field.
	PriceGap string `json:"price_gap,omitempty"`
	// EndedAt holds the value of the "ended_at" field.
	EndedAt *time.Time `json:"ended_at,omitempty"`
	// contains filtered or unexported fields
}

Ico is the model entity for the Ico schema.

func (*Ico) ExecContext

func (c *Ico) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Ico) QueryContext

func (c *Ico) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Ico) String

func (i *Ico) String() string

String implements the fmt.Stringer.

func (*Ico) Unwrap

func (i *Ico) Unwrap() *Ico

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

func (i *Ico) Update() *IcoUpdateOne

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

func (*Ico) Value

func (i *Ico) Value(name string) (ent.Value, error)

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

type IcoClient

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

IcoClient is a client for the Ico schema.

func NewIcoClient

func NewIcoClient(c config) *IcoClient

NewIcoClient returns a client for the Ico from the given config.

func (*IcoClient) Create

func (c *IcoClient) Create() *IcoCreate

Create returns a builder for creating a Ico entity.

func (*IcoClient) CreateBulk

func (c *IcoClient) CreateBulk(builders ...*IcoCreate) *IcoCreateBulk

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

func (*IcoClient) Delete

func (c *IcoClient) Delete() *IcoDelete

Delete returns a delete builder for Ico.

func (*IcoClient) DeleteOne

func (c *IcoClient) DeleteOne(i *Ico) *IcoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IcoClient) DeleteOneID

func (c *IcoClient) DeleteOneID(id xid.ID) *IcoDeleteOne

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

func (*IcoClient) ExecContext

func (c *IcoClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoClient) Get

func (c *IcoClient) Get(ctx context.Context, id xid.ID) (*Ico, error)

Get returns a Ico entity by its id.

func (*IcoClient) GetX

func (c *IcoClient) GetX(ctx context.Context, id xid.ID) *Ico

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

func (*IcoClient) Hooks

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

Hooks returns the client hooks.

func (*IcoClient) Intercept

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

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

func (*IcoClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IcoClient) MapCreateBulk

func (c *IcoClient) MapCreateBulk(slice any, setFunc func(*IcoCreate, int)) *IcoCreateBulk

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

func (c *IcoClient) Query() *IcoQuery

Query returns a query builder for Ico.

func (*IcoClient) QueryContext

func (c *IcoClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoClient) Update

func (c *IcoClient) Update() *IcoUpdate

Update returns an update builder for Ico.

func (*IcoClient) UpdateOne

func (c *IcoClient) UpdateOne(i *Ico) *IcoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IcoClient) UpdateOneID

func (c *IcoClient) UpdateOneID(id xid.ID) *IcoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IcoClient) Use

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

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

type IcoCoupon

type IcoCoupon struct {

	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Coupon holds the value of the "coupon" field.
	Coupon string `json:"coupon,omitempty"`
	// Reward holds the value of the "reward" field.
	Reward string `json:"reward,omitempty"`
	// Cashback holds the value of the "cashback" field.
	Cashback string `json:"cashback,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

IcoCoupon is the model entity for the IcoCoupon schema.

func (*IcoCoupon) ExecContext

func (c *IcoCoupon) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCoupon) QueryContext

func (c *IcoCoupon) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCoupon) String

func (ic *IcoCoupon) String() string

String implements the fmt.Stringer.

func (*IcoCoupon) Unwrap

func (ic *IcoCoupon) Unwrap() *IcoCoupon

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

func (ic *IcoCoupon) Update() *IcoCouponUpdateOne

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

func (*IcoCoupon) Value

func (ic *IcoCoupon) Value(name string) (ent.Value, error)

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

type IcoCouponClient

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

IcoCouponClient is a client for the IcoCoupon schema.

func NewIcoCouponClient

func NewIcoCouponClient(c config) *IcoCouponClient

NewIcoCouponClient returns a client for the IcoCoupon from the given config.

func (*IcoCouponClient) Create

func (c *IcoCouponClient) Create() *IcoCouponCreate

Create returns a builder for creating a IcoCoupon entity.

func (*IcoCouponClient) CreateBulk

func (c *IcoCouponClient) CreateBulk(builders ...*IcoCouponCreate) *IcoCouponCreateBulk

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

func (*IcoCouponClient) Delete

func (c *IcoCouponClient) Delete() *IcoCouponDelete

Delete returns a delete builder for IcoCoupon.

func (*IcoCouponClient) DeleteOne

func (c *IcoCouponClient) DeleteOne(ic *IcoCoupon) *IcoCouponDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IcoCouponClient) DeleteOneID

func (c *IcoCouponClient) DeleteOneID(id xid.ID) *IcoCouponDeleteOne

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

func (*IcoCouponClient) ExecContext

func (c *IcoCouponClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponClient) Get

func (c *IcoCouponClient) Get(ctx context.Context, id xid.ID) (*IcoCoupon, error)

Get returns a IcoCoupon entity by its id.

func (*IcoCouponClient) GetX

func (c *IcoCouponClient) GetX(ctx context.Context, id xid.ID) *IcoCoupon

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

func (*IcoCouponClient) Hooks

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

Hooks returns the client hooks.

func (*IcoCouponClient) Intercept

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

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

func (*IcoCouponClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IcoCouponClient) MapCreateBulk

func (c *IcoCouponClient) MapCreateBulk(slice any, setFunc func(*IcoCouponCreate, int)) *IcoCouponCreateBulk

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

func (c *IcoCouponClient) Query() *IcoCouponQuery

Query returns a query builder for IcoCoupon.

func (*IcoCouponClient) QueryContext

func (c *IcoCouponClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponClient) Update

func (c *IcoCouponClient) Update() *IcoCouponUpdate

Update returns an update builder for IcoCoupon.

func (*IcoCouponClient) UpdateOne

func (c *IcoCouponClient) UpdateOne(ic *IcoCoupon) *IcoCouponUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IcoCouponClient) UpdateOneID

func (c *IcoCouponClient) UpdateOneID(id xid.ID) *IcoCouponUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IcoCouponClient) Use

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

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

type IcoCouponCreate

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

IcoCouponCreate is the builder for creating a IcoCoupon entity.

func (*IcoCouponCreate) Exec

func (icc *IcoCouponCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoCouponCreate) ExecContext

func (c *IcoCouponCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponCreate) ExecX

func (icc *IcoCouponCreate) ExecX(ctx context.Context)

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

func (*IcoCouponCreate) Mutation

func (icc *IcoCouponCreate) Mutation() *IcoCouponMutation

Mutation returns the IcoCouponMutation object of the builder.

func (*IcoCouponCreate) OnConflict

func (icc *IcoCouponCreate) OnConflict(opts ...sql.ConflictOption) *IcoCouponUpsertOne

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

client.IcoCoupon.Create().
	SetCreatedAt(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.IcoCouponUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoCouponCreate) OnConflictColumns

func (icc *IcoCouponCreate) OnConflictColumns(columns ...string) *IcoCouponUpsertOne

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

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

func (*IcoCouponCreate) QueryContext

func (c *IcoCouponCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponCreate) Save

func (icc *IcoCouponCreate) Save(ctx context.Context) (*IcoCoupon, error)

Save creates the IcoCoupon in the database.

func (*IcoCouponCreate) SaveX

func (icc *IcoCouponCreate) SaveX(ctx context.Context) *IcoCoupon

SaveX calls Save and panics if Save returns an error.

func (*IcoCouponCreate) SetCashback

func (icc *IcoCouponCreate) SetCashback(s string) *IcoCouponCreate

SetCashback sets the "cashback" field.

func (*IcoCouponCreate) SetCoupon

func (icc *IcoCouponCreate) SetCoupon(s string) *IcoCouponCreate

SetCoupon sets the "coupon" field.

func (*IcoCouponCreate) SetCreatedAt

func (icc *IcoCouponCreate) SetCreatedAt(t time.Time) *IcoCouponCreate

SetCreatedAt sets the "created_at" field.

func (*IcoCouponCreate) SetDeletedAt

func (icc *IcoCouponCreate) SetDeletedAt(t time.Time) *IcoCouponCreate

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponCreate) SetID

func (icc *IcoCouponCreate) SetID(x xid.ID) *IcoCouponCreate

SetID sets the "id" field.

func (*IcoCouponCreate) SetNillableCreatedAt

func (icc *IcoCouponCreate) SetNillableCreatedAt(t *time.Time) *IcoCouponCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*IcoCouponCreate) SetNillableDeletedAt

func (icc *IcoCouponCreate) SetNillableDeletedAt(t *time.Time) *IcoCouponCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*IcoCouponCreate) SetNillableID

func (icc *IcoCouponCreate) SetNillableID(x *xid.ID) *IcoCouponCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*IcoCouponCreate) SetNillableUpdatedAt

func (icc *IcoCouponCreate) SetNillableUpdatedAt(t *time.Time) *IcoCouponCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*IcoCouponCreate) SetReward

func (icc *IcoCouponCreate) SetReward(s string) *IcoCouponCreate

SetReward sets the "reward" field.

func (*IcoCouponCreate) SetUpdatedAt

func (icc *IcoCouponCreate) SetUpdatedAt(t time.Time) *IcoCouponCreate

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponCreate) SetUserID

func (icc *IcoCouponCreate) SetUserID(s string) *IcoCouponCreate

SetUserID sets the "user_id" field.

type IcoCouponCreateBulk

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

IcoCouponCreateBulk is the builder for creating many IcoCoupon entities in bulk.

func (*IcoCouponCreateBulk) Exec

func (iccb *IcoCouponCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoCouponCreateBulk) ExecContext

func (c *IcoCouponCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponCreateBulk) ExecX

func (iccb *IcoCouponCreateBulk) ExecX(ctx context.Context)

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

func (*IcoCouponCreateBulk) OnConflict

func (iccb *IcoCouponCreateBulk) OnConflict(opts ...sql.ConflictOption) *IcoCouponUpsertBulk

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

client.IcoCoupon.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.IcoCouponUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoCouponCreateBulk) OnConflictColumns

func (iccb *IcoCouponCreateBulk) OnConflictColumns(columns ...string) *IcoCouponUpsertBulk

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

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

func (*IcoCouponCreateBulk) QueryContext

func (c *IcoCouponCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponCreateBulk) Save

func (iccb *IcoCouponCreateBulk) Save(ctx context.Context) ([]*IcoCoupon, error)

Save creates the IcoCoupon entities in the database.

func (*IcoCouponCreateBulk) SaveX

func (iccb *IcoCouponCreateBulk) SaveX(ctx context.Context) []*IcoCoupon

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

type IcoCouponDelete

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

IcoCouponDelete is the builder for deleting a IcoCoupon entity.

func (*IcoCouponDelete) Exec

func (icd *IcoCouponDelete) Exec(ctx context.Context) (int, error)

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

func (*IcoCouponDelete) ExecContext

func (c *IcoCouponDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponDelete) ExecX

func (icd *IcoCouponDelete) ExecX(ctx context.Context) int

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

func (*IcoCouponDelete) QueryContext

func (c *IcoCouponDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponDelete) Where

Where appends a list predicates to the IcoCouponDelete builder.

type IcoCouponDeleteOne

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

IcoCouponDeleteOne is the builder for deleting a single IcoCoupon entity.

func (*IcoCouponDeleteOne) Exec

func (icdo *IcoCouponDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IcoCouponDeleteOne) ExecX

func (icdo *IcoCouponDeleteOne) ExecX(ctx context.Context)

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

func (*IcoCouponDeleteOne) Where

Where appends a list predicates to the IcoCouponDelete builder.

type IcoCouponGroupBy

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

IcoCouponGroupBy is the group-by builder for IcoCoupon entities.

func (*IcoCouponGroupBy) Aggregate

func (icgb *IcoCouponGroupBy) Aggregate(fns ...AggregateFunc) *IcoCouponGroupBy

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

func (*IcoCouponGroupBy) Bool

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

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

func (*IcoCouponGroupBy) BoolX

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

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

func (*IcoCouponGroupBy) Bools

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

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

func (*IcoCouponGroupBy) BoolsX

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

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

func (*IcoCouponGroupBy) Float64

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

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

func (*IcoCouponGroupBy) Float64X

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

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

func (*IcoCouponGroupBy) Float64s

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

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

func (*IcoCouponGroupBy) Float64sX

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

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

func (*IcoCouponGroupBy) Int

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

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

func (*IcoCouponGroupBy) IntX

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

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

func (*IcoCouponGroupBy) Ints

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

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

func (*IcoCouponGroupBy) IntsX

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

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

func (*IcoCouponGroupBy) Scan

func (icgb *IcoCouponGroupBy) Scan(ctx context.Context, v any) error

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

func (*IcoCouponGroupBy) ScanX

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

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

func (*IcoCouponGroupBy) String

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

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

func (*IcoCouponGroupBy) StringX

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

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

func (*IcoCouponGroupBy) Strings

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

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

func (*IcoCouponGroupBy) StringsX

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

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

type IcoCouponMutation

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

IcoCouponMutation represents an operation that mutates the IcoCoupon nodes in the graph.

func (*IcoCouponMutation) AddField

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

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

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

func (*IcoCouponMutation) AddedField

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

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

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

func (*IcoCouponMutation) AddedIDs

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

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

func (*IcoCouponMutation) Cashback

func (m *IcoCouponMutation) Cashback() (r string, exists bool)

Cashback returns the value of the "cashback" field in the mutation.

func (*IcoCouponMutation) ClearDeletedAt

func (m *IcoCouponMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*IcoCouponMutation) ClearEdge

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

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

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

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

func (*IcoCouponMutation) ClearedFields

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

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

func (IcoCouponMutation) Client

func (m IcoCouponMutation) 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 (*IcoCouponMutation) Coupon

func (m *IcoCouponMutation) Coupon() (r string, exists bool)

Coupon returns the value of the "coupon" field in the mutation.

func (*IcoCouponMutation) CreatedAt

func (m *IcoCouponMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*IcoCouponMutation) DeletedAt

func (m *IcoCouponMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*IcoCouponMutation) DeletedAtCleared

func (m *IcoCouponMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*IcoCouponMutation) EdgeCleared

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

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

func (*IcoCouponMutation) ExecContext

func (c *IcoCouponMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponMutation) Field

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

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

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

func (*IcoCouponMutation) Fields

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

func (m *IcoCouponMutation) ID() (id xid.ID, 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 (*IcoCouponMutation) IDs

func (m *IcoCouponMutation) IDs(ctx context.Context) ([]xid.ID, 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 (*IcoCouponMutation) OldCashback

func (m *IcoCouponMutation) OldCashback(ctx context.Context) (v string, err error)

OldCashback returns the old "cashback" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) OldCoupon

func (m *IcoCouponMutation) OldCoupon(ctx context.Context) (v string, err error)

OldCoupon returns the old "coupon" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) OldCreatedAt

func (m *IcoCouponMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) OldDeletedAt

func (m *IcoCouponMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) OldField

func (m *IcoCouponMutation) 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 (*IcoCouponMutation) OldReward

func (m *IcoCouponMutation) OldReward(ctx context.Context) (v string, err error)

OldReward returns the old "reward" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) OldUpdatedAt

func (m *IcoCouponMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) OldUserID

func (m *IcoCouponMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the IcoCoupon entity. If the IcoCoupon 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 (*IcoCouponMutation) Op

func (m *IcoCouponMutation) Op() Op

Op returns the operation name.

func (*IcoCouponMutation) QueryContext

func (c *IcoCouponMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponMutation) RemovedEdges

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

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

func (*IcoCouponMutation) RemovedIDs

func (m *IcoCouponMutation) 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 (*IcoCouponMutation) ResetCashback

func (m *IcoCouponMutation) ResetCashback()

ResetCashback resets all changes to the "cashback" field.

func (*IcoCouponMutation) ResetCoupon

func (m *IcoCouponMutation) ResetCoupon()

ResetCoupon resets all changes to the "coupon" field.

func (*IcoCouponMutation) ResetCreatedAt

func (m *IcoCouponMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IcoCouponMutation) ResetDeletedAt

func (m *IcoCouponMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*IcoCouponMutation) ResetEdge

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

func (m *IcoCouponMutation) 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 (*IcoCouponMutation) ResetReward

func (m *IcoCouponMutation) ResetReward()

ResetReward resets all changes to the "reward" field.

func (*IcoCouponMutation) ResetUpdatedAt

func (m *IcoCouponMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IcoCouponMutation) ResetUserID

func (m *IcoCouponMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*IcoCouponMutation) Reward

func (m *IcoCouponMutation) Reward() (r string, exists bool)

Reward returns the value of the "reward" field in the mutation.

func (*IcoCouponMutation) SetCashback

func (m *IcoCouponMutation) SetCashback(s string)

SetCashback sets the "cashback" field.

func (*IcoCouponMutation) SetCoupon

func (m *IcoCouponMutation) SetCoupon(s string)

SetCoupon sets the "coupon" field.

func (*IcoCouponMutation) SetCreatedAt

func (m *IcoCouponMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*IcoCouponMutation) SetDeletedAt

func (m *IcoCouponMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponMutation) SetField

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

func (m *IcoCouponMutation) SetID(id xid.ID)

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

func (*IcoCouponMutation) SetOp

func (m *IcoCouponMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IcoCouponMutation) SetReward

func (m *IcoCouponMutation) SetReward(s string)

SetReward sets the "reward" field.

func (*IcoCouponMutation) SetUpdatedAt

func (m *IcoCouponMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponMutation) SetUserID

func (m *IcoCouponMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (IcoCouponMutation) Tx

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

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

func (*IcoCouponMutation) Type

func (m *IcoCouponMutation) Type() string

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

func (*IcoCouponMutation) UpdatedAt

func (m *IcoCouponMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*IcoCouponMutation) UserID

func (m *IcoCouponMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*IcoCouponMutation) Where

func (m *IcoCouponMutation) Where(ps ...predicate.IcoCoupon)

Where appends a list predicates to the IcoCouponMutation builder.

func (*IcoCouponMutation) WhereP

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

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

type IcoCouponQuery

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

IcoCouponQuery is the builder for querying IcoCoupon entities.

func (*IcoCouponQuery) Aggregate

func (icq *IcoCouponQuery) Aggregate(fns ...AggregateFunc) *IcoCouponSelect

Aggregate returns a IcoCouponSelect configured with the given aggregations.

func (*IcoCouponQuery) All

func (icq *IcoCouponQuery) All(ctx context.Context) ([]*IcoCoupon, error)

All executes the query and returns a list of IcoCoupons.

func (*IcoCouponQuery) AllX

func (icq *IcoCouponQuery) AllX(ctx context.Context) []*IcoCoupon

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

func (*IcoCouponQuery) Clone

func (icq *IcoCouponQuery) Clone() *IcoCouponQuery

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

func (*IcoCouponQuery) Count

func (icq *IcoCouponQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IcoCouponQuery) CountX

func (icq *IcoCouponQuery) CountX(ctx context.Context) int

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

func (*IcoCouponQuery) ExecContext

func (c *IcoCouponQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponQuery) Exist

func (icq *IcoCouponQuery) Exist(ctx context.Context) (bool, error)

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

func (*IcoCouponQuery) ExistX

func (icq *IcoCouponQuery) ExistX(ctx context.Context) bool

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

func (*IcoCouponQuery) First

func (icq *IcoCouponQuery) First(ctx context.Context) (*IcoCoupon, error)

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

func (*IcoCouponQuery) FirstID

func (icq *IcoCouponQuery) FirstID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoCouponQuery) FirstIDX

func (icq *IcoCouponQuery) FirstIDX(ctx context.Context) xid.ID

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

func (*IcoCouponQuery) FirstX

func (icq *IcoCouponQuery) FirstX(ctx context.Context) *IcoCoupon

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

func (*IcoCouponQuery) GroupBy

func (icq *IcoCouponQuery) GroupBy(field string, fields ...string) *IcoCouponGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IcoCoupon.Query().
	GroupBy(icocoupon.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IcoCouponQuery) IDs

func (icq *IcoCouponQuery) IDs(ctx context.Context) (ids []xid.ID, err error)

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

func (*IcoCouponQuery) IDsX

func (icq *IcoCouponQuery) IDsX(ctx context.Context) []xid.ID

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

func (*IcoCouponQuery) Limit

func (icq *IcoCouponQuery) Limit(limit int) *IcoCouponQuery

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

func (*IcoCouponQuery) Modify

func (icq *IcoCouponQuery) Modify(modifiers ...func(s *sql.Selector)) *IcoCouponSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*IcoCouponQuery) Offset

func (icq *IcoCouponQuery) Offset(offset int) *IcoCouponQuery

Offset to start from.

func (*IcoCouponQuery) Only

func (icq *IcoCouponQuery) Only(ctx context.Context) (*IcoCoupon, error)

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

func (*IcoCouponQuery) OnlyID

func (icq *IcoCouponQuery) OnlyID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoCouponQuery) OnlyIDX

func (icq *IcoCouponQuery) OnlyIDX(ctx context.Context) xid.ID

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

func (*IcoCouponQuery) OnlyX

func (icq *IcoCouponQuery) OnlyX(ctx context.Context) *IcoCoupon

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

func (*IcoCouponQuery) Order

Order specifies how the records should be ordered.

func (*IcoCouponQuery) QueryContext

func (c *IcoCouponQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponQuery) Select

func (icq *IcoCouponQuery) Select(fields ...string) *IcoCouponSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.IcoCoupon.Query().
	Select(icocoupon.FieldCreatedAt).
	Scan(ctx, &v)

func (*IcoCouponQuery) Unique

func (icq *IcoCouponQuery) Unique(unique bool) *IcoCouponQuery

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

func (icq *IcoCouponQuery) Where(ps ...predicate.IcoCoupon) *IcoCouponQuery

Where adds a new predicate for the IcoCouponQuery builder.

type IcoCouponSelect

type IcoCouponSelect struct {
	*IcoCouponQuery
	// contains filtered or unexported fields
}

IcoCouponSelect is the builder for selecting fields of IcoCoupon entities.

func (*IcoCouponSelect) Aggregate

func (ics *IcoCouponSelect) Aggregate(fns ...AggregateFunc) *IcoCouponSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IcoCouponSelect) Bool

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

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

func (*IcoCouponSelect) BoolX

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

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

func (*IcoCouponSelect) Bools

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

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

func (*IcoCouponSelect) BoolsX

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

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

func (IcoCouponSelect) ExecContext

func (c IcoCouponSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponSelect) Float64

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

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

func (*IcoCouponSelect) Float64X

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

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

func (*IcoCouponSelect) Float64s

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

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

func (*IcoCouponSelect) Float64sX

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

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

func (*IcoCouponSelect) Int

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

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

func (*IcoCouponSelect) IntX

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

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

func (*IcoCouponSelect) Ints

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

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

func (*IcoCouponSelect) IntsX

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

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

func (*IcoCouponSelect) Modify

func (ics *IcoCouponSelect) Modify(modifiers ...func(s *sql.Selector)) *IcoCouponSelect

Modify adds a query modifier for attaching custom logic to queries.

func (IcoCouponSelect) QueryContext

func (c IcoCouponSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponSelect) Scan

func (ics *IcoCouponSelect) Scan(ctx context.Context, v any) error

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

func (*IcoCouponSelect) ScanX

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

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

func (*IcoCouponSelect) String

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

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

func (*IcoCouponSelect) StringX

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

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

func (*IcoCouponSelect) Strings

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

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

func (*IcoCouponSelect) StringsX

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

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

type IcoCouponUpdate

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

IcoCouponUpdate is the builder for updating IcoCoupon entities.

func (*IcoCouponUpdate) ClearDeletedAt

func (icu *IcoCouponUpdate) ClearDeletedAt() *IcoCouponUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*IcoCouponUpdate) Exec

func (icu *IcoCouponUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoCouponUpdate) ExecContext

func (c *IcoCouponUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponUpdate) ExecX

func (icu *IcoCouponUpdate) ExecX(ctx context.Context)

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

func (*IcoCouponUpdate) Modify

func (icu *IcoCouponUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoCouponUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoCouponUpdate) Mutation

func (icu *IcoCouponUpdate) Mutation() *IcoCouponMutation

Mutation returns the IcoCouponMutation object of the builder.

func (*IcoCouponUpdate) QueryContext

func (c *IcoCouponUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponUpdate) Save

func (icu *IcoCouponUpdate) Save(ctx context.Context) (int, error)

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

func (*IcoCouponUpdate) SaveX

func (icu *IcoCouponUpdate) SaveX(ctx context.Context) int

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

func (*IcoCouponUpdate) SetCashback

func (icu *IcoCouponUpdate) SetCashback(s string) *IcoCouponUpdate

SetCashback sets the "cashback" field.

func (*IcoCouponUpdate) SetCoupon

func (icu *IcoCouponUpdate) SetCoupon(s string) *IcoCouponUpdate

SetCoupon sets the "coupon" field.

func (*IcoCouponUpdate) SetDeletedAt

func (icu *IcoCouponUpdate) SetDeletedAt(t time.Time) *IcoCouponUpdate

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponUpdate) SetNillableCashback

func (icu *IcoCouponUpdate) SetNillableCashback(s *string) *IcoCouponUpdate

SetNillableCashback sets the "cashback" field if the given value is not nil.

func (*IcoCouponUpdate) SetNillableCoupon

func (icu *IcoCouponUpdate) SetNillableCoupon(s *string) *IcoCouponUpdate

SetNillableCoupon sets the "coupon" field if the given value is not nil.

func (*IcoCouponUpdate) SetNillableDeletedAt

func (icu *IcoCouponUpdate) SetNillableDeletedAt(t *time.Time) *IcoCouponUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*IcoCouponUpdate) SetNillableReward

func (icu *IcoCouponUpdate) SetNillableReward(s *string) *IcoCouponUpdate

SetNillableReward sets the "reward" field if the given value is not nil.

func (*IcoCouponUpdate) SetNillableUserID

func (icu *IcoCouponUpdate) SetNillableUserID(s *string) *IcoCouponUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*IcoCouponUpdate) SetReward

func (icu *IcoCouponUpdate) SetReward(s string) *IcoCouponUpdate

SetReward sets the "reward" field.

func (*IcoCouponUpdate) SetUpdatedAt

func (icu *IcoCouponUpdate) SetUpdatedAt(t time.Time) *IcoCouponUpdate

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponUpdate) SetUserID

func (icu *IcoCouponUpdate) SetUserID(s string) *IcoCouponUpdate

SetUserID sets the "user_id" field.

func (*IcoCouponUpdate) Where

Where appends a list predicates to the IcoCouponUpdate builder.

type IcoCouponUpdateOne

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

IcoCouponUpdateOne is the builder for updating a single IcoCoupon entity.

func (*IcoCouponUpdateOne) ClearDeletedAt

func (icuo *IcoCouponUpdateOne) ClearDeletedAt() *IcoCouponUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*IcoCouponUpdateOne) Exec

func (icuo *IcoCouponUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IcoCouponUpdateOne) ExecContext

func (c *IcoCouponUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCouponUpdateOne) ExecX

func (icuo *IcoCouponUpdateOne) ExecX(ctx context.Context)

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

func (*IcoCouponUpdateOne) Modify

func (icuo *IcoCouponUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoCouponUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoCouponUpdateOne) Mutation

func (icuo *IcoCouponUpdateOne) Mutation() *IcoCouponMutation

Mutation returns the IcoCouponMutation object of the builder.

func (*IcoCouponUpdateOne) QueryContext

func (c *IcoCouponUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCouponUpdateOne) Save

func (icuo *IcoCouponUpdateOne) Save(ctx context.Context) (*IcoCoupon, error)

Save executes the query and returns the updated IcoCoupon entity.

func (*IcoCouponUpdateOne) SaveX

func (icuo *IcoCouponUpdateOne) SaveX(ctx context.Context) *IcoCoupon

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

func (*IcoCouponUpdateOne) Select

func (icuo *IcoCouponUpdateOne) Select(field string, fields ...string) *IcoCouponUpdateOne

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

func (*IcoCouponUpdateOne) SetCashback

func (icuo *IcoCouponUpdateOne) SetCashback(s string) *IcoCouponUpdateOne

SetCashback sets the "cashback" field.

func (*IcoCouponUpdateOne) SetCoupon

func (icuo *IcoCouponUpdateOne) SetCoupon(s string) *IcoCouponUpdateOne

SetCoupon sets the "coupon" field.

func (*IcoCouponUpdateOne) SetDeletedAt

func (icuo *IcoCouponUpdateOne) SetDeletedAt(t time.Time) *IcoCouponUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponUpdateOne) SetNillableCashback

func (icuo *IcoCouponUpdateOne) SetNillableCashback(s *string) *IcoCouponUpdateOne

SetNillableCashback sets the "cashback" field if the given value is not nil.

func (*IcoCouponUpdateOne) SetNillableCoupon

func (icuo *IcoCouponUpdateOne) SetNillableCoupon(s *string) *IcoCouponUpdateOne

SetNillableCoupon sets the "coupon" field if the given value is not nil.

func (*IcoCouponUpdateOne) SetNillableDeletedAt

func (icuo *IcoCouponUpdateOne) SetNillableDeletedAt(t *time.Time) *IcoCouponUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*IcoCouponUpdateOne) SetNillableReward

func (icuo *IcoCouponUpdateOne) SetNillableReward(s *string) *IcoCouponUpdateOne

SetNillableReward sets the "reward" field if the given value is not nil.

func (*IcoCouponUpdateOne) SetNillableUserID

func (icuo *IcoCouponUpdateOne) SetNillableUserID(s *string) *IcoCouponUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*IcoCouponUpdateOne) SetReward

func (icuo *IcoCouponUpdateOne) SetReward(s string) *IcoCouponUpdateOne

SetReward sets the "reward" field.

func (*IcoCouponUpdateOne) SetUpdatedAt

func (icuo *IcoCouponUpdateOne) SetUpdatedAt(t time.Time) *IcoCouponUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponUpdateOne) SetUserID

func (icuo *IcoCouponUpdateOne) SetUserID(s string) *IcoCouponUpdateOne

SetUserID sets the "user_id" field.

func (*IcoCouponUpdateOne) Where

Where appends a list predicates to the IcoCouponUpdate builder.

type IcoCouponUpsert

type IcoCouponUpsert struct {
	*sql.UpdateSet
}

IcoCouponUpsert is the "OnConflict" setter.

func (*IcoCouponUpsert) ClearDeletedAt

func (u *IcoCouponUpsert) ClearDeletedAt() *IcoCouponUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*IcoCouponUpsert) SetCashback

func (u *IcoCouponUpsert) SetCashback(v string) *IcoCouponUpsert

SetCashback sets the "cashback" field.

func (*IcoCouponUpsert) SetCoupon

func (u *IcoCouponUpsert) SetCoupon(v string) *IcoCouponUpsert

SetCoupon sets the "coupon" field.

func (*IcoCouponUpsert) SetDeletedAt

func (u *IcoCouponUpsert) SetDeletedAt(v time.Time) *IcoCouponUpsert

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponUpsert) SetReward

func (u *IcoCouponUpsert) SetReward(v string) *IcoCouponUpsert

SetReward sets the "reward" field.

func (*IcoCouponUpsert) SetUpdatedAt

func (u *IcoCouponUpsert) SetUpdatedAt(v time.Time) *IcoCouponUpsert

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponUpsert) SetUserID

func (u *IcoCouponUpsert) SetUserID(v string) *IcoCouponUpsert

SetUserID sets the "user_id" field.

func (*IcoCouponUpsert) UpdateCashback

func (u *IcoCouponUpsert) UpdateCashback() *IcoCouponUpsert

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

func (*IcoCouponUpsert) UpdateCoupon

func (u *IcoCouponUpsert) UpdateCoupon() *IcoCouponUpsert

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

func (*IcoCouponUpsert) UpdateDeletedAt

func (u *IcoCouponUpsert) UpdateDeletedAt() *IcoCouponUpsert

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

func (*IcoCouponUpsert) UpdateReward

func (u *IcoCouponUpsert) UpdateReward() *IcoCouponUpsert

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

func (*IcoCouponUpsert) UpdateUpdatedAt

func (u *IcoCouponUpsert) UpdateUpdatedAt() *IcoCouponUpsert

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

func (*IcoCouponUpsert) UpdateUserID

func (u *IcoCouponUpsert) UpdateUserID() *IcoCouponUpsert

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

type IcoCouponUpsertBulk

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

IcoCouponUpsertBulk is the builder for "upsert"-ing a bulk of IcoCoupon nodes.

func (*IcoCouponUpsertBulk) ClearDeletedAt

func (u *IcoCouponUpsertBulk) ClearDeletedAt() *IcoCouponUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*IcoCouponUpsertBulk) DoNothing

func (u *IcoCouponUpsertBulk) DoNothing() *IcoCouponUpsertBulk

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

func (*IcoCouponUpsertBulk) Exec

Exec executes the query.

func (*IcoCouponUpsertBulk) ExecX

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

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

func (*IcoCouponUpsertBulk) Ignore

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

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

func (*IcoCouponUpsertBulk) SetCashback

func (u *IcoCouponUpsertBulk) SetCashback(v string) *IcoCouponUpsertBulk

SetCashback sets the "cashback" field.

func (*IcoCouponUpsertBulk) SetCoupon

SetCoupon sets the "coupon" field.

func (*IcoCouponUpsertBulk) SetDeletedAt

func (u *IcoCouponUpsertBulk) SetDeletedAt(v time.Time) *IcoCouponUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponUpsertBulk) SetReward

SetReward sets the "reward" field.

func (*IcoCouponUpsertBulk) SetUpdatedAt

func (u *IcoCouponUpsertBulk) SetUpdatedAt(v time.Time) *IcoCouponUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*IcoCouponUpsertBulk) Update

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

func (*IcoCouponUpsertBulk) UpdateCashback

func (u *IcoCouponUpsertBulk) UpdateCashback() *IcoCouponUpsertBulk

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

func (*IcoCouponUpsertBulk) UpdateCoupon

func (u *IcoCouponUpsertBulk) UpdateCoupon() *IcoCouponUpsertBulk

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

func (*IcoCouponUpsertBulk) UpdateDeletedAt

func (u *IcoCouponUpsertBulk) UpdateDeletedAt() *IcoCouponUpsertBulk

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

func (*IcoCouponUpsertBulk) UpdateNewValues

func (u *IcoCouponUpsertBulk) UpdateNewValues() *IcoCouponUpsertBulk

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

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

func (*IcoCouponUpsertBulk) UpdateReward

func (u *IcoCouponUpsertBulk) UpdateReward() *IcoCouponUpsertBulk

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

func (*IcoCouponUpsertBulk) UpdateUpdatedAt

func (u *IcoCouponUpsertBulk) UpdateUpdatedAt() *IcoCouponUpsertBulk

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

func (*IcoCouponUpsertBulk) UpdateUserID

func (u *IcoCouponUpsertBulk) UpdateUserID() *IcoCouponUpsertBulk

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

type IcoCouponUpsertOne

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

IcoCouponUpsertOne is the builder for "upsert"-ing

one IcoCoupon node.

func (*IcoCouponUpsertOne) ClearDeletedAt

func (u *IcoCouponUpsertOne) ClearDeletedAt() *IcoCouponUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*IcoCouponUpsertOne) DoNothing

func (u *IcoCouponUpsertOne) DoNothing() *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) Exec

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

Exec executes the query.

func (*IcoCouponUpsertOne) ExecX

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

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

func (*IcoCouponUpsertOne) ID

func (u *IcoCouponUpsertOne) ID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoCouponUpsertOne) IDX

func (u *IcoCouponUpsertOne) IDX(ctx context.Context) xid.ID

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

func (*IcoCouponUpsertOne) Ignore

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

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

func (*IcoCouponUpsertOne) SetCashback

func (u *IcoCouponUpsertOne) SetCashback(v string) *IcoCouponUpsertOne

SetCashback sets the "cashback" field.

func (*IcoCouponUpsertOne) SetCoupon

func (u *IcoCouponUpsertOne) SetCoupon(v string) *IcoCouponUpsertOne

SetCoupon sets the "coupon" field.

func (*IcoCouponUpsertOne) SetDeletedAt

func (u *IcoCouponUpsertOne) SetDeletedAt(v time.Time) *IcoCouponUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*IcoCouponUpsertOne) SetReward

func (u *IcoCouponUpsertOne) SetReward(v string) *IcoCouponUpsertOne

SetReward sets the "reward" field.

func (*IcoCouponUpsertOne) SetUpdatedAt

func (u *IcoCouponUpsertOne) SetUpdatedAt(v time.Time) *IcoCouponUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoCouponUpsertOne) SetUserID

func (u *IcoCouponUpsertOne) SetUserID(v string) *IcoCouponUpsertOne

SetUserID sets the "user_id" field.

func (*IcoCouponUpsertOne) Update

func (u *IcoCouponUpsertOne) Update(set func(*IcoCouponUpsert)) *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) UpdateCashback

func (u *IcoCouponUpsertOne) UpdateCashback() *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) UpdateCoupon

func (u *IcoCouponUpsertOne) UpdateCoupon() *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) UpdateDeletedAt

func (u *IcoCouponUpsertOne) UpdateDeletedAt() *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) UpdateNewValues

func (u *IcoCouponUpsertOne) UpdateNewValues() *IcoCouponUpsertOne

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

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

func (*IcoCouponUpsertOne) UpdateReward

func (u *IcoCouponUpsertOne) UpdateReward() *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) UpdateUpdatedAt

func (u *IcoCouponUpsertOne) UpdateUpdatedAt() *IcoCouponUpsertOne

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

func (*IcoCouponUpsertOne) UpdateUserID

func (u *IcoCouponUpsertOne) UpdateUserID() *IcoCouponUpsertOne

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

type IcoCoupons

type IcoCoupons []*IcoCoupon

IcoCoupons is a parsable slice of IcoCoupon.

type IcoCreate

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

IcoCreate is the builder for creating a Ico entity.

func (*IcoCreate) Exec

func (ic *IcoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoCreate) ExecContext

func (c *IcoCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCreate) ExecX

func (ic *IcoCreate) ExecX(ctx context.Context)

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

func (*IcoCreate) Mutation

func (ic *IcoCreate) Mutation() *IcoMutation

Mutation returns the IcoMutation object of the builder.

func (*IcoCreate) OnConflict

func (ic *IcoCreate) OnConflict(opts ...sql.ConflictOption) *IcoUpsertOne

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

client.Ico.Create().
	SetCreatedAt(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.IcoUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoCreate) OnConflictColumns

func (ic *IcoCreate) OnConflictColumns(columns ...string) *IcoUpsertOne

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

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

func (*IcoCreate) QueryContext

func (c *IcoCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCreate) Save

func (ic *IcoCreate) Save(ctx context.Context) (*Ico, error)

Save creates the Ico in the database.

func (*IcoCreate) SaveX

func (ic *IcoCreate) SaveX(ctx context.Context) *Ico

SaveX calls Save and panics if Save returns an error.

func (*IcoCreate) SetCreatedAt

func (ic *IcoCreate) SetCreatedAt(t time.Time) *IcoCreate

SetCreatedAt sets the "created_at" field.

func (*IcoCreate) SetEndedAt

func (ic *IcoCreate) SetEndedAt(t time.Time) *IcoCreate

SetEndedAt sets the "ended_at" field.

func (*IcoCreate) SetID

func (ic *IcoCreate) SetID(x xid.ID) *IcoCreate

SetID sets the "id" field.

func (*IcoCreate) SetNillableCreatedAt

func (ic *IcoCreate) SetNillableCreatedAt(t *time.Time) *IcoCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*IcoCreate) SetNillableEndedAt

func (ic *IcoCreate) SetNillableEndedAt(t *time.Time) *IcoCreate

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*IcoCreate) SetNillableID

func (ic *IcoCreate) SetNillableID(x *xid.ID) *IcoCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*IcoCreate) SetNillableUpdatedAt

func (ic *IcoCreate) SetNillableUpdatedAt(t *time.Time) *IcoCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*IcoCreate) SetNumSub

func (ic *IcoCreate) SetNumSub(i int32) *IcoCreate

SetNumSub sets the "num_sub" field.

func (*IcoCreate) SetNumToken

func (ic *IcoCreate) SetNumToken(s string) *IcoCreate

SetNumToken sets the "num_token" field.

func (*IcoCreate) SetPrice

func (ic *IcoCreate) SetPrice(s string) *IcoCreate

SetPrice sets the "price" field.

func (*IcoCreate) SetPriceGap

func (ic *IcoCreate) SetPriceGap(s string) *IcoCreate

SetPriceGap sets the "price_gap" field.

func (*IcoCreate) SetRoundID

func (ic *IcoCreate) SetRoundID(i int32) *IcoCreate

SetRoundID sets the "round_id" field.

func (*IcoCreate) SetRoundName

func (ic *IcoCreate) SetRoundName(s string) *IcoCreate

SetRoundName sets the "round_name" field.

func (*IcoCreate) SetUpdatedAt

func (ic *IcoCreate) SetUpdatedAt(t time.Time) *IcoCreate

SetUpdatedAt sets the "updated_at" field.

type IcoCreateBulk

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

IcoCreateBulk is the builder for creating many Ico entities in bulk.

func (*IcoCreateBulk) Exec

func (icb *IcoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoCreateBulk) ExecContext

func (c *IcoCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoCreateBulk) ExecX

func (icb *IcoCreateBulk) ExecX(ctx context.Context)

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

func (*IcoCreateBulk) OnConflict

func (icb *IcoCreateBulk) OnConflict(opts ...sql.ConflictOption) *IcoUpsertBulk

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

client.Ico.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.IcoUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoCreateBulk) OnConflictColumns

func (icb *IcoCreateBulk) OnConflictColumns(columns ...string) *IcoUpsertBulk

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

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

func (*IcoCreateBulk) QueryContext

func (c *IcoCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoCreateBulk) Save

func (icb *IcoCreateBulk) Save(ctx context.Context) ([]*Ico, error)

Save creates the Ico entities in the database.

func (*IcoCreateBulk) SaveX

func (icb *IcoCreateBulk) SaveX(ctx context.Context) []*Ico

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

type IcoDelete

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

IcoDelete is the builder for deleting a Ico entity.

func (*IcoDelete) Exec

func (id *IcoDelete) Exec(ctx context.Context) (int, error)

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

func (*IcoDelete) ExecContext

func (c *IcoDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoDelete) ExecX

func (id *IcoDelete) ExecX(ctx context.Context) int

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

func (*IcoDelete) QueryContext

func (c *IcoDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoDelete) Where

func (id *IcoDelete) Where(ps ...predicate.Ico) *IcoDelete

Where appends a list predicates to the IcoDelete builder.

type IcoDeleteOne

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

IcoDeleteOne is the builder for deleting a single Ico entity.

func (*IcoDeleteOne) Exec

func (ido *IcoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IcoDeleteOne) ExecX

func (ido *IcoDeleteOne) ExecX(ctx context.Context)

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

func (*IcoDeleteOne) Where

func (ido *IcoDeleteOne) Where(ps ...predicate.Ico) *IcoDeleteOne

Where appends a list predicates to the IcoDelete builder.

type IcoGroupBy

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

IcoGroupBy is the group-by builder for Ico entities.

func (*IcoGroupBy) Aggregate

func (igb *IcoGroupBy) Aggregate(fns ...AggregateFunc) *IcoGroupBy

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

func (*IcoGroupBy) Bool

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

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

func (*IcoGroupBy) BoolX

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

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

func (*IcoGroupBy) Bools

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

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

func (*IcoGroupBy) BoolsX

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

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

func (*IcoGroupBy) Float64

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

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

func (*IcoGroupBy) Float64X

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

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

func (*IcoGroupBy) Float64s

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

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

func (*IcoGroupBy) Float64sX

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

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

func (*IcoGroupBy) Int

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

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

func (*IcoGroupBy) IntX

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

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

func (*IcoGroupBy) Ints

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

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

func (*IcoGroupBy) IntsX

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

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

func (*IcoGroupBy) Scan

func (igb *IcoGroupBy) Scan(ctx context.Context, v any) error

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

func (*IcoGroupBy) ScanX

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

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

func (*IcoGroupBy) String

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

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

func (*IcoGroupBy) StringX

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

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

func (*IcoGroupBy) Strings

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

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

func (*IcoGroupBy) StringsX

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

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

type IcoHistories

type IcoHistories []*IcoHistory

IcoHistories is a parsable slice of IcoHistory.

type IcoHistory

type IcoHistory struct {

	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// RoundID holds the value of the "round_id" field.
	RoundID int32 `json:"round_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Price holds the value of the "price" field.
	Price string `json:"price,omitempty"`
	// NumToken holds the value of the "num_token" field.
	NumToken string `json:"num_token,omitempty"`
	// SubRound holds the value of the "sub_round" field.
	SubRound int32 `json:"sub_round,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// contains filtered or unexported fields
}

IcoHistory is the model entity for the IcoHistory schema.

func (*IcoHistory) ExecContext

func (c *IcoHistory) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistory) QueryContext

func (c *IcoHistory) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistory) String

func (ih *IcoHistory) String() string

String implements the fmt.Stringer.

func (*IcoHistory) Unwrap

func (ih *IcoHistory) Unwrap() *IcoHistory

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

func (ih *IcoHistory) Update() *IcoHistoryUpdateOne

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

func (*IcoHistory) Value

func (ih *IcoHistory) Value(name string) (ent.Value, error)

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

type IcoHistoryClient

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

IcoHistoryClient is a client for the IcoHistory schema.

func NewIcoHistoryClient

func NewIcoHistoryClient(c config) *IcoHistoryClient

NewIcoHistoryClient returns a client for the IcoHistory from the given config.

func (*IcoHistoryClient) Create

func (c *IcoHistoryClient) Create() *IcoHistoryCreate

Create returns a builder for creating a IcoHistory entity.

func (*IcoHistoryClient) CreateBulk

func (c *IcoHistoryClient) CreateBulk(builders ...*IcoHistoryCreate) *IcoHistoryCreateBulk

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

func (*IcoHistoryClient) Delete

func (c *IcoHistoryClient) Delete() *IcoHistoryDelete

Delete returns a delete builder for IcoHistory.

func (*IcoHistoryClient) DeleteOne

func (c *IcoHistoryClient) DeleteOne(ih *IcoHistory) *IcoHistoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IcoHistoryClient) DeleteOneID

func (c *IcoHistoryClient) DeleteOneID(id xid.ID) *IcoHistoryDeleteOne

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

func (*IcoHistoryClient) ExecContext

func (c *IcoHistoryClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryClient) Get

func (c *IcoHistoryClient) Get(ctx context.Context, id xid.ID) (*IcoHistory, error)

Get returns a IcoHistory entity by its id.

func (*IcoHistoryClient) GetX

func (c *IcoHistoryClient) GetX(ctx context.Context, id xid.ID) *IcoHistory

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

func (*IcoHistoryClient) Hooks

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

Hooks returns the client hooks.

func (*IcoHistoryClient) Intercept

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

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

func (*IcoHistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IcoHistoryClient) MapCreateBulk

func (c *IcoHistoryClient) MapCreateBulk(slice any, setFunc func(*IcoHistoryCreate, int)) *IcoHistoryCreateBulk

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

func (c *IcoHistoryClient) Query() *IcoHistoryQuery

Query returns a query builder for IcoHistory.

func (*IcoHistoryClient) QueryContext

func (c *IcoHistoryClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryClient) Update

func (c *IcoHistoryClient) Update() *IcoHistoryUpdate

Update returns an update builder for IcoHistory.

func (*IcoHistoryClient) UpdateOne

func (c *IcoHistoryClient) UpdateOne(ih *IcoHistory) *IcoHistoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IcoHistoryClient) UpdateOneID

func (c *IcoHistoryClient) UpdateOneID(id xid.ID) *IcoHistoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IcoHistoryClient) Use

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

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

type IcoHistoryCreate

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

IcoHistoryCreate is the builder for creating a IcoHistory entity.

func (*IcoHistoryCreate) Exec

func (ihc *IcoHistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoHistoryCreate) ExecContext

func (c *IcoHistoryCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryCreate) ExecX

func (ihc *IcoHistoryCreate) ExecX(ctx context.Context)

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

func (*IcoHistoryCreate) Mutation

func (ihc *IcoHistoryCreate) Mutation() *IcoHistoryMutation

Mutation returns the IcoHistoryMutation object of the builder.

func (*IcoHistoryCreate) OnConflict

func (ihc *IcoHistoryCreate) OnConflict(opts ...sql.ConflictOption) *IcoHistoryUpsertOne

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

client.IcoHistory.Create().
	SetCreatedAt(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.IcoHistoryUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoHistoryCreate) OnConflictColumns

func (ihc *IcoHistoryCreate) OnConflictColumns(columns ...string) *IcoHistoryUpsertOne

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

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

func (*IcoHistoryCreate) QueryContext

func (c *IcoHistoryCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryCreate) Save

func (ihc *IcoHistoryCreate) Save(ctx context.Context) (*IcoHistory, error)

Save creates the IcoHistory in the database.

func (*IcoHistoryCreate) SaveX

func (ihc *IcoHistoryCreate) SaveX(ctx context.Context) *IcoHistory

SaveX calls Save and panics if Save returns an error.

func (*IcoHistoryCreate) SetCreatedAt

func (ihc *IcoHistoryCreate) SetCreatedAt(t time.Time) *IcoHistoryCreate

SetCreatedAt sets the "created_at" field.

func (*IcoHistoryCreate) SetID

func (ihc *IcoHistoryCreate) SetID(x xid.ID) *IcoHistoryCreate

SetID sets the "id" field.

func (*IcoHistoryCreate) SetNillableCreatedAt

func (ihc *IcoHistoryCreate) SetNillableCreatedAt(t *time.Time) *IcoHistoryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*IcoHistoryCreate) SetNillableID

func (ihc *IcoHistoryCreate) SetNillableID(x *xid.ID) *IcoHistoryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*IcoHistoryCreate) SetNillableType

func (ihc *IcoHistoryCreate) SetNillableType(s *string) *IcoHistoryCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*IcoHistoryCreate) SetNillableUpdatedAt

func (ihc *IcoHistoryCreate) SetNillableUpdatedAt(t *time.Time) *IcoHistoryCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*IcoHistoryCreate) SetNumToken

func (ihc *IcoHistoryCreate) SetNumToken(s string) *IcoHistoryCreate

SetNumToken sets the "num_token" field.

func (*IcoHistoryCreate) SetPrice

func (ihc *IcoHistoryCreate) SetPrice(s string) *IcoHistoryCreate

SetPrice sets the "price" field.

func (*IcoHistoryCreate) SetRoundID

func (ihc *IcoHistoryCreate) SetRoundID(i int32) *IcoHistoryCreate

SetRoundID sets the "round_id" field.

func (*IcoHistoryCreate) SetSubRound

func (ihc *IcoHistoryCreate) SetSubRound(i int32) *IcoHistoryCreate

SetSubRound sets the "sub_round" field.

func (*IcoHistoryCreate) SetType

func (ihc *IcoHistoryCreate) SetType(s string) *IcoHistoryCreate

SetType sets the "type" field.

func (*IcoHistoryCreate) SetUpdatedAt

func (ihc *IcoHistoryCreate) SetUpdatedAt(t time.Time) *IcoHistoryCreate

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryCreate) SetUserID

func (ihc *IcoHistoryCreate) SetUserID(s string) *IcoHistoryCreate

SetUserID sets the "user_id" field.

type IcoHistoryCreateBulk

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

IcoHistoryCreateBulk is the builder for creating many IcoHistory entities in bulk.

func (*IcoHistoryCreateBulk) Exec

func (ihcb *IcoHistoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoHistoryCreateBulk) ExecContext

func (c *IcoHistoryCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryCreateBulk) ExecX

func (ihcb *IcoHistoryCreateBulk) ExecX(ctx context.Context)

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

func (*IcoHistoryCreateBulk) OnConflict

func (ihcb *IcoHistoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *IcoHistoryUpsertBulk

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

client.IcoHistory.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.IcoHistoryUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoHistoryCreateBulk) OnConflictColumns

func (ihcb *IcoHistoryCreateBulk) OnConflictColumns(columns ...string) *IcoHistoryUpsertBulk

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

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

func (*IcoHistoryCreateBulk) QueryContext

func (c *IcoHistoryCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryCreateBulk) Save

func (ihcb *IcoHistoryCreateBulk) Save(ctx context.Context) ([]*IcoHistory, error)

Save creates the IcoHistory entities in the database.

func (*IcoHistoryCreateBulk) SaveX

func (ihcb *IcoHistoryCreateBulk) SaveX(ctx context.Context) []*IcoHistory

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

type IcoHistoryDelete

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

IcoHistoryDelete is the builder for deleting a IcoHistory entity.

func (*IcoHistoryDelete) Exec

func (ihd *IcoHistoryDelete) Exec(ctx context.Context) (int, error)

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

func (*IcoHistoryDelete) ExecContext

func (c *IcoHistoryDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryDelete) ExecX

func (ihd *IcoHistoryDelete) ExecX(ctx context.Context) int

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

func (*IcoHistoryDelete) QueryContext

func (c *IcoHistoryDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryDelete) Where

Where appends a list predicates to the IcoHistoryDelete builder.

type IcoHistoryDeleteOne

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

IcoHistoryDeleteOne is the builder for deleting a single IcoHistory entity.

func (*IcoHistoryDeleteOne) Exec

func (ihdo *IcoHistoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IcoHistoryDeleteOne) ExecX

func (ihdo *IcoHistoryDeleteOne) ExecX(ctx context.Context)

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

func (*IcoHistoryDeleteOne) Where

Where appends a list predicates to the IcoHistoryDelete builder.

type IcoHistoryGroupBy

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

IcoHistoryGroupBy is the group-by builder for IcoHistory entities.

func (*IcoHistoryGroupBy) Aggregate

func (ihgb *IcoHistoryGroupBy) Aggregate(fns ...AggregateFunc) *IcoHistoryGroupBy

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

func (*IcoHistoryGroupBy) Bool

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

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

func (*IcoHistoryGroupBy) BoolX

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

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

func (*IcoHistoryGroupBy) Bools

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

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

func (*IcoHistoryGroupBy) BoolsX

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

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

func (*IcoHistoryGroupBy) Float64

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

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

func (*IcoHistoryGroupBy) Float64X

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

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

func (*IcoHistoryGroupBy) Float64s

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

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

func (*IcoHistoryGroupBy) Float64sX

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

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

func (*IcoHistoryGroupBy) Int

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

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

func (*IcoHistoryGroupBy) IntX

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

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

func (*IcoHistoryGroupBy) Ints

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

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

func (*IcoHistoryGroupBy) IntsX

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

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

func (*IcoHistoryGroupBy) Scan

func (ihgb *IcoHistoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*IcoHistoryGroupBy) ScanX

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

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

func (*IcoHistoryGroupBy) String

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

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

func (*IcoHistoryGroupBy) StringX

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

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

func (*IcoHistoryGroupBy) Strings

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

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

func (*IcoHistoryGroupBy) StringsX

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

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

type IcoHistoryMutation

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

IcoHistoryMutation represents an operation that mutates the IcoHistory nodes in the graph.

func (*IcoHistoryMutation) AddField

func (m *IcoHistoryMutation) 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 (*IcoHistoryMutation) AddRoundID

func (m *IcoHistoryMutation) AddRoundID(i int32)

AddRoundID adds i to the "round_id" field.

func (*IcoHistoryMutation) AddSubRound

func (m *IcoHistoryMutation) AddSubRound(i int32)

AddSubRound adds i to the "sub_round" field.

func (*IcoHistoryMutation) AddedEdges

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

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

func (*IcoHistoryMutation) AddedField

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

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

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

func (*IcoHistoryMutation) AddedIDs

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

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

func (*IcoHistoryMutation) AddedRoundID

func (m *IcoHistoryMutation) AddedRoundID() (r int32, exists bool)

AddedRoundID returns the value that was added to the "round_id" field in this mutation.

func (*IcoHistoryMutation) AddedSubRound

func (m *IcoHistoryMutation) AddedSubRound() (r int32, exists bool)

AddedSubRound returns the value that was added to the "sub_round" field in this mutation.

func (*IcoHistoryMutation) ClearEdge

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

func (m *IcoHistoryMutation) 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 (*IcoHistoryMutation) ClearType

func (m *IcoHistoryMutation) ClearType()

ClearType clears the value of the "type" field.

func (*IcoHistoryMutation) ClearedEdges

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

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

func (*IcoHistoryMutation) ClearedFields

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

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

func (IcoHistoryMutation) Client

func (m IcoHistoryMutation) 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 (*IcoHistoryMutation) CreatedAt

func (m *IcoHistoryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*IcoHistoryMutation) EdgeCleared

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

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

func (*IcoHistoryMutation) ExecContext

func (c *IcoHistoryMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryMutation) Field

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

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

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

func (*IcoHistoryMutation) Fields

func (m *IcoHistoryMutation) 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 (*IcoHistoryMutation) GetType

func (m *IcoHistoryMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*IcoHistoryMutation) ID

func (m *IcoHistoryMutation) ID() (id xid.ID, 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 (*IcoHistoryMutation) IDs

func (m *IcoHistoryMutation) IDs(ctx context.Context) ([]xid.ID, 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 (*IcoHistoryMutation) NumToken

func (m *IcoHistoryMutation) NumToken() (r string, exists bool)

NumToken returns the value of the "num_token" field in the mutation.

func (*IcoHistoryMutation) OldCreatedAt

func (m *IcoHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldField

func (m *IcoHistoryMutation) 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 (*IcoHistoryMutation) OldNumToken

func (m *IcoHistoryMutation) OldNumToken(ctx context.Context) (v string, err error)

OldNumToken returns the old "num_token" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldPrice

func (m *IcoHistoryMutation) OldPrice(ctx context.Context) (v string, err error)

OldPrice returns the old "price" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldRoundID

func (m *IcoHistoryMutation) OldRoundID(ctx context.Context) (v int32, err error)

OldRoundID returns the old "round_id" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldSubRound

func (m *IcoHistoryMutation) OldSubRound(ctx context.Context) (v int32, err error)

OldSubRound returns the old "sub_round" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldType

func (m *IcoHistoryMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldUpdatedAt

func (m *IcoHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) OldUserID

func (m *IcoHistoryMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the IcoHistory entity. If the IcoHistory 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 (*IcoHistoryMutation) Op

func (m *IcoHistoryMutation) Op() Op

Op returns the operation name.

func (*IcoHistoryMutation) Price

func (m *IcoHistoryMutation) Price() (r string, exists bool)

Price returns the value of the "price" field in the mutation.

func (*IcoHistoryMutation) QueryContext

func (c *IcoHistoryMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryMutation) RemovedEdges

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

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

func (*IcoHistoryMutation) RemovedIDs

func (m *IcoHistoryMutation) 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 (*IcoHistoryMutation) ResetCreatedAt

func (m *IcoHistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IcoHistoryMutation) ResetEdge

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

func (m *IcoHistoryMutation) 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 (*IcoHistoryMutation) ResetNumToken

func (m *IcoHistoryMutation) ResetNumToken()

ResetNumToken resets all changes to the "num_token" field.

func (*IcoHistoryMutation) ResetPrice

func (m *IcoHistoryMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*IcoHistoryMutation) ResetRoundID

func (m *IcoHistoryMutation) ResetRoundID()

ResetRoundID resets all changes to the "round_id" field.

func (*IcoHistoryMutation) ResetSubRound

func (m *IcoHistoryMutation) ResetSubRound()

ResetSubRound resets all changes to the "sub_round" field.

func (*IcoHistoryMutation) ResetType

func (m *IcoHistoryMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*IcoHistoryMutation) ResetUpdatedAt

func (m *IcoHistoryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IcoHistoryMutation) ResetUserID

func (m *IcoHistoryMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*IcoHistoryMutation) RoundID

func (m *IcoHistoryMutation) RoundID() (r int32, exists bool)

RoundID returns the value of the "round_id" field in the mutation.

func (*IcoHistoryMutation) SetCreatedAt

func (m *IcoHistoryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*IcoHistoryMutation) SetField

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

func (m *IcoHistoryMutation) SetID(id xid.ID)

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

func (*IcoHistoryMutation) SetNumToken

func (m *IcoHistoryMutation) SetNumToken(s string)

SetNumToken sets the "num_token" field.

func (*IcoHistoryMutation) SetOp

func (m *IcoHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IcoHistoryMutation) SetPrice

func (m *IcoHistoryMutation) SetPrice(s string)

SetPrice sets the "price" field.

func (*IcoHistoryMutation) SetRoundID

func (m *IcoHistoryMutation) SetRoundID(i int32)

SetRoundID sets the "round_id" field.

func (*IcoHistoryMutation) SetSubRound

func (m *IcoHistoryMutation) SetSubRound(i int32)

SetSubRound sets the "sub_round" field.

func (*IcoHistoryMutation) SetType

func (m *IcoHistoryMutation) SetType(s string)

SetType sets the "type" field.

func (*IcoHistoryMutation) SetUpdatedAt

func (m *IcoHistoryMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryMutation) SetUserID

func (m *IcoHistoryMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*IcoHistoryMutation) SubRound

func (m *IcoHistoryMutation) SubRound() (r int32, exists bool)

SubRound returns the value of the "sub_round" field in the mutation.

func (IcoHistoryMutation) Tx

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

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

func (*IcoHistoryMutation) Type

func (m *IcoHistoryMutation) Type() string

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

func (*IcoHistoryMutation) TypeCleared

func (m *IcoHistoryMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*IcoHistoryMutation) UpdatedAt

func (m *IcoHistoryMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*IcoHistoryMutation) UserID

func (m *IcoHistoryMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*IcoHistoryMutation) Where

func (m *IcoHistoryMutation) Where(ps ...predicate.IcoHistory)

Where appends a list predicates to the IcoHistoryMutation builder.

func (*IcoHistoryMutation) WhereP

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

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

type IcoHistoryQuery

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

IcoHistoryQuery is the builder for querying IcoHistory entities.

func (*IcoHistoryQuery) Aggregate

func (ihq *IcoHistoryQuery) Aggregate(fns ...AggregateFunc) *IcoHistorySelect

Aggregate returns a IcoHistorySelect configured with the given aggregations.

func (*IcoHistoryQuery) All

func (ihq *IcoHistoryQuery) All(ctx context.Context) ([]*IcoHistory, error)

All executes the query and returns a list of IcoHistories.

func (*IcoHistoryQuery) AllX

func (ihq *IcoHistoryQuery) AllX(ctx context.Context) []*IcoHistory

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

func (*IcoHistoryQuery) Clone

func (ihq *IcoHistoryQuery) Clone() *IcoHistoryQuery

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

func (*IcoHistoryQuery) Count

func (ihq *IcoHistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IcoHistoryQuery) CountX

func (ihq *IcoHistoryQuery) CountX(ctx context.Context) int

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

func (*IcoHistoryQuery) ExecContext

func (c *IcoHistoryQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryQuery) Exist

func (ihq *IcoHistoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*IcoHistoryQuery) ExistX

func (ihq *IcoHistoryQuery) ExistX(ctx context.Context) bool

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

func (*IcoHistoryQuery) First

func (ihq *IcoHistoryQuery) First(ctx context.Context) (*IcoHistory, error)

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

func (*IcoHistoryQuery) FirstID

func (ihq *IcoHistoryQuery) FirstID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoHistoryQuery) FirstIDX

func (ihq *IcoHistoryQuery) FirstIDX(ctx context.Context) xid.ID

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

func (*IcoHistoryQuery) FirstX

func (ihq *IcoHistoryQuery) FirstX(ctx context.Context) *IcoHistory

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

func (*IcoHistoryQuery) GroupBy

func (ihq *IcoHistoryQuery) GroupBy(field string, fields ...string) *IcoHistoryGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IcoHistory.Query().
	GroupBy(icohistory.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IcoHistoryQuery) IDs

func (ihq *IcoHistoryQuery) IDs(ctx context.Context) (ids []xid.ID, err error)

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

func (*IcoHistoryQuery) IDsX

func (ihq *IcoHistoryQuery) IDsX(ctx context.Context) []xid.ID

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

func (*IcoHistoryQuery) Limit

func (ihq *IcoHistoryQuery) Limit(limit int) *IcoHistoryQuery

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

func (*IcoHistoryQuery) Modify

func (ihq *IcoHistoryQuery) Modify(modifiers ...func(s *sql.Selector)) *IcoHistorySelect

Modify adds a query modifier for attaching custom logic to queries.

func (*IcoHistoryQuery) Offset

func (ihq *IcoHistoryQuery) Offset(offset int) *IcoHistoryQuery

Offset to start from.

func (*IcoHistoryQuery) Only

func (ihq *IcoHistoryQuery) Only(ctx context.Context) (*IcoHistory, error)

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

func (*IcoHistoryQuery) OnlyID

func (ihq *IcoHistoryQuery) OnlyID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoHistoryQuery) OnlyIDX

func (ihq *IcoHistoryQuery) OnlyIDX(ctx context.Context) xid.ID

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

func (*IcoHistoryQuery) OnlyX

func (ihq *IcoHistoryQuery) OnlyX(ctx context.Context) *IcoHistory

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

func (*IcoHistoryQuery) Order

Order specifies how the records should be ordered.

func (*IcoHistoryQuery) QueryContext

func (c *IcoHistoryQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryQuery) Select

func (ihq *IcoHistoryQuery) Select(fields ...string) *IcoHistorySelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.IcoHistory.Query().
	Select(icohistory.FieldCreatedAt).
	Scan(ctx, &v)

func (*IcoHistoryQuery) Unique

func (ihq *IcoHistoryQuery) Unique(unique bool) *IcoHistoryQuery

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

Where adds a new predicate for the IcoHistoryQuery builder.

type IcoHistorySelect

type IcoHistorySelect struct {
	*IcoHistoryQuery
	// contains filtered or unexported fields
}

IcoHistorySelect is the builder for selecting fields of IcoHistory entities.

func (*IcoHistorySelect) Aggregate

func (ihs *IcoHistorySelect) Aggregate(fns ...AggregateFunc) *IcoHistorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*IcoHistorySelect) Bool

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

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

func (*IcoHistorySelect) BoolX

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

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

func (*IcoHistorySelect) Bools

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

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

func (*IcoHistorySelect) BoolsX

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

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

func (IcoHistorySelect) ExecContext

func (c IcoHistorySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistorySelect) Float64

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

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

func (*IcoHistorySelect) Float64X

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

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

func (*IcoHistorySelect) Float64s

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

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

func (*IcoHistorySelect) Float64sX

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

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

func (*IcoHistorySelect) Int

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

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

func (*IcoHistorySelect) IntX

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

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

func (*IcoHistorySelect) Ints

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

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

func (*IcoHistorySelect) IntsX

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

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

func (*IcoHistorySelect) Modify

func (ihs *IcoHistorySelect) Modify(modifiers ...func(s *sql.Selector)) *IcoHistorySelect

Modify adds a query modifier for attaching custom logic to queries.

func (IcoHistorySelect) QueryContext

func (c IcoHistorySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistorySelect) Scan

func (ihs *IcoHistorySelect) Scan(ctx context.Context, v any) error

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

func (*IcoHistorySelect) ScanX

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

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

func (*IcoHistorySelect) String

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

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

func (*IcoHistorySelect) StringX

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

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

func (*IcoHistorySelect) Strings

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

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

func (*IcoHistorySelect) StringsX

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

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

type IcoHistoryUpdate

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

IcoHistoryUpdate is the builder for updating IcoHistory entities.

func (*IcoHistoryUpdate) AddRoundID

func (ihu *IcoHistoryUpdate) AddRoundID(i int32) *IcoHistoryUpdate

AddRoundID adds i to the "round_id" field.

func (*IcoHistoryUpdate) AddSubRound

func (ihu *IcoHistoryUpdate) AddSubRound(i int32) *IcoHistoryUpdate

AddSubRound adds i to the "sub_round" field.

func (*IcoHistoryUpdate) ClearType

func (ihu *IcoHistoryUpdate) ClearType() *IcoHistoryUpdate

ClearType clears the value of the "type" field.

func (*IcoHistoryUpdate) Exec

func (ihu *IcoHistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoHistoryUpdate) ExecContext

func (c *IcoHistoryUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryUpdate) ExecX

func (ihu *IcoHistoryUpdate) ExecX(ctx context.Context)

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

func (*IcoHistoryUpdate) Modify

func (ihu *IcoHistoryUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoHistoryUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoHistoryUpdate) Mutation

func (ihu *IcoHistoryUpdate) Mutation() *IcoHistoryMutation

Mutation returns the IcoHistoryMutation object of the builder.

func (*IcoHistoryUpdate) QueryContext

func (c *IcoHistoryUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryUpdate) Save

func (ihu *IcoHistoryUpdate) Save(ctx context.Context) (int, error)

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

func (*IcoHistoryUpdate) SaveX

func (ihu *IcoHistoryUpdate) SaveX(ctx context.Context) int

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

func (*IcoHistoryUpdate) SetNillableNumToken

func (ihu *IcoHistoryUpdate) SetNillableNumToken(s *string) *IcoHistoryUpdate

SetNillableNumToken sets the "num_token" field if the given value is not nil.

func (*IcoHistoryUpdate) SetNillablePrice

func (ihu *IcoHistoryUpdate) SetNillablePrice(s *string) *IcoHistoryUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*IcoHistoryUpdate) SetNillableRoundID

func (ihu *IcoHistoryUpdate) SetNillableRoundID(i *int32) *IcoHistoryUpdate

SetNillableRoundID sets the "round_id" field if the given value is not nil.

func (*IcoHistoryUpdate) SetNillableSubRound

func (ihu *IcoHistoryUpdate) SetNillableSubRound(i *int32) *IcoHistoryUpdate

SetNillableSubRound sets the "sub_round" field if the given value is not nil.

func (*IcoHistoryUpdate) SetNillableType

func (ihu *IcoHistoryUpdate) SetNillableType(s *string) *IcoHistoryUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*IcoHistoryUpdate) SetNillableUserID

func (ihu *IcoHistoryUpdate) SetNillableUserID(s *string) *IcoHistoryUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*IcoHistoryUpdate) SetNumToken

func (ihu *IcoHistoryUpdate) SetNumToken(s string) *IcoHistoryUpdate

SetNumToken sets the "num_token" field.

func (*IcoHistoryUpdate) SetPrice

func (ihu *IcoHistoryUpdate) SetPrice(s string) *IcoHistoryUpdate

SetPrice sets the "price" field.

func (*IcoHistoryUpdate) SetRoundID

func (ihu *IcoHistoryUpdate) SetRoundID(i int32) *IcoHistoryUpdate

SetRoundID sets the "round_id" field.

func (*IcoHistoryUpdate) SetSubRound

func (ihu *IcoHistoryUpdate) SetSubRound(i int32) *IcoHistoryUpdate

SetSubRound sets the "sub_round" field.

func (*IcoHistoryUpdate) SetType

func (ihu *IcoHistoryUpdate) SetType(s string) *IcoHistoryUpdate

SetType sets the "type" field.

func (*IcoHistoryUpdate) SetUpdatedAt

func (ihu *IcoHistoryUpdate) SetUpdatedAt(t time.Time) *IcoHistoryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryUpdate) SetUserID

func (ihu *IcoHistoryUpdate) SetUserID(s string) *IcoHistoryUpdate

SetUserID sets the "user_id" field.

func (*IcoHistoryUpdate) Where

Where appends a list predicates to the IcoHistoryUpdate builder.

type IcoHistoryUpdateOne

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

IcoHistoryUpdateOne is the builder for updating a single IcoHistory entity.

func (*IcoHistoryUpdateOne) AddRoundID

func (ihuo *IcoHistoryUpdateOne) AddRoundID(i int32) *IcoHistoryUpdateOne

AddRoundID adds i to the "round_id" field.

func (*IcoHistoryUpdateOne) AddSubRound

func (ihuo *IcoHistoryUpdateOne) AddSubRound(i int32) *IcoHistoryUpdateOne

AddSubRound adds i to the "sub_round" field.

func (*IcoHistoryUpdateOne) ClearType

func (ihuo *IcoHistoryUpdateOne) ClearType() *IcoHistoryUpdateOne

ClearType clears the value of the "type" field.

func (*IcoHistoryUpdateOne) Exec

func (ihuo *IcoHistoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IcoHistoryUpdateOne) ExecContext

func (c *IcoHistoryUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoHistoryUpdateOne) ExecX

func (ihuo *IcoHistoryUpdateOne) ExecX(ctx context.Context)

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

func (*IcoHistoryUpdateOne) Modify

func (ihuo *IcoHistoryUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoHistoryUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoHistoryUpdateOne) Mutation

func (ihuo *IcoHistoryUpdateOne) Mutation() *IcoHistoryMutation

Mutation returns the IcoHistoryMutation object of the builder.

func (*IcoHistoryUpdateOne) QueryContext

func (c *IcoHistoryUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoHistoryUpdateOne) Save

func (ihuo *IcoHistoryUpdateOne) Save(ctx context.Context) (*IcoHistory, error)

Save executes the query and returns the updated IcoHistory entity.

func (*IcoHistoryUpdateOne) SaveX

func (ihuo *IcoHistoryUpdateOne) SaveX(ctx context.Context) *IcoHistory

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

func (*IcoHistoryUpdateOne) Select

func (ihuo *IcoHistoryUpdateOne) Select(field string, fields ...string) *IcoHistoryUpdateOne

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

func (*IcoHistoryUpdateOne) SetNillableNumToken

func (ihuo *IcoHistoryUpdateOne) SetNillableNumToken(s *string) *IcoHistoryUpdateOne

SetNillableNumToken sets the "num_token" field if the given value is not nil.

func (*IcoHistoryUpdateOne) SetNillablePrice

func (ihuo *IcoHistoryUpdateOne) SetNillablePrice(s *string) *IcoHistoryUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*IcoHistoryUpdateOne) SetNillableRoundID

func (ihuo *IcoHistoryUpdateOne) SetNillableRoundID(i *int32) *IcoHistoryUpdateOne

SetNillableRoundID sets the "round_id" field if the given value is not nil.

func (*IcoHistoryUpdateOne) SetNillableSubRound

func (ihuo *IcoHistoryUpdateOne) SetNillableSubRound(i *int32) *IcoHistoryUpdateOne

SetNillableSubRound sets the "sub_round" field if the given value is not nil.

func (*IcoHistoryUpdateOne) SetNillableType

func (ihuo *IcoHistoryUpdateOne) SetNillableType(s *string) *IcoHistoryUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*IcoHistoryUpdateOne) SetNillableUserID

func (ihuo *IcoHistoryUpdateOne) SetNillableUserID(s *string) *IcoHistoryUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*IcoHistoryUpdateOne) SetNumToken

func (ihuo *IcoHistoryUpdateOne) SetNumToken(s string) *IcoHistoryUpdateOne

SetNumToken sets the "num_token" field.

func (*IcoHistoryUpdateOne) SetPrice

func (ihuo *IcoHistoryUpdateOne) SetPrice(s string) *IcoHistoryUpdateOne

SetPrice sets the "price" field.

func (*IcoHistoryUpdateOne) SetRoundID

func (ihuo *IcoHistoryUpdateOne) SetRoundID(i int32) *IcoHistoryUpdateOne

SetRoundID sets the "round_id" field.

func (*IcoHistoryUpdateOne) SetSubRound

func (ihuo *IcoHistoryUpdateOne) SetSubRound(i int32) *IcoHistoryUpdateOne

SetSubRound sets the "sub_round" field.

func (*IcoHistoryUpdateOne) SetType

SetType sets the "type" field.

func (*IcoHistoryUpdateOne) SetUpdatedAt

func (ihuo *IcoHistoryUpdateOne) SetUpdatedAt(t time.Time) *IcoHistoryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryUpdateOne) SetUserID

func (ihuo *IcoHistoryUpdateOne) SetUserID(s string) *IcoHistoryUpdateOne

SetUserID sets the "user_id" field.

func (*IcoHistoryUpdateOne) Where

Where appends a list predicates to the IcoHistoryUpdate builder.

type IcoHistoryUpsert

type IcoHistoryUpsert struct {
	*sql.UpdateSet
}

IcoHistoryUpsert is the "OnConflict" setter.

func (*IcoHistoryUpsert) AddRoundID

func (u *IcoHistoryUpsert) AddRoundID(v int32) *IcoHistoryUpsert

AddRoundID adds v to the "round_id" field.

func (*IcoHistoryUpsert) AddSubRound

func (u *IcoHistoryUpsert) AddSubRound(v int32) *IcoHistoryUpsert

AddSubRound adds v to the "sub_round" field.

func (*IcoHistoryUpsert) ClearType

func (u *IcoHistoryUpsert) ClearType() *IcoHistoryUpsert

ClearType clears the value of the "type" field.

func (*IcoHistoryUpsert) SetNumToken

func (u *IcoHistoryUpsert) SetNumToken(v string) *IcoHistoryUpsert

SetNumToken sets the "num_token" field.

func (*IcoHistoryUpsert) SetPrice

func (u *IcoHistoryUpsert) SetPrice(v string) *IcoHistoryUpsert

SetPrice sets the "price" field.

func (*IcoHistoryUpsert) SetRoundID

func (u *IcoHistoryUpsert) SetRoundID(v int32) *IcoHistoryUpsert

SetRoundID sets the "round_id" field.

func (*IcoHistoryUpsert) SetSubRound

func (u *IcoHistoryUpsert) SetSubRound(v int32) *IcoHistoryUpsert

SetSubRound sets the "sub_round" field.

func (*IcoHistoryUpsert) SetType

func (u *IcoHistoryUpsert) SetType(v string) *IcoHistoryUpsert

SetType sets the "type" field.

func (*IcoHistoryUpsert) SetUpdatedAt

func (u *IcoHistoryUpsert) SetUpdatedAt(v time.Time) *IcoHistoryUpsert

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryUpsert) SetUserID

func (u *IcoHistoryUpsert) SetUserID(v string) *IcoHistoryUpsert

SetUserID sets the "user_id" field.

func (*IcoHistoryUpsert) UpdateNumToken

func (u *IcoHistoryUpsert) UpdateNumToken() *IcoHistoryUpsert

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

func (*IcoHistoryUpsert) UpdatePrice

func (u *IcoHistoryUpsert) UpdatePrice() *IcoHistoryUpsert

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

func (*IcoHistoryUpsert) UpdateRoundID

func (u *IcoHistoryUpsert) UpdateRoundID() *IcoHistoryUpsert

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

func (*IcoHistoryUpsert) UpdateSubRound

func (u *IcoHistoryUpsert) UpdateSubRound() *IcoHistoryUpsert

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

func (*IcoHistoryUpsert) UpdateType

func (u *IcoHistoryUpsert) UpdateType() *IcoHistoryUpsert

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

func (*IcoHistoryUpsert) UpdateUpdatedAt

func (u *IcoHistoryUpsert) UpdateUpdatedAt() *IcoHistoryUpsert

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

func (*IcoHistoryUpsert) UpdateUserID

func (u *IcoHistoryUpsert) UpdateUserID() *IcoHistoryUpsert

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

type IcoHistoryUpsertBulk

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

IcoHistoryUpsertBulk is the builder for "upsert"-ing a bulk of IcoHistory nodes.

func (*IcoHistoryUpsertBulk) AddRoundID

AddRoundID adds v to the "round_id" field.

func (*IcoHistoryUpsertBulk) AddSubRound

func (u *IcoHistoryUpsertBulk) AddSubRound(v int32) *IcoHistoryUpsertBulk

AddSubRound adds v to the "sub_round" field.

func (*IcoHistoryUpsertBulk) ClearType

ClearType clears the value of the "type" field.

func (*IcoHistoryUpsertBulk) DoNothing

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

func (*IcoHistoryUpsertBulk) Exec

Exec executes the query.

func (*IcoHistoryUpsertBulk) ExecX

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

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

func (*IcoHistoryUpsertBulk) Ignore

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

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

func (*IcoHistoryUpsertBulk) SetNumToken

SetNumToken sets the "num_token" field.

func (*IcoHistoryUpsertBulk) SetPrice

SetPrice sets the "price" field.

func (*IcoHistoryUpsertBulk) SetRoundID

SetRoundID sets the "round_id" field.

func (*IcoHistoryUpsertBulk) SetSubRound

func (u *IcoHistoryUpsertBulk) SetSubRound(v int32) *IcoHistoryUpsertBulk

SetSubRound sets the "sub_round" field.

func (*IcoHistoryUpsertBulk) SetType

SetType sets the "type" field.

func (*IcoHistoryUpsertBulk) SetUpdatedAt

func (u *IcoHistoryUpsertBulk) SetUpdatedAt(v time.Time) *IcoHistoryUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*IcoHistoryUpsertBulk) Update

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

func (*IcoHistoryUpsertBulk) UpdateNewValues

func (u *IcoHistoryUpsertBulk) UpdateNewValues() *IcoHistoryUpsertBulk

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

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

func (*IcoHistoryUpsertBulk) UpdateNumToken

func (u *IcoHistoryUpsertBulk) UpdateNumToken() *IcoHistoryUpsertBulk

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

func (*IcoHistoryUpsertBulk) UpdatePrice

func (u *IcoHistoryUpsertBulk) UpdatePrice() *IcoHistoryUpsertBulk

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

func (*IcoHistoryUpsertBulk) UpdateRoundID

func (u *IcoHistoryUpsertBulk) UpdateRoundID() *IcoHistoryUpsertBulk

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

func (*IcoHistoryUpsertBulk) UpdateSubRound

func (u *IcoHistoryUpsertBulk) UpdateSubRound() *IcoHistoryUpsertBulk

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

func (*IcoHistoryUpsertBulk) UpdateType

func (u *IcoHistoryUpsertBulk) UpdateType() *IcoHistoryUpsertBulk

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

func (*IcoHistoryUpsertBulk) UpdateUpdatedAt

func (u *IcoHistoryUpsertBulk) UpdateUpdatedAt() *IcoHistoryUpsertBulk

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

func (*IcoHistoryUpsertBulk) UpdateUserID

func (u *IcoHistoryUpsertBulk) UpdateUserID() *IcoHistoryUpsertBulk

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

type IcoHistoryUpsertOne

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

IcoHistoryUpsertOne is the builder for "upsert"-ing

one IcoHistory node.

func (*IcoHistoryUpsertOne) AddRoundID

func (u *IcoHistoryUpsertOne) AddRoundID(v int32) *IcoHistoryUpsertOne

AddRoundID adds v to the "round_id" field.

func (*IcoHistoryUpsertOne) AddSubRound

func (u *IcoHistoryUpsertOne) AddSubRound(v int32) *IcoHistoryUpsertOne

AddSubRound adds v to the "sub_round" field.

func (*IcoHistoryUpsertOne) ClearType

func (u *IcoHistoryUpsertOne) ClearType() *IcoHistoryUpsertOne

ClearType clears the value of the "type" field.

func (*IcoHistoryUpsertOne) DoNothing

func (u *IcoHistoryUpsertOne) DoNothing() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) Exec

Exec executes the query.

func (*IcoHistoryUpsertOne) ExecX

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

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

func (*IcoHistoryUpsertOne) ID

func (u *IcoHistoryUpsertOne) ID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoHistoryUpsertOne) IDX

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

func (*IcoHistoryUpsertOne) Ignore

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

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

func (*IcoHistoryUpsertOne) SetNumToken

func (u *IcoHistoryUpsertOne) SetNumToken(v string) *IcoHistoryUpsertOne

SetNumToken sets the "num_token" field.

func (*IcoHistoryUpsertOne) SetPrice

SetPrice sets the "price" field.

func (*IcoHistoryUpsertOne) SetRoundID

func (u *IcoHistoryUpsertOne) SetRoundID(v int32) *IcoHistoryUpsertOne

SetRoundID sets the "round_id" field.

func (*IcoHistoryUpsertOne) SetSubRound

func (u *IcoHistoryUpsertOne) SetSubRound(v int32) *IcoHistoryUpsertOne

SetSubRound sets the "sub_round" field.

func (*IcoHistoryUpsertOne) SetType

SetType sets the "type" field.

func (*IcoHistoryUpsertOne) SetUpdatedAt

func (u *IcoHistoryUpsertOne) SetUpdatedAt(v time.Time) *IcoHistoryUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoHistoryUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*IcoHistoryUpsertOne) Update

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

func (*IcoHistoryUpsertOne) UpdateNewValues

func (u *IcoHistoryUpsertOne) UpdateNewValues() *IcoHistoryUpsertOne

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

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

func (*IcoHistoryUpsertOne) UpdateNumToken

func (u *IcoHistoryUpsertOne) UpdateNumToken() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) UpdatePrice

func (u *IcoHistoryUpsertOne) UpdatePrice() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) UpdateRoundID

func (u *IcoHistoryUpsertOne) UpdateRoundID() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) UpdateSubRound

func (u *IcoHistoryUpsertOne) UpdateSubRound() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) UpdateType

func (u *IcoHistoryUpsertOne) UpdateType() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) UpdateUpdatedAt

func (u *IcoHistoryUpsertOne) UpdateUpdatedAt() *IcoHistoryUpsertOne

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

func (*IcoHistoryUpsertOne) UpdateUserID

func (u *IcoHistoryUpsertOne) UpdateUserID() *IcoHistoryUpsertOne

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

type IcoMutation

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

IcoMutation represents an operation that mutates the Ico nodes in the graph.

func (*IcoMutation) AddField

func (m *IcoMutation) 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 (*IcoMutation) AddNumSub

func (m *IcoMutation) AddNumSub(i int32)

AddNumSub adds i to the "num_sub" field.

func (*IcoMutation) AddRoundID

func (m *IcoMutation) AddRoundID(i int32)

AddRoundID adds i to the "round_id" field.

func (*IcoMutation) AddedEdges

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

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

func (*IcoMutation) AddedField

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

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

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

func (*IcoMutation) AddedIDs

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

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

func (*IcoMutation) AddedNumSub

func (m *IcoMutation) AddedNumSub() (r int32, exists bool)

AddedNumSub returns the value that was added to the "num_sub" field in this mutation.

func (*IcoMutation) AddedRoundID

func (m *IcoMutation) AddedRoundID() (r int32, exists bool)

AddedRoundID returns the value that was added to the "round_id" field in this mutation.

func (*IcoMutation) ClearEdge

func (m *IcoMutation) 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 (*IcoMutation) ClearEndedAt

func (m *IcoMutation) ClearEndedAt()

ClearEndedAt clears the value of the "ended_at" field.

func (*IcoMutation) ClearField

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

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

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

func (*IcoMutation) ClearedFields

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

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

func (IcoMutation) Client

func (m IcoMutation) 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 (*IcoMutation) CreatedAt

func (m *IcoMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*IcoMutation) EdgeCleared

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

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

func (*IcoMutation) EndedAt

func (m *IcoMutation) EndedAt() (r time.Time, exists bool)

EndedAt returns the value of the "ended_at" field in the mutation.

func (*IcoMutation) EndedAtCleared

func (m *IcoMutation) EndedAtCleared() bool

EndedAtCleared returns if the "ended_at" field was cleared in this mutation.

func (*IcoMutation) ExecContext

func (c *IcoMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoMutation) Field

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

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

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

func (*IcoMutation) Fields

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

func (m *IcoMutation) ID() (id xid.ID, 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 (*IcoMutation) IDs

func (m *IcoMutation) IDs(ctx context.Context) ([]xid.ID, 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 (*IcoMutation) NumSub

func (m *IcoMutation) NumSub() (r int32, exists bool)

NumSub returns the value of the "num_sub" field in the mutation.

func (*IcoMutation) NumToken

func (m *IcoMutation) NumToken() (r string, exists bool)

NumToken returns the value of the "num_token" field in the mutation.

func (*IcoMutation) OldCreatedAt

func (m *IcoMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldEndedAt

func (m *IcoMutation) OldEndedAt(ctx context.Context) (v *time.Time, err error)

OldEndedAt returns the old "ended_at" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldField

func (m *IcoMutation) 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 (*IcoMutation) OldNumSub

func (m *IcoMutation) OldNumSub(ctx context.Context) (v int32, err error)

OldNumSub returns the old "num_sub" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldNumToken

func (m *IcoMutation) OldNumToken(ctx context.Context) (v string, err error)

OldNumToken returns the old "num_token" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldPrice

func (m *IcoMutation) OldPrice(ctx context.Context) (v string, err error)

OldPrice returns the old "price" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldPriceGap

func (m *IcoMutation) OldPriceGap(ctx context.Context) (v string, err error)

OldPriceGap returns the old "price_gap" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldRoundID

func (m *IcoMutation) OldRoundID(ctx context.Context) (v int32, err error)

OldRoundID returns the old "round_id" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldRoundName

func (m *IcoMutation) OldRoundName(ctx context.Context) (v string, err error)

OldRoundName returns the old "round_name" field's value of the Ico entity. If the Ico 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 (*IcoMutation) OldUpdatedAt

func (m *IcoMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Ico entity. If the Ico 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 (*IcoMutation) Op

func (m *IcoMutation) Op() Op

Op returns the operation name.

func (*IcoMutation) Price

func (m *IcoMutation) Price() (r string, exists bool)

Price returns the value of the "price" field in the mutation.

func (*IcoMutation) PriceGap

func (m *IcoMutation) PriceGap() (r string, exists bool)

PriceGap returns the value of the "price_gap" field in the mutation.

func (*IcoMutation) QueryContext

func (c *IcoMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoMutation) RemovedEdges

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

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

func (*IcoMutation) RemovedIDs

func (m *IcoMutation) 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 (*IcoMutation) ResetCreatedAt

func (m *IcoMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IcoMutation) ResetEdge

func (m *IcoMutation) 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 (*IcoMutation) ResetEndedAt

func (m *IcoMutation) ResetEndedAt()

ResetEndedAt resets all changes to the "ended_at" field.

func (*IcoMutation) ResetField

func (m *IcoMutation) 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 (*IcoMutation) ResetNumSub

func (m *IcoMutation) ResetNumSub()

ResetNumSub resets all changes to the "num_sub" field.

func (*IcoMutation) ResetNumToken

func (m *IcoMutation) ResetNumToken()

ResetNumToken resets all changes to the "num_token" field.

func (*IcoMutation) ResetPrice

func (m *IcoMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*IcoMutation) ResetPriceGap

func (m *IcoMutation) ResetPriceGap()

ResetPriceGap resets all changes to the "price_gap" field.

func (*IcoMutation) ResetRoundID

func (m *IcoMutation) ResetRoundID()

ResetRoundID resets all changes to the "round_id" field.

func (*IcoMutation) ResetRoundName

func (m *IcoMutation) ResetRoundName()

ResetRoundName resets all changes to the "round_name" field.

func (*IcoMutation) ResetUpdatedAt

func (m *IcoMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IcoMutation) RoundID

func (m *IcoMutation) RoundID() (r int32, exists bool)

RoundID returns the value of the "round_id" field in the mutation.

func (*IcoMutation) RoundName

func (m *IcoMutation) RoundName() (r string, exists bool)

RoundName returns the value of the "round_name" field in the mutation.

func (*IcoMutation) SetCreatedAt

func (m *IcoMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*IcoMutation) SetEndedAt

func (m *IcoMutation) SetEndedAt(t time.Time)

SetEndedAt sets the "ended_at" field.

func (*IcoMutation) SetField

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

func (m *IcoMutation) SetID(id xid.ID)

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

func (*IcoMutation) SetNumSub

func (m *IcoMutation) SetNumSub(i int32)

SetNumSub sets the "num_sub" field.

func (*IcoMutation) SetNumToken

func (m *IcoMutation) SetNumToken(s string)

SetNumToken sets the "num_token" field.

func (*IcoMutation) SetOp

func (m *IcoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IcoMutation) SetPrice

func (m *IcoMutation) SetPrice(s string)

SetPrice sets the "price" field.

func (*IcoMutation) SetPriceGap

func (m *IcoMutation) SetPriceGap(s string)

SetPriceGap sets the "price_gap" field.

func (*IcoMutation) SetRoundID

func (m *IcoMutation) SetRoundID(i int32)

SetRoundID sets the "round_id" field.

func (*IcoMutation) SetRoundName

func (m *IcoMutation) SetRoundName(s string)

SetRoundName sets the "round_name" field.

func (*IcoMutation) SetUpdatedAt

func (m *IcoMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (IcoMutation) Tx

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

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

func (*IcoMutation) Type

func (m *IcoMutation) Type() string

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

func (*IcoMutation) UpdatedAt

func (m *IcoMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*IcoMutation) Where

func (m *IcoMutation) Where(ps ...predicate.Ico)

Where appends a list predicates to the IcoMutation builder.

func (*IcoMutation) WhereP

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

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

type IcoQuery

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

IcoQuery is the builder for querying Ico entities.

func (*IcoQuery) Aggregate

func (iq *IcoQuery) Aggregate(fns ...AggregateFunc) *IcoSelect

Aggregate returns a IcoSelect configured with the given aggregations.

func (*IcoQuery) All

func (iq *IcoQuery) All(ctx context.Context) ([]*Ico, error)

All executes the query and returns a list of Icos.

func (*IcoQuery) AllX

func (iq *IcoQuery) AllX(ctx context.Context) []*Ico

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

func (*IcoQuery) Clone

func (iq *IcoQuery) Clone() *IcoQuery

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

func (*IcoQuery) Count

func (iq *IcoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IcoQuery) CountX

func (iq *IcoQuery) CountX(ctx context.Context) int

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

func (*IcoQuery) ExecContext

func (c *IcoQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoQuery) Exist

func (iq *IcoQuery) Exist(ctx context.Context) (bool, error)

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

func (*IcoQuery) ExistX

func (iq *IcoQuery) ExistX(ctx context.Context) bool

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

func (*IcoQuery) First

func (iq *IcoQuery) First(ctx context.Context) (*Ico, error)

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

func (*IcoQuery) FirstID

func (iq *IcoQuery) FirstID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoQuery) FirstIDX

func (iq *IcoQuery) FirstIDX(ctx context.Context) xid.ID

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

func (*IcoQuery) FirstX

func (iq *IcoQuery) FirstX(ctx context.Context) *Ico

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

func (*IcoQuery) GroupBy

func (iq *IcoQuery) GroupBy(field string, fields ...string) *IcoGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Ico.Query().
	GroupBy(ico.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IcoQuery) IDs

func (iq *IcoQuery) IDs(ctx context.Context) (ids []xid.ID, err error)

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

func (*IcoQuery) IDsX

func (iq *IcoQuery) IDsX(ctx context.Context) []xid.ID

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

func (*IcoQuery) Limit

func (iq *IcoQuery) Limit(limit int) *IcoQuery

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

func (*IcoQuery) Modify

func (iq *IcoQuery) Modify(modifiers ...func(s *sql.Selector)) *IcoSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*IcoQuery) Offset

func (iq *IcoQuery) Offset(offset int) *IcoQuery

Offset to start from.

func (*IcoQuery) Only

func (iq *IcoQuery) Only(ctx context.Context) (*Ico, error)

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

func (*IcoQuery) OnlyID

func (iq *IcoQuery) OnlyID(ctx context.Context) (id xid.ID, err error)

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

func (*IcoQuery) OnlyIDX

func (iq *IcoQuery) OnlyIDX(ctx context.Context) xid.ID

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

func (*IcoQuery) OnlyX

func (iq *IcoQuery) OnlyX(ctx context.Context) *Ico

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

func (*IcoQuery) Order

func (iq *IcoQuery) Order(o ...ico.OrderOption) *IcoQuery

Order specifies how the records should be ordered.

func (*IcoQuery) QueryContext

func (c *IcoQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoQuery) Select

func (iq *IcoQuery) Select(fields ...string) *IcoSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Ico.Query().
	Select(ico.FieldCreatedAt).
	Scan(ctx, &v)

func (*IcoQuery) Unique

func (iq *IcoQuery) Unique(unique bool) *IcoQuery

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

func (iq *IcoQuery) Where(ps ...predicate.Ico) *IcoQuery

Where adds a new predicate for the IcoQuery builder.

type IcoRound

type IcoRound struct {

	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// RoundID holds the value of the "round_id" field.
	RoundID int32 `json:"round_id,omitempty"`
	// SubRound holds the value of the "sub_round" field.
	SubRound int32 `json:"sub_round,omitempty"`
	// Price holds the value of the "price" field.
	Price string `json:"price,omitempty"`
	// NumToken holds the value of the "num_token" field.
	NumToken string `json:"num_token,omitempty"`
	// BoughtToken holds the value of the "bought_token" field.
	BoughtToken string `json:"bought_token,omitempty"`
	// StartAt holds the value of the "start_at" field.
	StartAt *time.Time `json:"start_at,omitempty"`
	// EndAt holds the value of the "end_at" field.
	EndAt *time.Time `json:"end_at,omitempty"`
	// IsClose holds the value of the "is_close" field.
	IsClose bool `json:"is_close,omitempty"`
	// contains filtered or unexported fields
}

IcoRound is the model entity for the IcoRound schema.

func (*IcoRound) ExecContext

func (c *IcoRound) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRound) QueryContext

func (c *IcoRound) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRound) String

func (ir *IcoRound) String() string

String implements the fmt.Stringer.

func (*IcoRound) Unwrap

func (ir *IcoRound) Unwrap() *IcoRound

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

func (ir *IcoRound) Update() *IcoRoundUpdateOne

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

func (*IcoRound) Value

func (ir *IcoRound) Value(name string) (ent.Value, error)

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

type IcoRoundClient

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

IcoRoundClient is a client for the IcoRound schema.

func NewIcoRoundClient

func NewIcoRoundClient(c config) *IcoRoundClient

NewIcoRoundClient returns a client for the IcoRound from the given config.

func (*IcoRoundClient) Create

func (c *IcoRoundClient) Create() *IcoRoundCreate

Create returns a builder for creating a IcoRound entity.

func (*IcoRoundClient) CreateBulk

func (c *IcoRoundClient) CreateBulk(builders ...*IcoRoundCreate) *IcoRoundCreateBulk

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

func (*IcoRoundClient) Delete

func (c *IcoRoundClient) Delete() *IcoRoundDelete

Delete returns a delete builder for IcoRound.

func (*IcoRoundClient) DeleteOne

func (c *IcoRoundClient) DeleteOne(ir *IcoRound) *IcoRoundDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IcoRoundClient) DeleteOneID

func (c *IcoRoundClient) DeleteOneID(id xid.ID) *IcoRoundDeleteOne

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

func (*IcoRoundClient) ExecContext

func (c *IcoRoundClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundClient) Get

func (c *IcoRoundClient) Get(ctx context.Context, id xid.ID) (*IcoRound, error)

Get returns a IcoRound entity by its id.

func (*IcoRoundClient) GetX

func (c *IcoRoundClient) GetX(ctx context.Context, id xid.ID) *IcoRound

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

func (*IcoRoundClient) Hooks

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

Hooks returns the client hooks.

func (*IcoRoundClient) Intercept

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

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

func (*IcoRoundClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IcoRoundClient) MapCreateBulk

func (c *IcoRoundClient) MapCreateBulk(slice any, setFunc func(*IcoRoundCreate, int)) *IcoRoundCreateBulk

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

func (c *IcoRoundClient) Query() *IcoRoundQuery

Query returns a query builder for IcoRound.

func (*IcoRoundClient) QueryContext

func (c *IcoRoundClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundClient) Update

func (c *IcoRoundClient) Update() *IcoRoundUpdate

Update returns an update builder for IcoRound.

func (*IcoRoundClient) UpdateOne

func (c *IcoRoundClient) UpdateOne(ir *IcoRound) *IcoRoundUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IcoRoundClient) UpdateOneID

func (c *IcoRoundClient) UpdateOneID(id xid.ID) *IcoRoundUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IcoRoundClient) Use

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

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

type IcoRoundCreate

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

IcoRoundCreate is the builder for creating a IcoRound entity.

func (*IcoRoundCreate) Exec

func (irc *IcoRoundCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoRoundCreate) ExecContext

func (c *IcoRoundCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundCreate) ExecX

func (irc *IcoRoundCreate) ExecX(ctx context.Context)

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

func (*IcoRoundCreate) Mutation

func (irc *IcoRoundCreate) Mutation() *IcoRoundMutation

Mutation returns the IcoRoundMutation object of the builder.

func (*IcoRoundCreate) OnConflict

func (irc *IcoRoundCreate) OnConflict(opts ...sql.ConflictOption) *IcoRoundUpsertOne

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

client.IcoRound.Create().
	SetCreatedAt(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.IcoRoundUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoRoundCreate) OnConflictColumns

func (irc *IcoRoundCreate) OnConflictColumns(columns ...string) *IcoRoundUpsertOne

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

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

func (*IcoRoundCreate) QueryContext

func (c *IcoRoundCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundCreate) Save

func (irc *IcoRoundCreate) Save(ctx context.Context) (*IcoRound, error)

Save creates the IcoRound in the database.

func (*IcoRoundCreate) SaveX

func (irc *IcoRoundCreate) SaveX(ctx context.Context) *IcoRound

SaveX calls Save and panics if Save returns an error.

func (*IcoRoundCreate) SetBoughtToken

func (irc *IcoRoundCreate) SetBoughtToken(s string) *IcoRoundCreate

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundCreate) SetCreatedAt

func (irc *IcoRoundCreate) SetCreatedAt(t time.Time) *IcoRoundCreate

SetCreatedAt sets the "created_at" field.

func (*IcoRoundCreate) SetEndAt

func (irc *IcoRoundCreate) SetEndAt(t time.Time) *IcoRoundCreate

SetEndAt sets the "end_at" field.

func (*IcoRoundCreate) SetID

func (irc *IcoRoundCreate) SetID(x xid.ID) *IcoRoundCreate

SetID sets the "id" field.

func (*IcoRoundCreate) SetIsClose

func (irc *IcoRoundCreate) SetIsClose(b bool) *IcoRoundCreate

SetIsClose sets the "is_close" field.

func (*IcoRoundCreate) SetNillableCreatedAt

func (irc *IcoRoundCreate) SetNillableCreatedAt(t *time.Time) *IcoRoundCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*IcoRoundCreate) SetNillableEndAt

func (irc *IcoRoundCreate) SetNillableEndAt(t *time.Time) *IcoRoundCreate

SetNillableEndAt sets the "end_at" field if the given value is not nil.

func (*IcoRoundCreate) SetNillableID

func (irc *IcoRoundCreate) SetNillableID(x *xid.ID) *IcoRoundCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*IcoRoundCreate) SetNillableIsClose

func (irc *IcoRoundCreate) SetNillableIsClose(b *bool) *IcoRoundCreate

SetNillableIsClose sets the "is_close" field if the given value is not nil.

func (*IcoRoundCreate) SetNillableStartAt

func (irc *IcoRoundCreate) SetNillableStartAt(t *time.Time) *IcoRoundCreate

SetNillableStartAt sets the "start_at" field if the given value is not nil.

func (*IcoRoundCreate) SetNillableUpdatedAt

func (irc *IcoRoundCreate) SetNillableUpdatedAt(t *time.Time) *IcoRoundCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*IcoRoundCreate) SetNumToken

func (irc *IcoRoundCreate) SetNumToken(s string) *IcoRoundCreate

SetNumToken sets the "num_token" field.

func (*IcoRoundCreate) SetPrice

func (irc *IcoRoundCreate) SetPrice(s string) *IcoRoundCreate

SetPrice sets the "price" field.

func (*IcoRoundCreate) SetRoundID

func (irc *IcoRoundCreate) SetRoundID(i int32) *IcoRoundCreate

SetRoundID sets the "round_id" field.

func (*IcoRoundCreate) SetStartAt

func (irc *IcoRoundCreate) SetStartAt(t time.Time) *IcoRoundCreate

SetStartAt sets the "start_at" field.

func (*IcoRoundCreate) SetSubRound

func (irc *IcoRoundCreate) SetSubRound(i int32) *IcoRoundCreate

SetSubRound sets the "sub_round" field.

func (*IcoRoundCreate) SetUpdatedAt

func (irc *IcoRoundCreate) SetUpdatedAt(t time.Time) *IcoRoundCreate

SetUpdatedAt sets the "updated_at" field.

type IcoRoundCreateBulk

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

IcoRoundCreateBulk is the builder for creating many IcoRound entities in bulk.

func (*IcoRoundCreateBulk) Exec

func (ircb *IcoRoundCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoRoundCreateBulk) ExecContext

func (c *IcoRoundCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundCreateBulk) ExecX

func (ircb *IcoRoundCreateBulk) ExecX(ctx context.Context)

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

func (*IcoRoundCreateBulk) OnConflict

func (ircb *IcoRoundCreateBulk) OnConflict(opts ...sql.ConflictOption) *IcoRoundUpsertBulk

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

client.IcoRound.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.IcoRoundUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*IcoRoundCreateBulk) OnConflictColumns

func (ircb *IcoRoundCreateBulk) OnConflictColumns(columns ...string) *IcoRoundUpsertBulk

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

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

func (*IcoRoundCreateBulk) QueryContext

func (c *IcoRoundCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundCreateBulk) Save

func (ircb *IcoRoundCreateBulk) Save(ctx context.Context) ([]*IcoRound, error)

Save creates the IcoRound entities in the database.

func (*IcoRoundCreateBulk) SaveX

func (ircb *IcoRoundCreateBulk) SaveX(ctx context.Context) []*IcoRound

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

type IcoRoundDelete

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

IcoRoundDelete is the builder for deleting a IcoRound entity.

func (*IcoRoundDelete) Exec

func (ird *IcoRoundDelete) Exec(ctx context.Context) (int, error)

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

func (*IcoRoundDelete) ExecContext

func (c *IcoRoundDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundDelete) ExecX

func (ird *IcoRoundDelete) ExecX(ctx context.Context) int

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

func (*IcoRoundDelete) QueryContext

func (c *IcoRoundDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundDelete) Where

func (ird *IcoRoundDelete) Where(ps ...predicate.IcoRound) *IcoRoundDelete

Where appends a list predicates to the IcoRoundDelete builder.

type IcoRoundDeleteOne

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

IcoRoundDeleteOne is the builder for deleting a single IcoRound entity.

func (*IcoRoundDeleteOne) Exec

func (irdo *IcoRoundDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IcoRoundDeleteOne) ExecX

func (irdo *IcoRoundDeleteOne) ExecX(ctx context.Context)

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

func (*IcoRoundDeleteOne) Where

Where appends a list predicates to the IcoRoundDelete builder.

type IcoRoundGroupBy

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

IcoRoundGroupBy is the group-by builder for IcoRound entities.

func (*IcoRoundGroupBy) Aggregate

func (irgb *IcoRoundGroupBy) Aggregate(fns ...AggregateFunc) *IcoRoundGroupBy

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

func (*IcoRoundGroupBy) Bool

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

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

func (*IcoRoundGroupBy) BoolX

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

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

func (*IcoRoundGroupBy) Bools

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

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

func (*IcoRoundGroupBy) BoolsX

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

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

func (*IcoRoundGroupBy) Float64

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

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

func (*IcoRoundGroupBy) Float64X

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

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

func (*IcoRoundGroupBy) Float64s

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

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

func (*IcoRoundGroupBy) Float64sX

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

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

func (*IcoRoundGroupBy) Int

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

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

func (*IcoRoundGroupBy) IntX

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

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

func (*IcoRoundGroupBy) Ints

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

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

func (*IcoRoundGroupBy) IntsX

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

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

func (*IcoRoundGroupBy) Scan

func (irgb *IcoRoundGroupBy) Scan(ctx context.Context, v any) error

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

func (*IcoRoundGroupBy) ScanX

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

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

func (*IcoRoundGroupBy) String

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

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

func (*IcoRoundGroupBy) StringX

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

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

func (*IcoRoundGroupBy) Strings

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

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

func (*IcoRoundGroupBy) StringsX

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

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

type IcoRoundMutation

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

IcoRoundMutation represents an operation that mutates the IcoRound nodes in the graph.

func (*IcoRoundMutation) AddField

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) AddRoundID

func (m *IcoRoundMutation) AddRoundID(i int32)

AddRoundID adds i to the "round_id" field.

func (*IcoRoundMutation) AddSubRound

func (m *IcoRoundMutation) AddSubRound(i int32)

AddSubRound adds i to the "sub_round" field.

func (*IcoRoundMutation) AddedEdges

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

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

func (*IcoRoundMutation) AddedField

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

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

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

func (*IcoRoundMutation) AddedIDs

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

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

func (*IcoRoundMutation) AddedRoundID

func (m *IcoRoundMutation) AddedRoundID() (r int32, exists bool)

AddedRoundID returns the value that was added to the "round_id" field in this mutation.

func (*IcoRoundMutation) AddedSubRound

func (m *IcoRoundMutation) AddedSubRound() (r int32, exists bool)

AddedSubRound returns the value that was added to the "sub_round" field in this mutation.

func (*IcoRoundMutation) BoughtToken

func (m *IcoRoundMutation) BoughtToken() (r string, exists bool)

BoughtToken returns the value of the "bought_token" field in the mutation.

func (*IcoRoundMutation) ClearEdge

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) ClearEndAt

func (m *IcoRoundMutation) ClearEndAt()

ClearEndAt clears the value of the "end_at" field.

func (*IcoRoundMutation) ClearField

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) ClearStartAt

func (m *IcoRoundMutation) ClearStartAt()

ClearStartAt clears the value of the "start_at" field.

func (*IcoRoundMutation) ClearedEdges

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

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

func (*IcoRoundMutation) ClearedFields

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

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

func (IcoRoundMutation) Client

func (m IcoRoundMutation) 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 (*IcoRoundMutation) CreatedAt

func (m *IcoRoundMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*IcoRoundMutation) EdgeCleared

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

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

func (*IcoRoundMutation) EndAt

func (m *IcoRoundMutation) EndAt() (r time.Time, exists bool)

EndAt returns the value of the "end_at" field in the mutation.

func (*IcoRoundMutation) EndAtCleared

func (m *IcoRoundMutation) EndAtCleared() bool

EndAtCleared returns if the "end_at" field was cleared in this mutation.

func (*IcoRoundMutation) ExecContext

func (c *IcoRoundMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundMutation) Field

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

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

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

func (*IcoRoundMutation) Fields

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

func (m *IcoRoundMutation) ID() (id xid.ID, 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 (*IcoRoundMutation) IDs

func (m *IcoRoundMutation) IDs(ctx context.Context) ([]xid.ID, 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 (*IcoRoundMutation) IsClose

func (m *IcoRoundMutation) IsClose() (r bool, exists bool)

IsClose returns the value of the "is_close" field in the mutation.

func (*IcoRoundMutation) NumToken

func (m *IcoRoundMutation) NumToken() (r string, exists bool)

NumToken returns the value of the "num_token" field in the mutation.

func (*IcoRoundMutation) OldBoughtToken

func (m *IcoRoundMutation) OldBoughtToken(ctx context.Context) (v string, err error)

OldBoughtToken returns the old "bought_token" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldCreatedAt

func (m *IcoRoundMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldEndAt

func (m *IcoRoundMutation) OldEndAt(ctx context.Context) (v *time.Time, err error)

OldEndAt returns the old "end_at" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldField

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) OldIsClose

func (m *IcoRoundMutation) OldIsClose(ctx context.Context) (v bool, err error)

OldIsClose returns the old "is_close" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldNumToken

func (m *IcoRoundMutation) OldNumToken(ctx context.Context) (v string, err error)

OldNumToken returns the old "num_token" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldPrice

func (m *IcoRoundMutation) OldPrice(ctx context.Context) (v string, err error)

OldPrice returns the old "price" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldRoundID

func (m *IcoRoundMutation) OldRoundID(ctx context.Context) (v int32, err error)

OldRoundID returns the old "round_id" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldStartAt

func (m *IcoRoundMutation) OldStartAt(ctx context.Context) (v *time.Time, err error)

OldStartAt returns the old "start_at" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldSubRound

func (m *IcoRoundMutation) OldSubRound(ctx context.Context) (v int32, err error)

OldSubRound returns the old "sub_round" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) OldUpdatedAt

func (m *IcoRoundMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the IcoRound entity. If the IcoRound 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 (*IcoRoundMutation) Op

func (m *IcoRoundMutation) Op() Op

Op returns the operation name.

func (*IcoRoundMutation) Price

func (m *IcoRoundMutation) Price() (r string, exists bool)

Price returns the value of the "price" field in the mutation.

func (*IcoRoundMutation) QueryContext

func (c *IcoRoundMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundMutation) RemovedEdges

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

RemovedEdges returns all edge names that were removed in this mutation.

func (*IcoRoundMutation) RemovedIDs

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) ResetBoughtToken

func (m *IcoRoundMutation) ResetBoughtToken()

ResetBoughtToken resets all changes to the "bought_token" field.

func (*IcoRoundMutation) ResetCreatedAt

func (m *IcoRoundMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IcoRoundMutation) ResetEdge

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) ResetEndAt

func (m *IcoRoundMutation) ResetEndAt()

ResetEndAt resets all changes to the "end_at" field.

func (*IcoRoundMutation) ResetField

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) ResetIsClose

func (m *IcoRoundMutation) ResetIsClose()

ResetIsClose resets all changes to the "is_close" field.

func (*IcoRoundMutation) ResetNumToken

func (m *IcoRoundMutation) ResetNumToken()

ResetNumToken resets all changes to the "num_token" field.

func (*IcoRoundMutation) ResetPrice

func (m *IcoRoundMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*IcoRoundMutation) ResetRoundID

func (m *IcoRoundMutation) ResetRoundID()

ResetRoundID resets all changes to the "round_id" field.

func (*IcoRoundMutation) ResetStartAt

func (m *IcoRoundMutation) ResetStartAt()

ResetStartAt resets all changes to the "start_at" field.

func (*IcoRoundMutation) ResetSubRound

func (m *IcoRoundMutation) ResetSubRound()

ResetSubRound resets all changes to the "sub_round" field.

func (*IcoRoundMutation) ResetUpdatedAt

func (m *IcoRoundMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IcoRoundMutation) RoundID

func (m *IcoRoundMutation) RoundID() (r int32, exists bool)

RoundID returns the value of the "round_id" field in the mutation.

func (*IcoRoundMutation) SetBoughtToken

func (m *IcoRoundMutation) SetBoughtToken(s string)

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundMutation) SetCreatedAt

func (m *IcoRoundMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*IcoRoundMutation) SetEndAt

func (m *IcoRoundMutation) SetEndAt(t time.Time)

SetEndAt sets the "end_at" field.

func (*IcoRoundMutation) SetField

func (m *IcoRoundMutation) 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 (*IcoRoundMutation) SetID

func (m *IcoRoundMutation) SetID(id xid.ID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of IcoRound entities.

func (*IcoRoundMutation) SetIsClose

func (m *IcoRoundMutation) SetIsClose(b bool)

SetIsClose sets the "is_close" field.

func (*IcoRoundMutation) SetNumToken

func (m *IcoRoundMutation) SetNumToken(s string)

SetNumToken sets the "num_token" field.

func (*IcoRoundMutation) SetOp

func (m *IcoRoundMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IcoRoundMutation) SetPrice

func (m *IcoRoundMutation) SetPrice(s string)

SetPrice sets the "price" field.

func (*IcoRoundMutation) SetRoundID

func (m *IcoRoundMutation) SetRoundID(i int32)

SetRoundID sets the "round_id" field.

func (*IcoRoundMutation) SetStartAt

func (m *IcoRoundMutation) SetStartAt(t time.Time)

SetStartAt sets the "start_at" field.

func (*IcoRoundMutation) SetSubRound

func (m *IcoRoundMutation) SetSubRound(i int32)

SetSubRound sets the "sub_round" field.

func (*IcoRoundMutation) SetUpdatedAt

func (m *IcoRoundMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*IcoRoundMutation) StartAt

func (m *IcoRoundMutation) StartAt() (r time.Time, exists bool)

StartAt returns the value of the "start_at" field in the mutation.

func (*IcoRoundMutation) StartAtCleared

func (m *IcoRoundMutation) StartAtCleared() bool

StartAtCleared returns if the "start_at" field was cleared in this mutation.

func (*IcoRoundMutation) SubRound

func (m *IcoRoundMutation) SubRound() (r int32, exists bool)

SubRound returns the value of the "sub_round" field in the mutation.

func (IcoRoundMutation) Tx

func (m IcoRoundMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*IcoRoundMutation) Type

func (m *IcoRoundMutation) Type() string

Type returns the node type of this mutation (IcoRound).

func (*IcoRoundMutation) UpdatedAt

func (m *IcoRoundMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*IcoRoundMutation) Where

func (m *IcoRoundMutation) Where(ps ...predicate.IcoRound)

Where appends a list predicates to the IcoRoundMutation builder.

func (*IcoRoundMutation) WhereP

func (m *IcoRoundMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IcoRoundMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IcoRoundQuery

type IcoRoundQuery struct {
	// contains filtered or unexported fields
}

IcoRoundQuery is the builder for querying IcoRound entities.

func (*IcoRoundQuery) Aggregate

func (irq *IcoRoundQuery) Aggregate(fns ...AggregateFunc) *IcoRoundSelect

Aggregate returns a IcoRoundSelect configured with the given aggregations.

func (*IcoRoundQuery) All

func (irq *IcoRoundQuery) All(ctx context.Context) ([]*IcoRound, error)

All executes the query and returns a list of IcoRounds.

func (*IcoRoundQuery) AllX

func (irq *IcoRoundQuery) AllX(ctx context.Context) []*IcoRound

AllX is like All, but panics if an error occurs.

func (*IcoRoundQuery) Clone

func (irq *IcoRoundQuery) Clone() *IcoRoundQuery

Clone returns a duplicate of the IcoRoundQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*IcoRoundQuery) Count

func (irq *IcoRoundQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IcoRoundQuery) CountX

func (irq *IcoRoundQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*IcoRoundQuery) ExecContext

func (c *IcoRoundQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundQuery) Exist

func (irq *IcoRoundQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*IcoRoundQuery) ExistX

func (irq *IcoRoundQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*IcoRoundQuery) First

func (irq *IcoRoundQuery) First(ctx context.Context) (*IcoRound, error)

First returns the first IcoRound entity from the query. Returns a *NotFoundError when no IcoRound was found.

func (*IcoRoundQuery) FirstID

func (irq *IcoRoundQuery) FirstID(ctx context.Context) (id xid.ID, err error)

FirstID returns the first IcoRound ID from the query. Returns a *NotFoundError when no IcoRound ID was found.

func (*IcoRoundQuery) FirstIDX

func (irq *IcoRoundQuery) FirstIDX(ctx context.Context) xid.ID

FirstIDX is like FirstID, but panics if an error occurs.

func (*IcoRoundQuery) FirstX

func (irq *IcoRoundQuery) FirstX(ctx context.Context) *IcoRound

FirstX is like First, but panics if an error occurs.

func (*IcoRoundQuery) GroupBy

func (irq *IcoRoundQuery) GroupBy(field string, fields ...string) *IcoRoundGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IcoRound.Query().
	GroupBy(icoround.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IcoRoundQuery) IDs

func (irq *IcoRoundQuery) IDs(ctx context.Context) (ids []xid.ID, err error)

IDs executes the query and returns a list of IcoRound IDs.

func (*IcoRoundQuery) IDsX

func (irq *IcoRoundQuery) IDsX(ctx context.Context) []xid.ID

IDsX is like IDs, but panics if an error occurs.

func (*IcoRoundQuery) Limit

func (irq *IcoRoundQuery) Limit(limit int) *IcoRoundQuery

Limit the number of records to be returned by this query.

func (*IcoRoundQuery) Modify

func (irq *IcoRoundQuery) Modify(modifiers ...func(s *sql.Selector)) *IcoRoundSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*IcoRoundQuery) Offset

func (irq *IcoRoundQuery) Offset(offset int) *IcoRoundQuery

Offset to start from.

func (*IcoRoundQuery) Only

func (irq *IcoRoundQuery) Only(ctx context.Context) (*IcoRound, error)

Only returns a single IcoRound entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one IcoRound entity is found. Returns a *NotFoundError when no IcoRound entities are found.

func (*IcoRoundQuery) OnlyID

func (irq *IcoRoundQuery) OnlyID(ctx context.Context) (id xid.ID, err error)

OnlyID is like Only, but returns the only IcoRound ID in the query. Returns a *NotSingularError when more than one IcoRound ID is found. Returns a *NotFoundError when no entities are found.

func (*IcoRoundQuery) OnlyIDX

func (irq *IcoRoundQuery) OnlyIDX(ctx context.Context) xid.ID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*IcoRoundQuery) OnlyX

func (irq *IcoRoundQuery) OnlyX(ctx context.Context) *IcoRound

OnlyX is like Only, but panics if an error occurs.

func (*IcoRoundQuery) Order

func (irq *IcoRoundQuery) Order(o ...icoround.OrderOption) *IcoRoundQuery

Order specifies how the records should be ordered.

func (*IcoRoundQuery) QueryContext

func (c *IcoRoundQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundQuery) Select

func (irq *IcoRoundQuery) Select(fields ...string) *IcoRoundSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.IcoRound.Query().
	Select(icoround.FieldCreatedAt).
	Scan(ctx, &v)

func (*IcoRoundQuery) Unique

func (irq *IcoRoundQuery) Unique(unique bool) *IcoRoundQuery

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 (*IcoRoundQuery) Where

func (irq *IcoRoundQuery) Where(ps ...predicate.IcoRound) *IcoRoundQuery

Where adds a new predicate for the IcoRoundQuery builder.

type IcoRoundSelect

type IcoRoundSelect struct {
	*IcoRoundQuery
	// contains filtered or unexported fields
}

IcoRoundSelect is the builder for selecting fields of IcoRound entities.

func (*IcoRoundSelect) Aggregate

func (irs *IcoRoundSelect) Aggregate(fns ...AggregateFunc) *IcoRoundSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IcoRoundSelect) Bool

func (s *IcoRoundSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) BoolX

func (s *IcoRoundSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IcoRoundSelect) Bools

func (s *IcoRoundSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) BoolsX

func (s *IcoRoundSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (IcoRoundSelect) ExecContext

func (c IcoRoundSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundSelect) Float64

func (s *IcoRoundSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) Float64X

func (s *IcoRoundSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IcoRoundSelect) Float64s

func (s *IcoRoundSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) Float64sX

func (s *IcoRoundSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IcoRoundSelect) Int

func (s *IcoRoundSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) IntX

func (s *IcoRoundSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IcoRoundSelect) Ints

func (s *IcoRoundSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) IntsX

func (s *IcoRoundSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IcoRoundSelect) Modify

func (irs *IcoRoundSelect) Modify(modifiers ...func(s *sql.Selector)) *IcoRoundSelect

Modify adds a query modifier for attaching custom logic to queries.

func (IcoRoundSelect) QueryContext

func (c IcoRoundSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundSelect) Scan

func (irs *IcoRoundSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IcoRoundSelect) ScanX

func (s *IcoRoundSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IcoRoundSelect) String

func (s *IcoRoundSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) StringX

func (s *IcoRoundSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IcoRoundSelect) Strings

func (s *IcoRoundSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IcoRoundSelect) StringsX

func (s *IcoRoundSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IcoRoundUpdate

type IcoRoundUpdate struct {
	// contains filtered or unexported fields
}

IcoRoundUpdate is the builder for updating IcoRound entities.

func (*IcoRoundUpdate) AddRoundID

func (iru *IcoRoundUpdate) AddRoundID(i int32) *IcoRoundUpdate

AddRoundID adds i to the "round_id" field.

func (*IcoRoundUpdate) AddSubRound

func (iru *IcoRoundUpdate) AddSubRound(i int32) *IcoRoundUpdate

AddSubRound adds i to the "sub_round" field.

func (*IcoRoundUpdate) ClearEndAt

func (iru *IcoRoundUpdate) ClearEndAt() *IcoRoundUpdate

ClearEndAt clears the value of the "end_at" field.

func (*IcoRoundUpdate) ClearStartAt

func (iru *IcoRoundUpdate) ClearStartAt() *IcoRoundUpdate

ClearStartAt clears the value of the "start_at" field.

func (*IcoRoundUpdate) Exec

func (iru *IcoRoundUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoRoundUpdate) ExecContext

func (c *IcoRoundUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundUpdate) ExecX

func (iru *IcoRoundUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoRoundUpdate) Modify

func (iru *IcoRoundUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoRoundUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoRoundUpdate) Mutation

func (iru *IcoRoundUpdate) Mutation() *IcoRoundMutation

Mutation returns the IcoRoundMutation object of the builder.

func (*IcoRoundUpdate) QueryContext

func (c *IcoRoundUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundUpdate) Save

func (iru *IcoRoundUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IcoRoundUpdate) SaveX

func (iru *IcoRoundUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IcoRoundUpdate) SetBoughtToken

func (iru *IcoRoundUpdate) SetBoughtToken(s string) *IcoRoundUpdate

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundUpdate) SetEndAt

func (iru *IcoRoundUpdate) SetEndAt(t time.Time) *IcoRoundUpdate

SetEndAt sets the "end_at" field.

func (*IcoRoundUpdate) SetIsClose

func (iru *IcoRoundUpdate) SetIsClose(b bool) *IcoRoundUpdate

SetIsClose sets the "is_close" field.

func (*IcoRoundUpdate) SetNillableBoughtToken

func (iru *IcoRoundUpdate) SetNillableBoughtToken(s *string) *IcoRoundUpdate

SetNillableBoughtToken sets the "bought_token" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillableEndAt

func (iru *IcoRoundUpdate) SetNillableEndAt(t *time.Time) *IcoRoundUpdate

SetNillableEndAt sets the "end_at" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillableIsClose

func (iru *IcoRoundUpdate) SetNillableIsClose(b *bool) *IcoRoundUpdate

SetNillableIsClose sets the "is_close" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillableNumToken

func (iru *IcoRoundUpdate) SetNillableNumToken(s *string) *IcoRoundUpdate

SetNillableNumToken sets the "num_token" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillablePrice

func (iru *IcoRoundUpdate) SetNillablePrice(s *string) *IcoRoundUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillableRoundID

func (iru *IcoRoundUpdate) SetNillableRoundID(i *int32) *IcoRoundUpdate

SetNillableRoundID sets the "round_id" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillableStartAt

func (iru *IcoRoundUpdate) SetNillableStartAt(t *time.Time) *IcoRoundUpdate

SetNillableStartAt sets the "start_at" field if the given value is not nil.

func (*IcoRoundUpdate) SetNillableSubRound

func (iru *IcoRoundUpdate) SetNillableSubRound(i *int32) *IcoRoundUpdate

SetNillableSubRound sets the "sub_round" field if the given value is not nil.

func (*IcoRoundUpdate) SetNumToken

func (iru *IcoRoundUpdate) SetNumToken(s string) *IcoRoundUpdate

SetNumToken sets the "num_token" field.

func (*IcoRoundUpdate) SetPrice

func (iru *IcoRoundUpdate) SetPrice(s string) *IcoRoundUpdate

SetPrice sets the "price" field.

func (*IcoRoundUpdate) SetRoundID

func (iru *IcoRoundUpdate) SetRoundID(i int32) *IcoRoundUpdate

SetRoundID sets the "round_id" field.

func (*IcoRoundUpdate) SetStartAt

func (iru *IcoRoundUpdate) SetStartAt(t time.Time) *IcoRoundUpdate

SetStartAt sets the "start_at" field.

func (*IcoRoundUpdate) SetSubRound

func (iru *IcoRoundUpdate) SetSubRound(i int32) *IcoRoundUpdate

SetSubRound sets the "sub_round" field.

func (*IcoRoundUpdate) SetUpdatedAt

func (iru *IcoRoundUpdate) SetUpdatedAt(t time.Time) *IcoRoundUpdate

SetUpdatedAt sets the "updated_at" field.

func (*IcoRoundUpdate) Where

func (iru *IcoRoundUpdate) Where(ps ...predicate.IcoRound) *IcoRoundUpdate

Where appends a list predicates to the IcoRoundUpdate builder.

type IcoRoundUpdateOne

type IcoRoundUpdateOne struct {
	// contains filtered or unexported fields
}

IcoRoundUpdateOne is the builder for updating a single IcoRound entity.

func (*IcoRoundUpdateOne) AddRoundID

func (iruo *IcoRoundUpdateOne) AddRoundID(i int32) *IcoRoundUpdateOne

AddRoundID adds i to the "round_id" field.

func (*IcoRoundUpdateOne) AddSubRound

func (iruo *IcoRoundUpdateOne) AddSubRound(i int32) *IcoRoundUpdateOne

AddSubRound adds i to the "sub_round" field.

func (*IcoRoundUpdateOne) ClearEndAt

func (iruo *IcoRoundUpdateOne) ClearEndAt() *IcoRoundUpdateOne

ClearEndAt clears the value of the "end_at" field.

func (*IcoRoundUpdateOne) ClearStartAt

func (iruo *IcoRoundUpdateOne) ClearStartAt() *IcoRoundUpdateOne

ClearStartAt clears the value of the "start_at" field.

func (*IcoRoundUpdateOne) Exec

func (iruo *IcoRoundUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IcoRoundUpdateOne) ExecContext

func (c *IcoRoundUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoRoundUpdateOne) ExecX

func (iruo *IcoRoundUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoRoundUpdateOne) Modify

func (iruo *IcoRoundUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoRoundUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoRoundUpdateOne) Mutation

func (iruo *IcoRoundUpdateOne) Mutation() *IcoRoundMutation

Mutation returns the IcoRoundMutation object of the builder.

func (*IcoRoundUpdateOne) QueryContext

func (c *IcoRoundUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoRoundUpdateOne) Save

func (iruo *IcoRoundUpdateOne) Save(ctx context.Context) (*IcoRound, error)

Save executes the query and returns the updated IcoRound entity.

func (*IcoRoundUpdateOne) SaveX

func (iruo *IcoRoundUpdateOne) SaveX(ctx context.Context) *IcoRound

SaveX is like Save, but panics if an error occurs.

func (*IcoRoundUpdateOne) Select

func (iruo *IcoRoundUpdateOne) Select(field string, fields ...string) *IcoRoundUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IcoRoundUpdateOne) SetBoughtToken

func (iruo *IcoRoundUpdateOne) SetBoughtToken(s string) *IcoRoundUpdateOne

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundUpdateOne) SetEndAt

func (iruo *IcoRoundUpdateOne) SetEndAt(t time.Time) *IcoRoundUpdateOne

SetEndAt sets the "end_at" field.

func (*IcoRoundUpdateOne) SetIsClose

func (iruo *IcoRoundUpdateOne) SetIsClose(b bool) *IcoRoundUpdateOne

SetIsClose sets the "is_close" field.

func (*IcoRoundUpdateOne) SetNillableBoughtToken

func (iruo *IcoRoundUpdateOne) SetNillableBoughtToken(s *string) *IcoRoundUpdateOne

SetNillableBoughtToken sets the "bought_token" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillableEndAt

func (iruo *IcoRoundUpdateOne) SetNillableEndAt(t *time.Time) *IcoRoundUpdateOne

SetNillableEndAt sets the "end_at" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillableIsClose

func (iruo *IcoRoundUpdateOne) SetNillableIsClose(b *bool) *IcoRoundUpdateOne

SetNillableIsClose sets the "is_close" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillableNumToken

func (iruo *IcoRoundUpdateOne) SetNillableNumToken(s *string) *IcoRoundUpdateOne

SetNillableNumToken sets the "num_token" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillablePrice

func (iruo *IcoRoundUpdateOne) SetNillablePrice(s *string) *IcoRoundUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillableRoundID

func (iruo *IcoRoundUpdateOne) SetNillableRoundID(i *int32) *IcoRoundUpdateOne

SetNillableRoundID sets the "round_id" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillableStartAt

func (iruo *IcoRoundUpdateOne) SetNillableStartAt(t *time.Time) *IcoRoundUpdateOne

SetNillableStartAt sets the "start_at" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNillableSubRound

func (iruo *IcoRoundUpdateOne) SetNillableSubRound(i *int32) *IcoRoundUpdateOne

SetNillableSubRound sets the "sub_round" field if the given value is not nil.

func (*IcoRoundUpdateOne) SetNumToken

func (iruo *IcoRoundUpdateOne) SetNumToken(s string) *IcoRoundUpdateOne

SetNumToken sets the "num_token" field.

func (*IcoRoundUpdateOne) SetPrice

func (iruo *IcoRoundUpdateOne) SetPrice(s string) *IcoRoundUpdateOne

SetPrice sets the "price" field.

func (*IcoRoundUpdateOne) SetRoundID

func (iruo *IcoRoundUpdateOne) SetRoundID(i int32) *IcoRoundUpdateOne

SetRoundID sets the "round_id" field.

func (*IcoRoundUpdateOne) SetStartAt

func (iruo *IcoRoundUpdateOne) SetStartAt(t time.Time) *IcoRoundUpdateOne

SetStartAt sets the "start_at" field.

func (*IcoRoundUpdateOne) SetSubRound

func (iruo *IcoRoundUpdateOne) SetSubRound(i int32) *IcoRoundUpdateOne

SetSubRound sets the "sub_round" field.

func (*IcoRoundUpdateOne) SetUpdatedAt

func (iruo *IcoRoundUpdateOne) SetUpdatedAt(t time.Time) *IcoRoundUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoRoundUpdateOne) Where

Where appends a list predicates to the IcoRoundUpdate builder.

type IcoRoundUpsert

type IcoRoundUpsert struct {
	*sql.UpdateSet
}

IcoRoundUpsert is the "OnConflict" setter.

func (*IcoRoundUpsert) AddRoundID

func (u *IcoRoundUpsert) AddRoundID(v int32) *IcoRoundUpsert

AddRoundID adds v to the "round_id" field.

func (*IcoRoundUpsert) AddSubRound

func (u *IcoRoundUpsert) AddSubRound(v int32) *IcoRoundUpsert

AddSubRound adds v to the "sub_round" field.

func (*IcoRoundUpsert) ClearEndAt

func (u *IcoRoundUpsert) ClearEndAt() *IcoRoundUpsert

ClearEndAt clears the value of the "end_at" field.

func (*IcoRoundUpsert) ClearStartAt

func (u *IcoRoundUpsert) ClearStartAt() *IcoRoundUpsert

ClearStartAt clears the value of the "start_at" field.

func (*IcoRoundUpsert) SetBoughtToken

func (u *IcoRoundUpsert) SetBoughtToken(v string) *IcoRoundUpsert

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundUpsert) SetEndAt

func (u *IcoRoundUpsert) SetEndAt(v time.Time) *IcoRoundUpsert

SetEndAt sets the "end_at" field.

func (*IcoRoundUpsert) SetIsClose

func (u *IcoRoundUpsert) SetIsClose(v bool) *IcoRoundUpsert

SetIsClose sets the "is_close" field.

func (*IcoRoundUpsert) SetNumToken

func (u *IcoRoundUpsert) SetNumToken(v string) *IcoRoundUpsert

SetNumToken sets the "num_token" field.

func (*IcoRoundUpsert) SetPrice

func (u *IcoRoundUpsert) SetPrice(v string) *IcoRoundUpsert

SetPrice sets the "price" field.

func (*IcoRoundUpsert) SetRoundID

func (u *IcoRoundUpsert) SetRoundID(v int32) *IcoRoundUpsert

SetRoundID sets the "round_id" field.

func (*IcoRoundUpsert) SetStartAt

func (u *IcoRoundUpsert) SetStartAt(v time.Time) *IcoRoundUpsert

SetStartAt sets the "start_at" field.

func (*IcoRoundUpsert) SetSubRound

func (u *IcoRoundUpsert) SetSubRound(v int32) *IcoRoundUpsert

SetSubRound sets the "sub_round" field.

func (*IcoRoundUpsert) SetUpdatedAt

func (u *IcoRoundUpsert) SetUpdatedAt(v time.Time) *IcoRoundUpsert

SetUpdatedAt sets the "updated_at" field.

func (*IcoRoundUpsert) UpdateBoughtToken

func (u *IcoRoundUpsert) UpdateBoughtToken() *IcoRoundUpsert

UpdateBoughtToken sets the "bought_token" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateEndAt

func (u *IcoRoundUpsert) UpdateEndAt() *IcoRoundUpsert

UpdateEndAt sets the "end_at" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateIsClose

func (u *IcoRoundUpsert) UpdateIsClose() *IcoRoundUpsert

UpdateIsClose sets the "is_close" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateNumToken

func (u *IcoRoundUpsert) UpdateNumToken() *IcoRoundUpsert

UpdateNumToken sets the "num_token" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdatePrice

func (u *IcoRoundUpsert) UpdatePrice() *IcoRoundUpsert

UpdatePrice sets the "price" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateRoundID

func (u *IcoRoundUpsert) UpdateRoundID() *IcoRoundUpsert

UpdateRoundID sets the "round_id" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateStartAt

func (u *IcoRoundUpsert) UpdateStartAt() *IcoRoundUpsert

UpdateStartAt sets the "start_at" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateSubRound

func (u *IcoRoundUpsert) UpdateSubRound() *IcoRoundUpsert

UpdateSubRound sets the "sub_round" field to the value that was provided on create.

func (*IcoRoundUpsert) UpdateUpdatedAt

func (u *IcoRoundUpsert) UpdateUpdatedAt() *IcoRoundUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type IcoRoundUpsertBulk

type IcoRoundUpsertBulk struct {
	// contains filtered or unexported fields
}

IcoRoundUpsertBulk is the builder for "upsert"-ing a bulk of IcoRound nodes.

func (*IcoRoundUpsertBulk) AddRoundID

func (u *IcoRoundUpsertBulk) AddRoundID(v int32) *IcoRoundUpsertBulk

AddRoundID adds v to the "round_id" field.

func (*IcoRoundUpsertBulk) AddSubRound

func (u *IcoRoundUpsertBulk) AddSubRound(v int32) *IcoRoundUpsertBulk

AddSubRound adds v to the "sub_round" field.

func (*IcoRoundUpsertBulk) ClearEndAt

func (u *IcoRoundUpsertBulk) ClearEndAt() *IcoRoundUpsertBulk

ClearEndAt clears the value of the "end_at" field.

func (*IcoRoundUpsertBulk) ClearStartAt

func (u *IcoRoundUpsertBulk) ClearStartAt() *IcoRoundUpsertBulk

ClearStartAt clears the value of the "start_at" field.

func (*IcoRoundUpsertBulk) DoNothing

func (u *IcoRoundUpsertBulk) DoNothing() *IcoRoundUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IcoRoundUpsertBulk) Exec

func (u *IcoRoundUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoRoundUpsertBulk) ExecX

func (u *IcoRoundUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoRoundUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.IcoRound.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*IcoRoundUpsertBulk) SetBoughtToken

func (u *IcoRoundUpsertBulk) SetBoughtToken(v string) *IcoRoundUpsertBulk

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundUpsertBulk) SetEndAt

SetEndAt sets the "end_at" field.

func (*IcoRoundUpsertBulk) SetIsClose

func (u *IcoRoundUpsertBulk) SetIsClose(v bool) *IcoRoundUpsertBulk

SetIsClose sets the "is_close" field.

func (*IcoRoundUpsertBulk) SetNumToken

func (u *IcoRoundUpsertBulk) SetNumToken(v string) *IcoRoundUpsertBulk

SetNumToken sets the "num_token" field.

func (*IcoRoundUpsertBulk) SetPrice

SetPrice sets the "price" field.

func (*IcoRoundUpsertBulk) SetRoundID

func (u *IcoRoundUpsertBulk) SetRoundID(v int32) *IcoRoundUpsertBulk

SetRoundID sets the "round_id" field.

func (*IcoRoundUpsertBulk) SetStartAt

func (u *IcoRoundUpsertBulk) SetStartAt(v time.Time) *IcoRoundUpsertBulk

SetStartAt sets the "start_at" field.

func (*IcoRoundUpsertBulk) SetSubRound

func (u *IcoRoundUpsertBulk) SetSubRound(v int32) *IcoRoundUpsertBulk

SetSubRound sets the "sub_round" field.

func (*IcoRoundUpsertBulk) SetUpdatedAt

func (u *IcoRoundUpsertBulk) SetUpdatedAt(v time.Time) *IcoRoundUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*IcoRoundUpsertBulk) Update

func (u *IcoRoundUpsertBulk) Update(set func(*IcoRoundUpsert)) *IcoRoundUpsertBulk

Update allows overriding fields `UPDATE` values. See the IcoRoundCreateBulk.OnConflict documentation for more info.

func (*IcoRoundUpsertBulk) UpdateBoughtToken

func (u *IcoRoundUpsertBulk) UpdateBoughtToken() *IcoRoundUpsertBulk

UpdateBoughtToken sets the "bought_token" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateEndAt

func (u *IcoRoundUpsertBulk) UpdateEndAt() *IcoRoundUpsertBulk

UpdateEndAt sets the "end_at" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateIsClose

func (u *IcoRoundUpsertBulk) UpdateIsClose() *IcoRoundUpsertBulk

UpdateIsClose sets the "is_close" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateNewValues

func (u *IcoRoundUpsertBulk) UpdateNewValues() *IcoRoundUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.IcoRound.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(icoround.FieldID)
		}),
	).
	Exec(ctx)

func (*IcoRoundUpsertBulk) UpdateNumToken

func (u *IcoRoundUpsertBulk) UpdateNumToken() *IcoRoundUpsertBulk

UpdateNumToken sets the "num_token" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdatePrice

func (u *IcoRoundUpsertBulk) UpdatePrice() *IcoRoundUpsertBulk

UpdatePrice sets the "price" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateRoundID

func (u *IcoRoundUpsertBulk) UpdateRoundID() *IcoRoundUpsertBulk

UpdateRoundID sets the "round_id" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateStartAt

func (u *IcoRoundUpsertBulk) UpdateStartAt() *IcoRoundUpsertBulk

UpdateStartAt sets the "start_at" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateSubRound

func (u *IcoRoundUpsertBulk) UpdateSubRound() *IcoRoundUpsertBulk

UpdateSubRound sets the "sub_round" field to the value that was provided on create.

func (*IcoRoundUpsertBulk) UpdateUpdatedAt

func (u *IcoRoundUpsertBulk) UpdateUpdatedAt() *IcoRoundUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type IcoRoundUpsertOne

type IcoRoundUpsertOne struct {
	// contains filtered or unexported fields
}

IcoRoundUpsertOne is the builder for "upsert"-ing

one IcoRound node.

func (*IcoRoundUpsertOne) AddRoundID

func (u *IcoRoundUpsertOne) AddRoundID(v int32) *IcoRoundUpsertOne

AddRoundID adds v to the "round_id" field.

func (*IcoRoundUpsertOne) AddSubRound

func (u *IcoRoundUpsertOne) AddSubRound(v int32) *IcoRoundUpsertOne

AddSubRound adds v to the "sub_round" field.

func (*IcoRoundUpsertOne) ClearEndAt

func (u *IcoRoundUpsertOne) ClearEndAt() *IcoRoundUpsertOne

ClearEndAt clears the value of the "end_at" field.

func (*IcoRoundUpsertOne) ClearStartAt

func (u *IcoRoundUpsertOne) ClearStartAt() *IcoRoundUpsertOne

ClearStartAt clears the value of the "start_at" field.

func (*IcoRoundUpsertOne) DoNothing

func (u *IcoRoundUpsertOne) DoNothing() *IcoRoundUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IcoRoundUpsertOne) Exec

func (u *IcoRoundUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoRoundUpsertOne) ExecX

func (u *IcoRoundUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoRoundUpsertOne) ID

func (u *IcoRoundUpsertOne) ID(ctx context.Context) (id xid.ID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*IcoRoundUpsertOne) IDX

func (u *IcoRoundUpsertOne) IDX(ctx context.Context) xid.ID

IDX is like ID, but panics if an error occurs.

func (*IcoRoundUpsertOne) Ignore

func (u *IcoRoundUpsertOne) Ignore() *IcoRoundUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.IcoRound.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*IcoRoundUpsertOne) SetBoughtToken

func (u *IcoRoundUpsertOne) SetBoughtToken(v string) *IcoRoundUpsertOne

SetBoughtToken sets the "bought_token" field.

func (*IcoRoundUpsertOne) SetEndAt

func (u *IcoRoundUpsertOne) SetEndAt(v time.Time) *IcoRoundUpsertOne

SetEndAt sets the "end_at" field.

func (*IcoRoundUpsertOne) SetIsClose

func (u *IcoRoundUpsertOne) SetIsClose(v bool) *IcoRoundUpsertOne

SetIsClose sets the "is_close" field.

func (*IcoRoundUpsertOne) SetNumToken

func (u *IcoRoundUpsertOne) SetNumToken(v string) *IcoRoundUpsertOne

SetNumToken sets the "num_token" field.

func (*IcoRoundUpsertOne) SetPrice

func (u *IcoRoundUpsertOne) SetPrice(v string) *IcoRoundUpsertOne

SetPrice sets the "price" field.

func (*IcoRoundUpsertOne) SetRoundID

func (u *IcoRoundUpsertOne) SetRoundID(v int32) *IcoRoundUpsertOne

SetRoundID sets the "round_id" field.

func (*IcoRoundUpsertOne) SetStartAt

func (u *IcoRoundUpsertOne) SetStartAt(v time.Time) *IcoRoundUpsertOne

SetStartAt sets the "start_at" field.

func (*IcoRoundUpsertOne) SetSubRound

func (u *IcoRoundUpsertOne) SetSubRound(v int32) *IcoRoundUpsertOne

SetSubRound sets the "sub_round" field.

func (*IcoRoundUpsertOne) SetUpdatedAt

func (u *IcoRoundUpsertOne) SetUpdatedAt(v time.Time) *IcoRoundUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoRoundUpsertOne) Update

func (u *IcoRoundUpsertOne) Update(set func(*IcoRoundUpsert)) *IcoRoundUpsertOne

Update allows overriding fields `UPDATE` values. See the IcoRoundCreate.OnConflict documentation for more info.

func (*IcoRoundUpsertOne) UpdateBoughtToken

func (u *IcoRoundUpsertOne) UpdateBoughtToken() *IcoRoundUpsertOne

UpdateBoughtToken sets the "bought_token" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateEndAt

func (u *IcoRoundUpsertOne) UpdateEndAt() *IcoRoundUpsertOne

UpdateEndAt sets the "end_at" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateIsClose

func (u *IcoRoundUpsertOne) UpdateIsClose() *IcoRoundUpsertOne

UpdateIsClose sets the "is_close" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateNewValues

func (u *IcoRoundUpsertOne) UpdateNewValues() *IcoRoundUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.IcoRound.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(icoround.FieldID)
		}),
	).
	Exec(ctx)

func (*IcoRoundUpsertOne) UpdateNumToken

func (u *IcoRoundUpsertOne) UpdateNumToken() *IcoRoundUpsertOne

UpdateNumToken sets the "num_token" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdatePrice

func (u *IcoRoundUpsertOne) UpdatePrice() *IcoRoundUpsertOne

UpdatePrice sets the "price" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateRoundID

func (u *IcoRoundUpsertOne) UpdateRoundID() *IcoRoundUpsertOne

UpdateRoundID sets the "round_id" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateStartAt

func (u *IcoRoundUpsertOne) UpdateStartAt() *IcoRoundUpsertOne

UpdateStartAt sets the "start_at" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateSubRound

func (u *IcoRoundUpsertOne) UpdateSubRound() *IcoRoundUpsertOne

UpdateSubRound sets the "sub_round" field to the value that was provided on create.

func (*IcoRoundUpsertOne) UpdateUpdatedAt

func (u *IcoRoundUpsertOne) UpdateUpdatedAt() *IcoRoundUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type IcoRounds

type IcoRounds []*IcoRound

IcoRounds is a parsable slice of IcoRound.

type IcoSelect

type IcoSelect struct {
	*IcoQuery
	// contains filtered or unexported fields
}

IcoSelect is the builder for selecting fields of Ico entities.

func (*IcoSelect) Aggregate

func (is *IcoSelect) Aggregate(fns ...AggregateFunc) *IcoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IcoSelect) Bool

func (s *IcoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IcoSelect) BoolX

func (s *IcoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IcoSelect) Bools

func (s *IcoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IcoSelect) BoolsX

func (s *IcoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (IcoSelect) ExecContext

func (c IcoSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoSelect) Float64

func (s *IcoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IcoSelect) Float64X

func (s *IcoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IcoSelect) Float64s

func (s *IcoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IcoSelect) Float64sX

func (s *IcoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IcoSelect) Int

func (s *IcoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IcoSelect) IntX

func (s *IcoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IcoSelect) Ints

func (s *IcoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IcoSelect) IntsX

func (s *IcoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IcoSelect) Modify

func (is *IcoSelect) Modify(modifiers ...func(s *sql.Selector)) *IcoSelect

Modify adds a query modifier for attaching custom logic to queries.

func (IcoSelect) QueryContext

func (c IcoSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoSelect) Scan

func (is *IcoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IcoSelect) ScanX

func (s *IcoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IcoSelect) String

func (s *IcoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IcoSelect) StringX

func (s *IcoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IcoSelect) Strings

func (s *IcoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IcoSelect) StringsX

func (s *IcoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IcoUpdate

type IcoUpdate struct {
	// contains filtered or unexported fields
}

IcoUpdate is the builder for updating Ico entities.

func (*IcoUpdate) AddNumSub

func (iu *IcoUpdate) AddNumSub(i int32) *IcoUpdate

AddNumSub adds i to the "num_sub" field.

func (*IcoUpdate) AddRoundID

func (iu *IcoUpdate) AddRoundID(i int32) *IcoUpdate

AddRoundID adds i to the "round_id" field.

func (*IcoUpdate) ClearEndedAt

func (iu *IcoUpdate) ClearEndedAt() *IcoUpdate

ClearEndedAt clears the value of the "ended_at" field.

func (*IcoUpdate) Exec

func (iu *IcoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoUpdate) ExecContext

func (c *IcoUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoUpdate) ExecX

func (iu *IcoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoUpdate) Modify

func (iu *IcoUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoUpdate) Mutation

func (iu *IcoUpdate) Mutation() *IcoMutation

Mutation returns the IcoMutation object of the builder.

func (*IcoUpdate) QueryContext

func (c *IcoUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoUpdate) Save

func (iu *IcoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IcoUpdate) SaveX

func (iu *IcoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IcoUpdate) SetEndedAt

func (iu *IcoUpdate) SetEndedAt(t time.Time) *IcoUpdate

SetEndedAt sets the "ended_at" field.

func (*IcoUpdate) SetNillableEndedAt

func (iu *IcoUpdate) SetNillableEndedAt(t *time.Time) *IcoUpdate

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*IcoUpdate) SetNillableNumSub

func (iu *IcoUpdate) SetNillableNumSub(i *int32) *IcoUpdate

SetNillableNumSub sets the "num_sub" field if the given value is not nil.

func (*IcoUpdate) SetNillableNumToken

func (iu *IcoUpdate) SetNillableNumToken(s *string) *IcoUpdate

SetNillableNumToken sets the "num_token" field if the given value is not nil.

func (*IcoUpdate) SetNillablePrice

func (iu *IcoUpdate) SetNillablePrice(s *string) *IcoUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*IcoUpdate) SetNillablePriceGap

func (iu *IcoUpdate) SetNillablePriceGap(s *string) *IcoUpdate

SetNillablePriceGap sets the "price_gap" field if the given value is not nil.

func (*IcoUpdate) SetNillableRoundID

func (iu *IcoUpdate) SetNillableRoundID(i *int32) *IcoUpdate

SetNillableRoundID sets the "round_id" field if the given value is not nil.

func (*IcoUpdate) SetNillableRoundName

func (iu *IcoUpdate) SetNillableRoundName(s *string) *IcoUpdate

SetNillableRoundName sets the "round_name" field if the given value is not nil.

func (*IcoUpdate) SetNumSub

func (iu *IcoUpdate) SetNumSub(i int32) *IcoUpdate

SetNumSub sets the "num_sub" field.

func (*IcoUpdate) SetNumToken

func (iu *IcoUpdate) SetNumToken(s string) *IcoUpdate

SetNumToken sets the "num_token" field.

func (*IcoUpdate) SetPrice

func (iu *IcoUpdate) SetPrice(s string) *IcoUpdate

SetPrice sets the "price" field.

func (*IcoUpdate) SetPriceGap

func (iu *IcoUpdate) SetPriceGap(s string) *IcoUpdate

SetPriceGap sets the "price_gap" field.

func (*IcoUpdate) SetRoundID

func (iu *IcoUpdate) SetRoundID(i int32) *IcoUpdate

SetRoundID sets the "round_id" field.

func (*IcoUpdate) SetRoundName

func (iu *IcoUpdate) SetRoundName(s string) *IcoUpdate

SetRoundName sets the "round_name" field.

func (*IcoUpdate) SetUpdatedAt

func (iu *IcoUpdate) SetUpdatedAt(t time.Time) *IcoUpdate

SetUpdatedAt sets the "updated_at" field.

func (*IcoUpdate) Where

func (iu *IcoUpdate) Where(ps ...predicate.Ico) *IcoUpdate

Where appends a list predicates to the IcoUpdate builder.

type IcoUpdateOne

type IcoUpdateOne struct {
	// contains filtered or unexported fields
}

IcoUpdateOne is the builder for updating a single Ico entity.

func (*IcoUpdateOne) AddNumSub

func (iuo *IcoUpdateOne) AddNumSub(i int32) *IcoUpdateOne

AddNumSub adds i to the "num_sub" field.

func (*IcoUpdateOne) AddRoundID

func (iuo *IcoUpdateOne) AddRoundID(i int32) *IcoUpdateOne

AddRoundID adds i to the "round_id" field.

func (*IcoUpdateOne) ClearEndedAt

func (iuo *IcoUpdateOne) ClearEndedAt() *IcoUpdateOne

ClearEndedAt clears the value of the "ended_at" field.

func (*IcoUpdateOne) Exec

func (iuo *IcoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IcoUpdateOne) ExecContext

func (c *IcoUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IcoUpdateOne) ExecX

func (iuo *IcoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoUpdateOne) Modify

func (iuo *IcoUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *IcoUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*IcoUpdateOne) Mutation

func (iuo *IcoUpdateOne) Mutation() *IcoMutation

Mutation returns the IcoMutation object of the builder.

func (*IcoUpdateOne) QueryContext

func (c *IcoUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IcoUpdateOne) Save

func (iuo *IcoUpdateOne) Save(ctx context.Context) (*Ico, error)

Save executes the query and returns the updated Ico entity.

func (*IcoUpdateOne) SaveX

func (iuo *IcoUpdateOne) SaveX(ctx context.Context) *Ico

SaveX is like Save, but panics if an error occurs.

func (*IcoUpdateOne) Select

func (iuo *IcoUpdateOne) Select(field string, fields ...string) *IcoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IcoUpdateOne) SetEndedAt

func (iuo *IcoUpdateOne) SetEndedAt(t time.Time) *IcoUpdateOne

SetEndedAt sets the "ended_at" field.

func (*IcoUpdateOne) SetNillableEndedAt

func (iuo *IcoUpdateOne) SetNillableEndedAt(t *time.Time) *IcoUpdateOne

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*IcoUpdateOne) SetNillableNumSub

func (iuo *IcoUpdateOne) SetNillableNumSub(i *int32) *IcoUpdateOne

SetNillableNumSub sets the "num_sub" field if the given value is not nil.

func (*IcoUpdateOne) SetNillableNumToken

func (iuo *IcoUpdateOne) SetNillableNumToken(s *string) *IcoUpdateOne

SetNillableNumToken sets the "num_token" field if the given value is not nil.

func (*IcoUpdateOne) SetNillablePrice

func (iuo *IcoUpdateOne) SetNillablePrice(s *string) *IcoUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*IcoUpdateOne) SetNillablePriceGap

func (iuo *IcoUpdateOne) SetNillablePriceGap(s *string) *IcoUpdateOne

SetNillablePriceGap sets the "price_gap" field if the given value is not nil.

func (*IcoUpdateOne) SetNillableRoundID

func (iuo *IcoUpdateOne) SetNillableRoundID(i *int32) *IcoUpdateOne

SetNillableRoundID sets the "round_id" field if the given value is not nil.

func (*IcoUpdateOne) SetNillableRoundName

func (iuo *IcoUpdateOne) SetNillableRoundName(s *string) *IcoUpdateOne

SetNillableRoundName sets the "round_name" field if the given value is not nil.

func (*IcoUpdateOne) SetNumSub

func (iuo *IcoUpdateOne) SetNumSub(i int32) *IcoUpdateOne

SetNumSub sets the "num_sub" field.

func (*IcoUpdateOne) SetNumToken

func (iuo *IcoUpdateOne) SetNumToken(s string) *IcoUpdateOne

SetNumToken sets the "num_token" field.

func (*IcoUpdateOne) SetPrice

func (iuo *IcoUpdateOne) SetPrice(s string) *IcoUpdateOne

SetPrice sets the "price" field.

func (*IcoUpdateOne) SetPriceGap

func (iuo *IcoUpdateOne) SetPriceGap(s string) *IcoUpdateOne

SetPriceGap sets the "price_gap" field.

func (*IcoUpdateOne) SetRoundID

func (iuo *IcoUpdateOne) SetRoundID(i int32) *IcoUpdateOne

SetRoundID sets the "round_id" field.

func (*IcoUpdateOne) SetRoundName

func (iuo *IcoUpdateOne) SetRoundName(s string) *IcoUpdateOne

SetRoundName sets the "round_name" field.

func (*IcoUpdateOne) SetUpdatedAt

func (iuo *IcoUpdateOne) SetUpdatedAt(t time.Time) *IcoUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoUpdateOne) Where

func (iuo *IcoUpdateOne) Where(ps ...predicate.Ico) *IcoUpdateOne

Where appends a list predicates to the IcoUpdate builder.

type IcoUpsert

type IcoUpsert struct {
	*sql.UpdateSet
}

IcoUpsert is the "OnConflict" setter.

func (*IcoUpsert) AddNumSub

func (u *IcoUpsert) AddNumSub(v int32) *IcoUpsert

AddNumSub adds v to the "num_sub" field.

func (*IcoUpsert) AddRoundID

func (u *IcoUpsert) AddRoundID(v int32) *IcoUpsert

AddRoundID adds v to the "round_id" field.

func (*IcoUpsert) ClearEndedAt

func (u *IcoUpsert) ClearEndedAt() *IcoUpsert

ClearEndedAt clears the value of the "ended_at" field.

func (*IcoUpsert) SetEndedAt

func (u *IcoUpsert) SetEndedAt(v time.Time) *IcoUpsert

SetEndedAt sets the "ended_at" field.

func (*IcoUpsert) SetNumSub

func (u *IcoUpsert) SetNumSub(v int32) *IcoUpsert

SetNumSub sets the "num_sub" field.

func (*IcoUpsert) SetNumToken

func (u *IcoUpsert) SetNumToken(v string) *IcoUpsert

SetNumToken sets the "num_token" field.

func (*IcoUpsert) SetPrice

func (u *IcoUpsert) SetPrice(v string) *IcoUpsert

SetPrice sets the "price" field.

func (*IcoUpsert) SetPriceGap

func (u *IcoUpsert) SetPriceGap(v string) *IcoUpsert

SetPriceGap sets the "price_gap" field.

func (*IcoUpsert) SetRoundID

func (u *IcoUpsert) SetRoundID(v int32) *IcoUpsert

SetRoundID sets the "round_id" field.

func (*IcoUpsert) SetRoundName

func (u *IcoUpsert) SetRoundName(v string) *IcoUpsert

SetRoundName sets the "round_name" field.

func (*IcoUpsert) SetUpdatedAt

func (u *IcoUpsert) SetUpdatedAt(v time.Time) *IcoUpsert

SetUpdatedAt sets the "updated_at" field.

func (*IcoUpsert) UpdateEndedAt

func (u *IcoUpsert) UpdateEndedAt() *IcoUpsert

UpdateEndedAt sets the "ended_at" field to the value that was provided on create.

func (*IcoUpsert) UpdateNumSub

func (u *IcoUpsert) UpdateNumSub() *IcoUpsert

UpdateNumSub sets the "num_sub" field to the value that was provided on create.

func (*IcoUpsert) UpdateNumToken

func (u *IcoUpsert) UpdateNumToken() *IcoUpsert

UpdateNumToken sets the "num_token" field to the value that was provided on create.

func (*IcoUpsert) UpdatePrice

func (u *IcoUpsert) UpdatePrice() *IcoUpsert

UpdatePrice sets the "price" field to the value that was provided on create.

func (*IcoUpsert) UpdatePriceGap

func (u *IcoUpsert) UpdatePriceGap() *IcoUpsert

UpdatePriceGap sets the "price_gap" field to the value that was provided on create.

func (*IcoUpsert) UpdateRoundID

func (u *IcoUpsert) UpdateRoundID() *IcoUpsert

UpdateRoundID sets the "round_id" field to the value that was provided on create.

func (*IcoUpsert) UpdateRoundName

func (u *IcoUpsert) UpdateRoundName() *IcoUpsert

UpdateRoundName sets the "round_name" field to the value that was provided on create.

func (*IcoUpsert) UpdateUpdatedAt

func (u *IcoUpsert) UpdateUpdatedAt() *IcoUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type IcoUpsertBulk

type IcoUpsertBulk struct {
	// contains filtered or unexported fields
}

IcoUpsertBulk is the builder for "upsert"-ing a bulk of Ico nodes.

func (*IcoUpsertBulk) AddNumSub

func (u *IcoUpsertBulk) AddNumSub(v int32) *IcoUpsertBulk

AddNumSub adds v to the "num_sub" field.

func (*IcoUpsertBulk) AddRoundID

func (u *IcoUpsertBulk) AddRoundID(v int32) *IcoUpsertBulk

AddRoundID adds v to the "round_id" field.

func (*IcoUpsertBulk) ClearEndedAt

func (u *IcoUpsertBulk) ClearEndedAt() *IcoUpsertBulk

ClearEndedAt clears the value of the "ended_at" field.

func (*IcoUpsertBulk) DoNothing

func (u *IcoUpsertBulk) DoNothing() *IcoUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IcoUpsertBulk) Exec

func (u *IcoUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoUpsertBulk) ExecX

func (u *IcoUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoUpsertBulk) Ignore

func (u *IcoUpsertBulk) Ignore() *IcoUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Ico.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*IcoUpsertBulk) SetEndedAt

func (u *IcoUpsertBulk) SetEndedAt(v time.Time) *IcoUpsertBulk

SetEndedAt sets the "ended_at" field.

func (*IcoUpsertBulk) SetNumSub

func (u *IcoUpsertBulk) SetNumSub(v int32) *IcoUpsertBulk

SetNumSub sets the "num_sub" field.

func (*IcoUpsertBulk) SetNumToken

func (u *IcoUpsertBulk) SetNumToken(v string) *IcoUpsertBulk

SetNumToken sets the "num_token" field.

func (*IcoUpsertBulk) SetPrice

func (u *IcoUpsertBulk) SetPrice(v string) *IcoUpsertBulk

SetPrice sets the "price" field.

func (*IcoUpsertBulk) SetPriceGap

func (u *IcoUpsertBulk) SetPriceGap(v string) *IcoUpsertBulk

SetPriceGap sets the "price_gap" field.

func (*IcoUpsertBulk) SetRoundID

func (u *IcoUpsertBulk) SetRoundID(v int32) *IcoUpsertBulk

SetRoundID sets the "round_id" field.

func (*IcoUpsertBulk) SetRoundName

func (u *IcoUpsertBulk) SetRoundName(v string) *IcoUpsertBulk

SetRoundName sets the "round_name" field.

func (*IcoUpsertBulk) SetUpdatedAt

func (u *IcoUpsertBulk) SetUpdatedAt(v time.Time) *IcoUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*IcoUpsertBulk) Update

func (u *IcoUpsertBulk) Update(set func(*IcoUpsert)) *IcoUpsertBulk

Update allows overriding fields `UPDATE` values. See the IcoCreateBulk.OnConflict documentation for more info.

func (*IcoUpsertBulk) UpdateEndedAt

func (u *IcoUpsertBulk) UpdateEndedAt() *IcoUpsertBulk

UpdateEndedAt sets the "ended_at" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdateNewValues

func (u *IcoUpsertBulk) UpdateNewValues() *IcoUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Ico.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(ico.FieldID)
		}),
	).
	Exec(ctx)

func (*IcoUpsertBulk) UpdateNumSub

func (u *IcoUpsertBulk) UpdateNumSub() *IcoUpsertBulk

UpdateNumSub sets the "num_sub" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdateNumToken

func (u *IcoUpsertBulk) UpdateNumToken() *IcoUpsertBulk

UpdateNumToken sets the "num_token" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdatePrice

func (u *IcoUpsertBulk) UpdatePrice() *IcoUpsertBulk

UpdatePrice sets the "price" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdatePriceGap

func (u *IcoUpsertBulk) UpdatePriceGap() *IcoUpsertBulk

UpdatePriceGap sets the "price_gap" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdateRoundID

func (u *IcoUpsertBulk) UpdateRoundID() *IcoUpsertBulk

UpdateRoundID sets the "round_id" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdateRoundName

func (u *IcoUpsertBulk) UpdateRoundName() *IcoUpsertBulk

UpdateRoundName sets the "round_name" field to the value that was provided on create.

func (*IcoUpsertBulk) UpdateUpdatedAt

func (u *IcoUpsertBulk) UpdateUpdatedAt() *IcoUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type IcoUpsertOne

type IcoUpsertOne struct {
	// contains filtered or unexported fields
}

IcoUpsertOne is the builder for "upsert"-ing

one Ico node.

func (*IcoUpsertOne) AddNumSub

func (u *IcoUpsertOne) AddNumSub(v int32) *IcoUpsertOne

AddNumSub adds v to the "num_sub" field.

func (*IcoUpsertOne) AddRoundID

func (u *IcoUpsertOne) AddRoundID(v int32) *IcoUpsertOne

AddRoundID adds v to the "round_id" field.

func (*IcoUpsertOne) ClearEndedAt

func (u *IcoUpsertOne) ClearEndedAt() *IcoUpsertOne

ClearEndedAt clears the value of the "ended_at" field.

func (*IcoUpsertOne) DoNothing

func (u *IcoUpsertOne) DoNothing() *IcoUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IcoUpsertOne) Exec

func (u *IcoUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*IcoUpsertOne) ExecX

func (u *IcoUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IcoUpsertOne) ID

func (u *IcoUpsertOne) ID(ctx context.Context) (id xid.ID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*IcoUpsertOne) IDX

func (u *IcoUpsertOne) IDX(ctx context.Context) xid.ID

IDX is like ID, but panics if an error occurs.

func (*IcoUpsertOne) Ignore

func (u *IcoUpsertOne) Ignore() *IcoUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Ico.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*IcoUpsertOne) SetEndedAt

func (u *IcoUpsertOne) SetEndedAt(v time.Time) *IcoUpsertOne

SetEndedAt sets the "ended_at" field.

func (*IcoUpsertOne) SetNumSub

func (u *IcoUpsertOne) SetNumSub(v int32) *IcoUpsertOne

SetNumSub sets the "num_sub" field.

func (*IcoUpsertOne) SetNumToken

func (u *IcoUpsertOne) SetNumToken(v string) *IcoUpsertOne

SetNumToken sets the "num_token" field.

func (*IcoUpsertOne) SetPrice

func (u *IcoUpsertOne) SetPrice(v string) *IcoUpsertOne

SetPrice sets the "price" field.

func (*IcoUpsertOne) SetPriceGap

func (u *IcoUpsertOne) SetPriceGap(v string) *IcoUpsertOne

SetPriceGap sets the "price_gap" field.

func (*IcoUpsertOne) SetRoundID

func (u *IcoUpsertOne) SetRoundID(v int32) *IcoUpsertOne

SetRoundID sets the "round_id" field.

func (*IcoUpsertOne) SetRoundName

func (u *IcoUpsertOne) SetRoundName(v string) *IcoUpsertOne

SetRoundName sets the "round_name" field.

func (*IcoUpsertOne) SetUpdatedAt

func (u *IcoUpsertOne) SetUpdatedAt(v time.Time) *IcoUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*IcoUpsertOne) Update

func (u *IcoUpsertOne) Update(set func(*IcoUpsert)) *IcoUpsertOne

Update allows overriding fields `UPDATE` values. See the IcoCreate.OnConflict documentation for more info.

func (*IcoUpsertOne) UpdateEndedAt

func (u *IcoUpsertOne) UpdateEndedAt() *IcoUpsertOne

UpdateEndedAt sets the "ended_at" field to the value that was provided on create.

func (*IcoUpsertOne) UpdateNewValues

func (u *IcoUpsertOne) UpdateNewValues() *IcoUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Ico.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(ico.FieldID)
		}),
	).
	Exec(ctx)

func (*IcoUpsertOne) UpdateNumSub

func (u *IcoUpsertOne) UpdateNumSub() *IcoUpsertOne

UpdateNumSub sets the "num_sub" field to the value that was provided on create.

func (*IcoUpsertOne) UpdateNumToken

func (u *IcoUpsertOne) UpdateNumToken() *IcoUpsertOne

UpdateNumToken sets the "num_token" field to the value that was provided on create.

func (*IcoUpsertOne) UpdatePrice

func (u *IcoUpsertOne) UpdatePrice() *IcoUpsertOne

UpdatePrice sets the "price" field to the value that was provided on create.

func (*IcoUpsertOne) UpdatePriceGap

func (u *IcoUpsertOne) UpdatePriceGap() *IcoUpsertOne

UpdatePriceGap sets the "price_gap" field to the value that was provided on create.

func (*IcoUpsertOne) UpdateRoundID

func (u *IcoUpsertOne) UpdateRoundID() *IcoUpsertOne

UpdateRoundID sets the "round_id" field to the value that was provided on create.

func (*IcoUpsertOne) UpdateRoundName

func (u *IcoUpsertOne) UpdateRoundName() *IcoUpsertOne

UpdateRoundName sets the "round_name" field to the value that was provided on create.

func (*IcoUpsertOne) UpdateUpdatedAt

func (u *IcoUpsertOne) UpdateUpdatedAt() *IcoUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Icos

type Icos []*Ico

Icos is a parsable slice of Ico.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Transaction

type Transaction struct {

	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// TransType holds the value of the "trans_type" field.
	TransType string `json:"trans_type,omitempty"`
	// Source holds the value of the "source" field.
	Source string `json:"source,omitempty"`
	// SrcSymbol holds the value of the "src_symbol" field.
	SrcSymbol string `json:"src_symbol,omitempty"`
	// SrcAmount holds the value of the "src_amount" field.
	SrcAmount string `json:"src_amount,omitempty"`
	// Destination holds the value of the "destination" field.
	Destination string `json:"destination,omitempty"`
	// DestSymbol holds the value of the "dest_symbol" field.
	DestSymbol string `json:"dest_symbol,omitempty"`
	// DestAmount holds the value of the "dest_amount" field.
	DestAmount string `json:"dest_amount,omitempty"`
	// Rate holds the value of the "rate" field.
	Rate string `json:"rate,omitempty"`
	// SourceService holds the value of the "source_service" field.
	SourceService string `json:"source_service,omitempty"`
	// SourceID holds the value of the "source_id" field.
	SourceID string `json:"source_id,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,omitempty"`
	// contains filtered or unexported fields
}

Transaction is the model entity for the Transaction schema.

func (*Transaction) ExecContext

func (c *Transaction) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Transaction) QueryContext

func (c *Transaction) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Transaction) String

func (t *Transaction) String() string

String implements the fmt.Stringer.

func (*Transaction) Unwrap

func (t *Transaction) Unwrap() *Transaction

Unwrap unwraps the Transaction 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 (*Transaction) Update

func (t *Transaction) Update() *TransactionUpdateOne

Update returns a builder for updating this Transaction. Note that you need to call Transaction.Unwrap() before calling this method if this Transaction was returned from a transaction, and the transaction was committed or rolled back.

func (*Transaction) Value

func (t *Transaction) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Transaction. This includes values selected through modifiers, order, etc.

type TransactionClient

type TransactionClient struct {
	// contains filtered or unexported fields
}

TransactionClient is a client for the Transaction schema.

func NewTransactionClient

func NewTransactionClient(c config) *TransactionClient

NewTransactionClient returns a client for the Transaction from the given config.

func (*TransactionClient) Create

func (c *TransactionClient) Create() *TransactionCreate

Create returns a builder for creating a Transaction entity.

func (*TransactionClient) CreateBulk

func (c *TransactionClient) CreateBulk(builders ...*TransactionCreate) *TransactionCreateBulk

CreateBulk returns a builder for creating a bulk of Transaction entities.

func (*TransactionClient) Delete

func (c *TransactionClient) Delete() *TransactionDelete

Delete returns a delete builder for Transaction.

func (*TransactionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TransactionClient) DeleteOneID

func (c *TransactionClient) DeleteOneID(id xid.ID) *TransactionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TransactionClient) ExecContext

func (c *TransactionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionClient) Get

func (c *TransactionClient) Get(ctx context.Context, id xid.ID) (*Transaction, error)

Get returns a Transaction entity by its id.

func (*TransactionClient) GetX

func (c *TransactionClient) GetX(ctx context.Context, id xid.ID) *Transaction

GetX is like Get, but panics if an error occurs.

func (*TransactionClient) Hooks

func (c *TransactionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TransactionClient) Intercept

func (c *TransactionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `transaction.Intercept(f(g(h())))`.

func (*TransactionClient) Interceptors

func (c *TransactionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TransactionClient) MapCreateBulk

func (c *TransactionClient) MapCreateBulk(slice any, setFunc func(*TransactionCreate, int)) *TransactionCreateBulk

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 (*TransactionClient) Query

func (c *TransactionClient) Query() *TransactionQuery

Query returns a query builder for Transaction.

func (*TransactionClient) QueryContext

func (c *TransactionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionClient) Update

func (c *TransactionClient) Update() *TransactionUpdate

Update returns an update builder for Transaction.

func (*TransactionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TransactionClient) UpdateOneID

func (c *TransactionClient) UpdateOneID(id xid.ID) *TransactionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TransactionClient) Use

func (c *TransactionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `transaction.Hooks(f(g(h())))`.

type TransactionCreate

type TransactionCreate struct {
	// contains filtered or unexported fields
}

TransactionCreate is the builder for creating a Transaction entity.

func (*TransactionCreate) Exec

func (tc *TransactionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TransactionCreate) ExecContext

func (c *TransactionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionCreate) ExecX

func (tc *TransactionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionCreate) Mutation

func (tc *TransactionCreate) Mutation() *TransactionMutation

Mutation returns the TransactionMutation object of the builder.

func (*TransactionCreate) OnConflict

func (tc *TransactionCreate) OnConflict(opts ...sql.ConflictOption) *TransactionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Transaction.Create().
	SetCreatedAt(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.TransactionUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*TransactionCreate) OnConflictColumns

func (tc *TransactionCreate) OnConflictColumns(columns ...string) *TransactionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TransactionCreate) QueryContext

func (c *TransactionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionCreate) Save

Save creates the Transaction in the database.

func (*TransactionCreate) SaveX

func (tc *TransactionCreate) SaveX(ctx context.Context) *Transaction

SaveX calls Save and panics if Save returns an error.

func (*TransactionCreate) SetCreatedAt

func (tc *TransactionCreate) SetCreatedAt(t time.Time) *TransactionCreate

SetCreatedAt sets the "created_at" field.

func (*TransactionCreate) SetDestAmount

func (tc *TransactionCreate) SetDestAmount(s string) *TransactionCreate

SetDestAmount sets the "dest_amount" field.

func (*TransactionCreate) SetDestSymbol

func (tc *TransactionCreate) SetDestSymbol(s string) *TransactionCreate

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionCreate) SetDestination

func (tc *TransactionCreate) SetDestination(s string) *TransactionCreate

SetDestination sets the "destination" field.

func (*TransactionCreate) SetID

func (tc *TransactionCreate) SetID(x xid.ID) *TransactionCreate

SetID sets the "id" field.

func (*TransactionCreate) SetNillableCreatedAt

func (tc *TransactionCreate) SetNillableCreatedAt(t *time.Time) *TransactionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TransactionCreate) SetNillableID

func (tc *TransactionCreate) SetNillableID(x *xid.ID) *TransactionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TransactionCreate) SetNillableUpdatedAt

func (tc *TransactionCreate) SetNillableUpdatedAt(t *time.Time) *TransactionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TransactionCreate) SetRate

func (tc *TransactionCreate) SetRate(s string) *TransactionCreate

SetRate sets the "rate" field.

func (*TransactionCreate) SetSource

func (tc *TransactionCreate) SetSource(s string) *TransactionCreate

SetSource sets the "source" field.

func (*TransactionCreate) SetSourceID

func (tc *TransactionCreate) SetSourceID(s string) *TransactionCreate

SetSourceID sets the "source_id" field.

func (*TransactionCreate) SetSourceService

func (tc *TransactionCreate) SetSourceService(s string) *TransactionCreate

SetSourceService sets the "source_service" field.

func (*TransactionCreate) SetSrcAmount

func (tc *TransactionCreate) SetSrcAmount(s string) *TransactionCreate

SetSrcAmount sets the "src_amount" field.

func (*TransactionCreate) SetSrcSymbol

func (tc *TransactionCreate) SetSrcSymbol(s string) *TransactionCreate

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionCreate) SetStatus

func (tc *TransactionCreate) SetStatus(s string) *TransactionCreate

SetStatus sets the "status" field.

func (*TransactionCreate) SetTransType

func (tc *TransactionCreate) SetTransType(s string) *TransactionCreate

SetTransType sets the "trans_type" field.

func (*TransactionCreate) SetUpdatedAt

func (tc *TransactionCreate) SetUpdatedAt(t time.Time) *TransactionCreate

SetUpdatedAt sets the "updated_at" field.

type TransactionCreateBulk

type TransactionCreateBulk struct {
	// contains filtered or unexported fields
}

TransactionCreateBulk is the builder for creating many Transaction entities in bulk.

func (*TransactionCreateBulk) Exec

func (tcb *TransactionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TransactionCreateBulk) ExecContext

func (c *TransactionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionCreateBulk) ExecX

func (tcb *TransactionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Transaction.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.TransactionUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*TransactionCreateBulk) OnConflictColumns

func (tcb *TransactionCreateBulk) OnConflictColumns(columns ...string) *TransactionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TransactionCreateBulk) QueryContext

func (c *TransactionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionCreateBulk) Save

func (tcb *TransactionCreateBulk) Save(ctx context.Context) ([]*Transaction, error)

Save creates the Transaction entities in the database.

func (*TransactionCreateBulk) SaveX

func (tcb *TransactionCreateBulk) SaveX(ctx context.Context) []*Transaction

SaveX is like Save, but panics if an error occurs.

type TransactionDelete

type TransactionDelete struct {
	// contains filtered or unexported fields
}

TransactionDelete is the builder for deleting a Transaction entity.

func (*TransactionDelete) Exec

func (td *TransactionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TransactionDelete) ExecContext

func (c *TransactionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionDelete) ExecX

func (td *TransactionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TransactionDelete) QueryContext

func (c *TransactionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionDelete) Where

Where appends a list predicates to the TransactionDelete builder.

type TransactionDeleteOne

type TransactionDeleteOne struct {
	// contains filtered or unexported fields
}

TransactionDeleteOne is the builder for deleting a single Transaction entity.

func (*TransactionDeleteOne) Exec

func (tdo *TransactionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TransactionDeleteOne) ExecX

func (tdo *TransactionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionDeleteOne) Where

Where appends a list predicates to the TransactionDelete builder.

type TransactionGroupBy

type TransactionGroupBy struct {
	// contains filtered or unexported fields
}

TransactionGroupBy is the group-by builder for Transaction entities.

func (*TransactionGroupBy) Aggregate

func (tgb *TransactionGroupBy) Aggregate(fns ...AggregateFunc) *TransactionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TransactionGroupBy) Bool

func (s *TransactionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) BoolX

func (s *TransactionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TransactionGroupBy) Bools

func (s *TransactionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) BoolsX

func (s *TransactionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TransactionGroupBy) Float64

func (s *TransactionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) Float64X

func (s *TransactionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TransactionGroupBy) Float64s

func (s *TransactionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) Float64sX

func (s *TransactionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TransactionGroupBy) Int

func (s *TransactionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) IntX

func (s *TransactionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TransactionGroupBy) Ints

func (s *TransactionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) IntsX

func (s *TransactionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TransactionGroupBy) Scan

func (tgb *TransactionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TransactionGroupBy) ScanX

func (s *TransactionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TransactionGroupBy) String

func (s *TransactionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) StringX

func (s *TransactionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TransactionGroupBy) Strings

func (s *TransactionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) StringsX

func (s *TransactionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TransactionMutation

type TransactionMutation struct {
	// contains filtered or unexported fields
}

TransactionMutation represents an operation that mutates the Transaction nodes in the graph.

func (*TransactionMutation) AddField

func (m *TransactionMutation) 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 (*TransactionMutation) AddedEdges

func (m *TransactionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TransactionMutation) AddedField

func (m *TransactionMutation) 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 (*TransactionMutation) AddedFields

func (m *TransactionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TransactionMutation) AddedIDs

func (m *TransactionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TransactionMutation) ClearEdge

func (m *TransactionMutation) 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 (*TransactionMutation) ClearField

func (m *TransactionMutation) 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 (*TransactionMutation) ClearedEdges

func (m *TransactionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TransactionMutation) ClearedFields

func (m *TransactionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TransactionMutation) Client

func (m TransactionMutation) 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 (*TransactionMutation) CreatedAt

func (m *TransactionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TransactionMutation) DestAmount

func (m *TransactionMutation) DestAmount() (r string, exists bool)

DestAmount returns the value of the "dest_amount" field in the mutation.

func (*TransactionMutation) DestSymbol

func (m *TransactionMutation) DestSymbol() (r string, exists bool)

DestSymbol returns the value of the "dest_symbol" field in the mutation.

func (*TransactionMutation) Destination

func (m *TransactionMutation) Destination() (r string, exists bool)

Destination returns the value of the "destination" field in the mutation.

func (*TransactionMutation) EdgeCleared

func (m *TransactionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TransactionMutation) ExecContext

func (c *TransactionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionMutation) Field

func (m *TransactionMutation) 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 (*TransactionMutation) FieldCleared

func (m *TransactionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TransactionMutation) Fields

func (m *TransactionMutation) 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 (*TransactionMutation) ID

func (m *TransactionMutation) ID() (id xid.ID, 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 (*TransactionMutation) IDs

func (m *TransactionMutation) IDs(ctx context.Context) ([]xid.ID, 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 (*TransactionMutation) OldCreatedAt

func (m *TransactionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldDestAmount

func (m *TransactionMutation) OldDestAmount(ctx context.Context) (v string, err error)

OldDestAmount returns the old "dest_amount" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldDestSymbol

func (m *TransactionMutation) OldDestSymbol(ctx context.Context) (v string, err error)

OldDestSymbol returns the old "dest_symbol" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldDestination

func (m *TransactionMutation) OldDestination(ctx context.Context) (v string, err error)

OldDestination returns the old "destination" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldField

func (m *TransactionMutation) 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 (*TransactionMutation) OldRate

func (m *TransactionMutation) OldRate(ctx context.Context) (v string, err error)

OldRate returns the old "rate" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldSource

func (m *TransactionMutation) OldSource(ctx context.Context) (v string, err error)

OldSource returns the old "source" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldSourceID

func (m *TransactionMutation) OldSourceID(ctx context.Context) (v string, err error)

OldSourceID returns the old "source_id" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldSourceService

func (m *TransactionMutation) OldSourceService(ctx context.Context) (v string, err error)

OldSourceService returns the old "source_service" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldSrcAmount

func (m *TransactionMutation) OldSrcAmount(ctx context.Context) (v string, err error)

OldSrcAmount returns the old "src_amount" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldSrcSymbol

func (m *TransactionMutation) OldSrcSymbol(ctx context.Context) (v string, err error)

OldSrcSymbol returns the old "src_symbol" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldStatus

func (m *TransactionMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old "status" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldTransType

func (m *TransactionMutation) OldTransType(ctx context.Context) (v string, err error)

OldTransType returns the old "trans_type" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) OldUpdatedAt

func (m *TransactionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Transaction entity. If the Transaction 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 (*TransactionMutation) Op

func (m *TransactionMutation) Op() Op

Op returns the operation name.

func (*TransactionMutation) QueryContext

func (c *TransactionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionMutation) Rate

func (m *TransactionMutation) Rate() (r string, exists bool)

Rate returns the value of the "rate" field in the mutation.

func (*TransactionMutation) RemovedEdges

func (m *TransactionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TransactionMutation) RemovedIDs

func (m *TransactionMutation) 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 (*TransactionMutation) ResetCreatedAt

func (m *TransactionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TransactionMutation) ResetDestAmount

func (m *TransactionMutation) ResetDestAmount()

ResetDestAmount resets all changes to the "dest_amount" field.

func (*TransactionMutation) ResetDestSymbol

func (m *TransactionMutation) ResetDestSymbol()

ResetDestSymbol resets all changes to the "dest_symbol" field.

func (*TransactionMutation) ResetDestination

func (m *TransactionMutation) ResetDestination()

ResetDestination resets all changes to the "destination" field.

func (*TransactionMutation) ResetEdge

func (m *TransactionMutation) 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 (*TransactionMutation) ResetField

func (m *TransactionMutation) 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 (*TransactionMutation) ResetRate

func (m *TransactionMutation) ResetRate()

ResetRate resets all changes to the "rate" field.

func (*TransactionMutation) ResetSource

func (m *TransactionMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*TransactionMutation) ResetSourceID

func (m *TransactionMutation) ResetSourceID()

ResetSourceID resets all changes to the "source_id" field.

func (*TransactionMutation) ResetSourceService

func (m *TransactionMutation) ResetSourceService()

ResetSourceService resets all changes to the "source_service" field.

func (*TransactionMutation) ResetSrcAmount

func (m *TransactionMutation) ResetSrcAmount()

ResetSrcAmount resets all changes to the "src_amount" field.

func (*TransactionMutation) ResetSrcSymbol

func (m *TransactionMutation) ResetSrcSymbol()

ResetSrcSymbol resets all changes to the "src_symbol" field.

func (*TransactionMutation) ResetStatus

func (m *TransactionMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TransactionMutation) ResetTransType

func (m *TransactionMutation) ResetTransType()

ResetTransType resets all changes to the "trans_type" field.

func (*TransactionMutation) ResetUpdatedAt

func (m *TransactionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TransactionMutation) SetCreatedAt

func (m *TransactionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TransactionMutation) SetDestAmount

func (m *TransactionMutation) SetDestAmount(s string)

SetDestAmount sets the "dest_amount" field.

func (*TransactionMutation) SetDestSymbol

func (m *TransactionMutation) SetDestSymbol(s string)

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionMutation) SetDestination

func (m *TransactionMutation) SetDestination(s string)

SetDestination sets the "destination" field.

func (*TransactionMutation) SetField

func (m *TransactionMutation) 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 (*TransactionMutation) SetID

func (m *TransactionMutation) SetID(id xid.ID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Transaction entities.

func (*TransactionMutation) SetOp

func (m *TransactionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TransactionMutation) SetRate

func (m *TransactionMutation) SetRate(s string)

SetRate sets the "rate" field.

func (*TransactionMutation) SetSource

func (m *TransactionMutation) SetSource(s string)

SetSource sets the "source" field.

func (*TransactionMutation) SetSourceID

func (m *TransactionMutation) SetSourceID(s string)

SetSourceID sets the "source_id" field.

func (*TransactionMutation) SetSourceService

func (m *TransactionMutation) SetSourceService(s string)

SetSourceService sets the "source_service" field.

func (*TransactionMutation) SetSrcAmount

func (m *TransactionMutation) SetSrcAmount(s string)

SetSrcAmount sets the "src_amount" field.

func (*TransactionMutation) SetSrcSymbol

func (m *TransactionMutation) SetSrcSymbol(s string)

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionMutation) SetStatus

func (m *TransactionMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*TransactionMutation) SetTransType

func (m *TransactionMutation) SetTransType(s string)

SetTransType sets the "trans_type" field.

func (*TransactionMutation) SetUpdatedAt

func (m *TransactionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TransactionMutation) Source

func (m *TransactionMutation) Source() (r string, exists bool)

Source returns the value of the "source" field in the mutation.

func (*TransactionMutation) SourceID

func (m *TransactionMutation) SourceID() (r string, exists bool)

SourceID returns the value of the "source_id" field in the mutation.

func (*TransactionMutation) SourceService

func (m *TransactionMutation) SourceService() (r string, exists bool)

SourceService returns the value of the "source_service" field in the mutation.

func (*TransactionMutation) SrcAmount

func (m *TransactionMutation) SrcAmount() (r string, exists bool)

SrcAmount returns the value of the "src_amount" field in the mutation.

func (*TransactionMutation) SrcSymbol

func (m *TransactionMutation) SrcSymbol() (r string, exists bool)

SrcSymbol returns the value of the "src_symbol" field in the mutation.

func (*TransactionMutation) Status

func (m *TransactionMutation) Status() (r string, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TransactionMutation) TransType

func (m *TransactionMutation) TransType() (r string, exists bool)

TransType returns the value of the "trans_type" field in the mutation.

func (TransactionMutation) Tx

func (m TransactionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TransactionMutation) Type

func (m *TransactionMutation) Type() string

Type returns the node type of this mutation (Transaction).

func (*TransactionMutation) UpdatedAt

func (m *TransactionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TransactionMutation) Where

func (m *TransactionMutation) Where(ps ...predicate.Transaction)

Where appends a list predicates to the TransactionMutation builder.

func (*TransactionMutation) WhereP

func (m *TransactionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TransactionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TransactionQuery

type TransactionQuery struct {
	// contains filtered or unexported fields
}

TransactionQuery is the builder for querying Transaction entities.

func (*TransactionQuery) Aggregate

func (tq *TransactionQuery) Aggregate(fns ...AggregateFunc) *TransactionSelect

Aggregate returns a TransactionSelect configured with the given aggregations.

func (*TransactionQuery) All

func (tq *TransactionQuery) All(ctx context.Context) ([]*Transaction, error)

All executes the query and returns a list of Transactions.

func (*TransactionQuery) AllX

func (tq *TransactionQuery) AllX(ctx context.Context) []*Transaction

AllX is like All, but panics if an error occurs.

func (*TransactionQuery) Clone

func (tq *TransactionQuery) Clone() *TransactionQuery

Clone returns a duplicate of the TransactionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TransactionQuery) Count

func (tq *TransactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TransactionQuery) CountX

func (tq *TransactionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TransactionQuery) ExecContext

func (c *TransactionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionQuery) Exist

func (tq *TransactionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TransactionQuery) ExistX

func (tq *TransactionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TransactionQuery) First

func (tq *TransactionQuery) First(ctx context.Context) (*Transaction, error)

First returns the first Transaction entity from the query. Returns a *NotFoundError when no Transaction was found.

func (*TransactionQuery) FirstID

func (tq *TransactionQuery) FirstID(ctx context.Context) (id xid.ID, err error)

FirstID returns the first Transaction ID from the query. Returns a *NotFoundError when no Transaction ID was found.

func (*TransactionQuery) FirstIDX

func (tq *TransactionQuery) FirstIDX(ctx context.Context) xid.ID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TransactionQuery) FirstX

func (tq *TransactionQuery) FirstX(ctx context.Context) *Transaction

FirstX is like First, but panics if an error occurs.

func (*TransactionQuery) GroupBy

func (tq *TransactionQuery) GroupBy(field string, fields ...string) *TransactionGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Transaction.Query().
	GroupBy(transaction.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TransactionQuery) IDs

func (tq *TransactionQuery) IDs(ctx context.Context) (ids []xid.ID, err error)

IDs executes the query and returns a list of Transaction IDs.

func (*TransactionQuery) IDsX

func (tq *TransactionQuery) IDsX(ctx context.Context) []xid.ID

IDsX is like IDs, but panics if an error occurs.

func (*TransactionQuery) Limit

func (tq *TransactionQuery) Limit(limit int) *TransactionQuery

Limit the number of records to be returned by this query.

func (*TransactionQuery) Modify

func (tq *TransactionQuery) Modify(modifiers ...func(s *sql.Selector)) *TransactionSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TransactionQuery) Offset

func (tq *TransactionQuery) Offset(offset int) *TransactionQuery

Offset to start from.

func (*TransactionQuery) Only

func (tq *TransactionQuery) Only(ctx context.Context) (*Transaction, error)

Only returns a single Transaction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Transaction entity is found. Returns a *NotFoundError when no Transaction entities are found.

func (*TransactionQuery) OnlyID

func (tq *TransactionQuery) OnlyID(ctx context.Context) (id xid.ID, err error)

OnlyID is like Only, but returns the only Transaction ID in the query. Returns a *NotSingularError when more than one Transaction ID is found. Returns a *NotFoundError when no entities are found.

func (*TransactionQuery) OnlyIDX

func (tq *TransactionQuery) OnlyIDX(ctx context.Context) xid.ID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TransactionQuery) OnlyX

func (tq *TransactionQuery) OnlyX(ctx context.Context) *Transaction

OnlyX is like Only, but panics if an error occurs.

func (*TransactionQuery) Order

Order specifies how the records should be ordered.

func (*TransactionQuery) QueryContext

func (c *TransactionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionQuery) Select

func (tq *TransactionQuery) Select(fields ...string) *TransactionSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Transaction.Query().
	Select(transaction.FieldCreatedAt).
	Scan(ctx, &v)

func (*TransactionQuery) Unique

func (tq *TransactionQuery) Unique(unique bool) *TransactionQuery

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 (*TransactionQuery) Where

Where adds a new predicate for the TransactionQuery builder.

type TransactionSelect

type TransactionSelect struct {
	*TransactionQuery
	// contains filtered or unexported fields
}

TransactionSelect is the builder for selecting fields of Transaction entities.

func (*TransactionSelect) Aggregate

func (ts *TransactionSelect) Aggregate(fns ...AggregateFunc) *TransactionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TransactionSelect) Bool

func (s *TransactionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) BoolX

func (s *TransactionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TransactionSelect) Bools

func (s *TransactionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) BoolsX

func (s *TransactionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (TransactionSelect) ExecContext

func (c TransactionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionSelect) Float64

func (s *TransactionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) Float64X

func (s *TransactionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TransactionSelect) Float64s

func (s *TransactionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) Float64sX

func (s *TransactionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TransactionSelect) Int

func (s *TransactionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) IntX

func (s *TransactionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TransactionSelect) Ints

func (s *TransactionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) IntsX

func (s *TransactionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TransactionSelect) Modify

func (ts *TransactionSelect) Modify(modifiers ...func(s *sql.Selector)) *TransactionSelect

Modify adds a query modifier for attaching custom logic to queries.

func (TransactionSelect) QueryContext

func (c TransactionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionSelect) Scan

func (ts *TransactionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TransactionSelect) ScanX

func (s *TransactionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TransactionSelect) String

func (s *TransactionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) StringX

func (s *TransactionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TransactionSelect) Strings

func (s *TransactionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) StringsX

func (s *TransactionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TransactionUpdate

type TransactionUpdate struct {
	// contains filtered or unexported fields
}

TransactionUpdate is the builder for updating Transaction entities.

func (*TransactionUpdate) Exec

func (tu *TransactionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TransactionUpdate) ExecContext

func (c *TransactionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionUpdate) ExecX

func (tu *TransactionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpdate) Modify

func (tu *TransactionUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TransactionUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TransactionUpdate) Mutation

func (tu *TransactionUpdate) Mutation() *TransactionMutation

Mutation returns the TransactionMutation object of the builder.

func (*TransactionUpdate) QueryContext

func (c *TransactionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionUpdate) Save

func (tu *TransactionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TransactionUpdate) SaveX

func (tu *TransactionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TransactionUpdate) SetDestAmount

func (tu *TransactionUpdate) SetDestAmount(s string) *TransactionUpdate

SetDestAmount sets the "dest_amount" field.

func (*TransactionUpdate) SetDestSymbol

func (tu *TransactionUpdate) SetDestSymbol(s string) *TransactionUpdate

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionUpdate) SetDestination

func (tu *TransactionUpdate) SetDestination(s string) *TransactionUpdate

SetDestination sets the "destination" field.

func (*TransactionUpdate) SetNillableDestAmount

func (tu *TransactionUpdate) SetNillableDestAmount(s *string) *TransactionUpdate

SetNillableDestAmount sets the "dest_amount" field if the given value is not nil.

func (*TransactionUpdate) SetNillableDestSymbol

func (tu *TransactionUpdate) SetNillableDestSymbol(s *string) *TransactionUpdate

SetNillableDestSymbol sets the "dest_symbol" field if the given value is not nil.

func (*TransactionUpdate) SetNillableDestination

func (tu *TransactionUpdate) SetNillableDestination(s *string) *TransactionUpdate

SetNillableDestination sets the "destination" field if the given value is not nil.

func (*TransactionUpdate) SetNillableRate

func (tu *TransactionUpdate) SetNillableRate(s *string) *TransactionUpdate

SetNillableRate sets the "rate" field if the given value is not nil.

func (*TransactionUpdate) SetNillableSource

func (tu *TransactionUpdate) SetNillableSource(s *string) *TransactionUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*TransactionUpdate) SetNillableSourceID

func (tu *TransactionUpdate) SetNillableSourceID(s *string) *TransactionUpdate

SetNillableSourceID sets the "source_id" field if the given value is not nil.

func (*TransactionUpdate) SetNillableSourceService

func (tu *TransactionUpdate) SetNillableSourceService(s *string) *TransactionUpdate

SetNillableSourceService sets the "source_service" field if the given value is not nil.

func (*TransactionUpdate) SetNillableSrcAmount

func (tu *TransactionUpdate) SetNillableSrcAmount(s *string) *TransactionUpdate

SetNillableSrcAmount sets the "src_amount" field if the given value is not nil.

func (*TransactionUpdate) SetNillableSrcSymbol

func (tu *TransactionUpdate) SetNillableSrcSymbol(s *string) *TransactionUpdate

SetNillableSrcSymbol sets the "src_symbol" field if the given value is not nil.

func (*TransactionUpdate) SetNillableStatus

func (tu *TransactionUpdate) SetNillableStatus(s *string) *TransactionUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TransactionUpdate) SetNillableTransType

func (tu *TransactionUpdate) SetNillableTransType(s *string) *TransactionUpdate

SetNillableTransType sets the "trans_type" field if the given value is not nil.

func (*TransactionUpdate) SetRate

func (tu *TransactionUpdate) SetRate(s string) *TransactionUpdate

SetRate sets the "rate" field.

func (*TransactionUpdate) SetSource

func (tu *TransactionUpdate) SetSource(s string) *TransactionUpdate

SetSource sets the "source" field.

func (*TransactionUpdate) SetSourceID

func (tu *TransactionUpdate) SetSourceID(s string) *TransactionUpdate

SetSourceID sets the "source_id" field.

func (*TransactionUpdate) SetSourceService

func (tu *TransactionUpdate) SetSourceService(s string) *TransactionUpdate

SetSourceService sets the "source_service" field.

func (*TransactionUpdate) SetSrcAmount

func (tu *TransactionUpdate) SetSrcAmount(s string) *TransactionUpdate

SetSrcAmount sets the "src_amount" field.

func (*TransactionUpdate) SetSrcSymbol

func (tu *TransactionUpdate) SetSrcSymbol(s string) *TransactionUpdate

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionUpdate) SetStatus

func (tu *TransactionUpdate) SetStatus(s string) *TransactionUpdate

SetStatus sets the "status" field.

func (*TransactionUpdate) SetTransType

func (tu *TransactionUpdate) SetTransType(s string) *TransactionUpdate

SetTransType sets the "trans_type" field.

func (*TransactionUpdate) SetUpdatedAt

func (tu *TransactionUpdate) SetUpdatedAt(t time.Time) *TransactionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TransactionUpdate) Where

Where appends a list predicates to the TransactionUpdate builder.

type TransactionUpdateOne

type TransactionUpdateOne struct {
	// contains filtered or unexported fields
}

TransactionUpdateOne is the builder for updating a single Transaction entity.

func (*TransactionUpdateOne) Exec

func (tuo *TransactionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TransactionUpdateOne) ExecContext

func (c *TransactionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TransactionUpdateOne) ExecX

func (tuo *TransactionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpdateOne) Modify

func (tuo *TransactionUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TransactionUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TransactionUpdateOne) Mutation

func (tuo *TransactionUpdateOne) Mutation() *TransactionMutation

Mutation returns the TransactionMutation object of the builder.

func (*TransactionUpdateOne) QueryContext

func (c *TransactionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TransactionUpdateOne) Save

Save executes the query and returns the updated Transaction entity.

func (*TransactionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TransactionUpdateOne) Select

func (tuo *TransactionUpdateOne) Select(field string, fields ...string) *TransactionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TransactionUpdateOne) SetDestAmount

func (tuo *TransactionUpdateOne) SetDestAmount(s string) *TransactionUpdateOne

SetDestAmount sets the "dest_amount" field.

func (*TransactionUpdateOne) SetDestSymbol

func (tuo *TransactionUpdateOne) SetDestSymbol(s string) *TransactionUpdateOne

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionUpdateOne) SetDestination

func (tuo *TransactionUpdateOne) SetDestination(s string) *TransactionUpdateOne

SetDestination sets the "destination" field.

func (*TransactionUpdateOne) SetNillableDestAmount

func (tuo *TransactionUpdateOne) SetNillableDestAmount(s *string) *TransactionUpdateOne

SetNillableDestAmount sets the "dest_amount" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableDestSymbol

func (tuo *TransactionUpdateOne) SetNillableDestSymbol(s *string) *TransactionUpdateOne

SetNillableDestSymbol sets the "dest_symbol" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableDestination

func (tuo *TransactionUpdateOne) SetNillableDestination(s *string) *TransactionUpdateOne

SetNillableDestination sets the "destination" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableRate

func (tuo *TransactionUpdateOne) SetNillableRate(s *string) *TransactionUpdateOne

SetNillableRate sets the "rate" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableSource

func (tuo *TransactionUpdateOne) SetNillableSource(s *string) *TransactionUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableSourceID

func (tuo *TransactionUpdateOne) SetNillableSourceID(s *string) *TransactionUpdateOne

SetNillableSourceID sets the "source_id" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableSourceService

func (tuo *TransactionUpdateOne) SetNillableSourceService(s *string) *TransactionUpdateOne

SetNillableSourceService sets the "source_service" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableSrcAmount

func (tuo *TransactionUpdateOne) SetNillableSrcAmount(s *string) *TransactionUpdateOne

SetNillableSrcAmount sets the "src_amount" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableSrcSymbol

func (tuo *TransactionUpdateOne) SetNillableSrcSymbol(s *string) *TransactionUpdateOne

SetNillableSrcSymbol sets the "src_symbol" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableStatus

func (tuo *TransactionUpdateOne) SetNillableStatus(s *string) *TransactionUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableTransType

func (tuo *TransactionUpdateOne) SetNillableTransType(s *string) *TransactionUpdateOne

SetNillableTransType sets the "trans_type" field if the given value is not nil.

func (*TransactionUpdateOne) SetRate

SetRate sets the "rate" field.

func (*TransactionUpdateOne) SetSource

SetSource sets the "source" field.

func (*TransactionUpdateOne) SetSourceID

func (tuo *TransactionUpdateOne) SetSourceID(s string) *TransactionUpdateOne

SetSourceID sets the "source_id" field.

func (*TransactionUpdateOne) SetSourceService

func (tuo *TransactionUpdateOne) SetSourceService(s string) *TransactionUpdateOne

SetSourceService sets the "source_service" field.

func (*TransactionUpdateOne) SetSrcAmount

func (tuo *TransactionUpdateOne) SetSrcAmount(s string) *TransactionUpdateOne

SetSrcAmount sets the "src_amount" field.

func (*TransactionUpdateOne) SetSrcSymbol

func (tuo *TransactionUpdateOne) SetSrcSymbol(s string) *TransactionUpdateOne

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*TransactionUpdateOne) SetTransType

func (tuo *TransactionUpdateOne) SetTransType(s string) *TransactionUpdateOne

SetTransType sets the "trans_type" field.

func (*TransactionUpdateOne) SetUpdatedAt

func (tuo *TransactionUpdateOne) SetUpdatedAt(t time.Time) *TransactionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TransactionUpdateOne) Where

Where appends a list predicates to the TransactionUpdate builder.

type TransactionUpsert

type TransactionUpsert struct {
	*sql.UpdateSet
}

TransactionUpsert is the "OnConflict" setter.

func (*TransactionUpsert) SetDestAmount

func (u *TransactionUpsert) SetDestAmount(v string) *TransactionUpsert

SetDestAmount sets the "dest_amount" field.

func (*TransactionUpsert) SetDestSymbol

func (u *TransactionUpsert) SetDestSymbol(v string) *TransactionUpsert

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionUpsert) SetDestination

func (u *TransactionUpsert) SetDestination(v string) *TransactionUpsert

SetDestination sets the "destination" field.

func (*TransactionUpsert) SetRate

SetRate sets the "rate" field.

func (*TransactionUpsert) SetSource

func (u *TransactionUpsert) SetSource(v string) *TransactionUpsert

SetSource sets the "source" field.

func (*TransactionUpsert) SetSourceID

func (u *TransactionUpsert) SetSourceID(v string) *TransactionUpsert

SetSourceID sets the "source_id" field.

func (*TransactionUpsert) SetSourceService

func (u *TransactionUpsert) SetSourceService(v string) *TransactionUpsert

SetSourceService sets the "source_service" field.

func (*TransactionUpsert) SetSrcAmount

func (u *TransactionUpsert) SetSrcAmount(v string) *TransactionUpsert

SetSrcAmount sets the "src_amount" field.

func (*TransactionUpsert) SetSrcSymbol

func (u *TransactionUpsert) SetSrcSymbol(v string) *TransactionUpsert

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionUpsert) SetStatus

func (u *TransactionUpsert) SetStatus(v string) *TransactionUpsert

SetStatus sets the "status" field.

func (*TransactionUpsert) SetTransType

func (u *TransactionUpsert) SetTransType(v string) *TransactionUpsert

SetTransType sets the "trans_type" field.

func (*TransactionUpsert) SetUpdatedAt

func (u *TransactionUpsert) SetUpdatedAt(v time.Time) *TransactionUpsert

SetUpdatedAt sets the "updated_at" field.

func (*TransactionUpsert) UpdateDestAmount

func (u *TransactionUpsert) UpdateDestAmount() *TransactionUpsert

UpdateDestAmount sets the "dest_amount" field to the value that was provided on create.

func (*TransactionUpsert) UpdateDestSymbol

func (u *TransactionUpsert) UpdateDestSymbol() *TransactionUpsert

UpdateDestSymbol sets the "dest_symbol" field to the value that was provided on create.

func (*TransactionUpsert) UpdateDestination

func (u *TransactionUpsert) UpdateDestination() *TransactionUpsert

UpdateDestination sets the "destination" field to the value that was provided on create.

func (*TransactionUpsert) UpdateRate

func (u *TransactionUpsert) UpdateRate() *TransactionUpsert

UpdateRate sets the "rate" field to the value that was provided on create.

func (*TransactionUpsert) UpdateSource

func (u *TransactionUpsert) UpdateSource() *TransactionUpsert

UpdateSource sets the "source" field to the value that was provided on create.

func (*TransactionUpsert) UpdateSourceID

func (u *TransactionUpsert) UpdateSourceID() *TransactionUpsert

UpdateSourceID sets the "source_id" field to the value that was provided on create.

func (*TransactionUpsert) UpdateSourceService

func (u *TransactionUpsert) UpdateSourceService() *TransactionUpsert

UpdateSourceService sets the "source_service" field to the value that was provided on create.

func (*TransactionUpsert) UpdateSrcAmount

func (u *TransactionUpsert) UpdateSrcAmount() *TransactionUpsert

UpdateSrcAmount sets the "src_amount" field to the value that was provided on create.

func (*TransactionUpsert) UpdateSrcSymbol

func (u *TransactionUpsert) UpdateSrcSymbol() *TransactionUpsert

UpdateSrcSymbol sets the "src_symbol" field to the value that was provided on create.

func (*TransactionUpsert) UpdateStatus

func (u *TransactionUpsert) UpdateStatus() *TransactionUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

func (*TransactionUpsert) UpdateTransType

func (u *TransactionUpsert) UpdateTransType() *TransactionUpsert

UpdateTransType sets the "trans_type" field to the value that was provided on create.

func (*TransactionUpsert) UpdateUpdatedAt

func (u *TransactionUpsert) UpdateUpdatedAt() *TransactionUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TransactionUpsertBulk

type TransactionUpsertBulk struct {
	// contains filtered or unexported fields
}

TransactionUpsertBulk is the builder for "upsert"-ing a bulk of Transaction nodes.

func (*TransactionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TransactionUpsertBulk) Exec

Exec executes the query.

func (*TransactionUpsertBulk) ExecX

func (u *TransactionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TransactionUpsertBulk) SetDestAmount

func (u *TransactionUpsertBulk) SetDestAmount(v string) *TransactionUpsertBulk

SetDestAmount sets the "dest_amount" field.

func (*TransactionUpsertBulk) SetDestSymbol

func (u *TransactionUpsertBulk) SetDestSymbol(v string) *TransactionUpsertBulk

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionUpsertBulk) SetDestination

func (u *TransactionUpsertBulk) SetDestination(v string) *TransactionUpsertBulk

SetDestination sets the "destination" field.

func (*TransactionUpsertBulk) SetRate

SetRate sets the "rate" field.

func (*TransactionUpsertBulk) SetSource

SetSource sets the "source" field.

func (*TransactionUpsertBulk) SetSourceID

SetSourceID sets the "source_id" field.

func (*TransactionUpsertBulk) SetSourceService

func (u *TransactionUpsertBulk) SetSourceService(v string) *TransactionUpsertBulk

SetSourceService sets the "source_service" field.

func (*TransactionUpsertBulk) SetSrcAmount

SetSrcAmount sets the "src_amount" field.

func (*TransactionUpsertBulk) SetSrcSymbol

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*TransactionUpsertBulk) SetTransType

SetTransType sets the "trans_type" field.

func (*TransactionUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*TransactionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the TransactionCreateBulk.OnConflict documentation for more info.

func (*TransactionUpsertBulk) UpdateDestAmount

func (u *TransactionUpsertBulk) UpdateDestAmount() *TransactionUpsertBulk

UpdateDestAmount sets the "dest_amount" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateDestSymbol

func (u *TransactionUpsertBulk) UpdateDestSymbol() *TransactionUpsertBulk

UpdateDestSymbol sets the "dest_symbol" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateDestination

func (u *TransactionUpsertBulk) UpdateDestination() *TransactionUpsertBulk

UpdateDestination sets the "destination" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateNewValues

func (u *TransactionUpsertBulk) UpdateNewValues() *TransactionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(transaction.FieldID)
		}),
	).
	Exec(ctx)

func (*TransactionUpsertBulk) UpdateRate

UpdateRate sets the "rate" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateSource

func (u *TransactionUpsertBulk) UpdateSource() *TransactionUpsertBulk

UpdateSource sets the "source" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateSourceID

func (u *TransactionUpsertBulk) UpdateSourceID() *TransactionUpsertBulk

UpdateSourceID sets the "source_id" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateSourceService

func (u *TransactionUpsertBulk) UpdateSourceService() *TransactionUpsertBulk

UpdateSourceService sets the "source_service" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateSrcAmount

func (u *TransactionUpsertBulk) UpdateSrcAmount() *TransactionUpsertBulk

UpdateSrcAmount sets the "src_amount" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateSrcSymbol

func (u *TransactionUpsertBulk) UpdateSrcSymbol() *TransactionUpsertBulk

UpdateSrcSymbol sets the "src_symbol" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateStatus

func (u *TransactionUpsertBulk) UpdateStatus() *TransactionUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateTransType

func (u *TransactionUpsertBulk) UpdateTransType() *TransactionUpsertBulk

UpdateTransType sets the "trans_type" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateUpdatedAt

func (u *TransactionUpsertBulk) UpdateUpdatedAt() *TransactionUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TransactionUpsertOne

type TransactionUpsertOne struct {
	// contains filtered or unexported fields
}

TransactionUpsertOne is the builder for "upsert"-ing

one Transaction node.

func (*TransactionUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TransactionUpsertOne) Exec

Exec executes the query.

func (*TransactionUpsertOne) ExecX

func (u *TransactionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpsertOne) ID

func (u *TransactionUpsertOne) ID(ctx context.Context) (id xid.ID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TransactionUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*TransactionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Transaction.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TransactionUpsertOne) SetDestAmount

func (u *TransactionUpsertOne) SetDestAmount(v string) *TransactionUpsertOne

SetDestAmount sets the "dest_amount" field.

func (*TransactionUpsertOne) SetDestSymbol

func (u *TransactionUpsertOne) SetDestSymbol(v string) *TransactionUpsertOne

SetDestSymbol sets the "dest_symbol" field.

func (*TransactionUpsertOne) SetDestination

func (u *TransactionUpsertOne) SetDestination(v string) *TransactionUpsertOne

SetDestination sets the "destination" field.

func (*TransactionUpsertOne) SetRate

SetRate sets the "rate" field.

func (*TransactionUpsertOne) SetSource

SetSource sets the "source" field.

func (*TransactionUpsertOne) SetSourceID

SetSourceID sets the "source_id" field.

func (*TransactionUpsertOne) SetSourceService

func (u *TransactionUpsertOne) SetSourceService(v string) *TransactionUpsertOne

SetSourceService sets the "source_service" field.

func (*TransactionUpsertOne) SetSrcAmount

func (u *TransactionUpsertOne) SetSrcAmount(v string) *TransactionUpsertOne

SetSrcAmount sets the "src_amount" field.

func (*TransactionUpsertOne) SetSrcSymbol

func (u *TransactionUpsertOne) SetSrcSymbol(v string) *TransactionUpsertOne

SetSrcSymbol sets the "src_symbol" field.

func (*TransactionUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*TransactionUpsertOne) SetTransType

func (u *TransactionUpsertOne) SetTransType(v string) *TransactionUpsertOne

SetTransType sets the "trans_type" field.

func (*TransactionUpsertOne) SetUpdatedAt

func (u *TransactionUpsertOne) SetUpdatedAt(v time.Time) *TransactionUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*TransactionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the TransactionCreate.OnConflict documentation for more info.

func (*TransactionUpsertOne) UpdateDestAmount

func (u *TransactionUpsertOne) UpdateDestAmount() *TransactionUpsertOne

UpdateDestAmount sets the "dest_amount" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateDestSymbol

func (u *TransactionUpsertOne) UpdateDestSymbol() *TransactionUpsertOne

UpdateDestSymbol sets the "dest_symbol" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateDestination

func (u *TransactionUpsertOne) UpdateDestination() *TransactionUpsertOne

UpdateDestination sets the "destination" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateNewValues

func (u *TransactionUpsertOne) UpdateNewValues() *TransactionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(transaction.FieldID)
		}),
	).
	Exec(ctx)

func (*TransactionUpsertOne) UpdateRate

func (u *TransactionUpsertOne) UpdateRate() *TransactionUpsertOne

UpdateRate sets the "rate" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateSource

func (u *TransactionUpsertOne) UpdateSource() *TransactionUpsertOne

UpdateSource sets the "source" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateSourceID

func (u *TransactionUpsertOne) UpdateSourceID() *TransactionUpsertOne

UpdateSourceID sets the "source_id" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateSourceService

func (u *TransactionUpsertOne) UpdateSourceService() *TransactionUpsertOne

UpdateSourceService sets the "source_service" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateSrcAmount

func (u *TransactionUpsertOne) UpdateSrcAmount() *TransactionUpsertOne

UpdateSrcAmount sets the "src_amount" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateSrcSymbol

func (u *TransactionUpsertOne) UpdateSrcSymbol() *TransactionUpsertOne

UpdateSrcSymbol sets the "src_symbol" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateStatus

func (u *TransactionUpsertOne) UpdateStatus() *TransactionUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateTransType

func (u *TransactionUpsertOne) UpdateTransType() *TransactionUpsertOne

UpdateTransType sets the "trans_type" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateUpdatedAt

func (u *TransactionUpsertOne) UpdateUpdatedAt() *TransactionUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Transactions

type Transactions []*Transaction

Transactions is a parsable slice of Transaction.

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 {

	// CurrencyRate is the client for interacting with the CurrencyRate builders.
	CurrencyRate *CurrencyRateClient
	// Ico is the client for interacting with the Ico builders.
	Ico *IcoClient
	// IcoCoupon is the client for interacting with the IcoCoupon builders.
	IcoCoupon *IcoCouponClient
	// IcoHistory is the client for interacting with the IcoHistory builders.
	IcoHistory *IcoHistoryClient
	// IcoRound is the client for interacting with the IcoRound builders.
	IcoRound *IcoRoundClient
	// Transaction is the client for interacting with the Transaction builders.
	Transaction *TransactionClient
	// UserWallet is the client for interacting with the UserWallet builders.
	UserWallet *UserWalletClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type UserWallet

type UserWallet struct {

	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Symbol holds the value of the "symbol" field.
	Symbol string `json:"symbol,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Balance holds the value of the "balance" field.
	Balance string `json:"balance,omitempty"`
	// contains filtered or unexported fields
}

UserWallet is the model entity for the UserWallet schema.

func (*UserWallet) ExecContext

func (c *UserWallet) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWallet) QueryContext

func (c *UserWallet) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWallet) String

func (uw *UserWallet) String() string

String implements the fmt.Stringer.

func (*UserWallet) Unwrap

func (uw *UserWallet) Unwrap() *UserWallet

Unwrap unwraps the UserWallet 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 (*UserWallet) Update

func (uw *UserWallet) Update() *UserWalletUpdateOne

Update returns a builder for updating this UserWallet. Note that you need to call UserWallet.Unwrap() before calling this method if this UserWallet was returned from a transaction, and the transaction was committed or rolled back.

func (*UserWallet) Value

func (uw *UserWallet) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserWallet. This includes values selected through modifiers, order, etc.

type UserWalletClient

type UserWalletClient struct {
	// contains filtered or unexported fields
}

UserWalletClient is a client for the UserWallet schema.

func NewUserWalletClient

func NewUserWalletClient(c config) *UserWalletClient

NewUserWalletClient returns a client for the UserWallet from the given config.

func (*UserWalletClient) Create

func (c *UserWalletClient) Create() *UserWalletCreate

Create returns a builder for creating a UserWallet entity.

func (*UserWalletClient) CreateBulk

func (c *UserWalletClient) CreateBulk(builders ...*UserWalletCreate) *UserWalletCreateBulk

CreateBulk returns a builder for creating a bulk of UserWallet entities.

func (*UserWalletClient) Delete

func (c *UserWalletClient) Delete() *UserWalletDelete

Delete returns a delete builder for UserWallet.

func (*UserWalletClient) DeleteOne

func (c *UserWalletClient) DeleteOne(uw *UserWallet) *UserWalletDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserWalletClient) DeleteOneID

func (c *UserWalletClient) DeleteOneID(id xid.ID) *UserWalletDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserWalletClient) ExecContext

func (c *UserWalletClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletClient) Get

func (c *UserWalletClient) Get(ctx context.Context, id xid.ID) (*UserWallet, error)

Get returns a UserWallet entity by its id.

func (*UserWalletClient) GetX

func (c *UserWalletClient) GetX(ctx context.Context, id xid.ID) *UserWallet

GetX is like Get, but panics if an error occurs.

func (*UserWalletClient) Hooks

func (c *UserWalletClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserWalletClient) Intercept

func (c *UserWalletClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userwallet.Intercept(f(g(h())))`.

func (*UserWalletClient) Interceptors

func (c *UserWalletClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserWalletClient) MapCreateBulk

func (c *UserWalletClient) MapCreateBulk(slice any, setFunc func(*UserWalletCreate, int)) *UserWalletCreateBulk

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 (*UserWalletClient) Query

func (c *UserWalletClient) Query() *UserWalletQuery

Query returns a query builder for UserWallet.

func (*UserWalletClient) QueryContext

func (c *UserWalletClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletClient) Update

func (c *UserWalletClient) Update() *UserWalletUpdate

Update returns an update builder for UserWallet.

func (*UserWalletClient) UpdateOne

func (c *UserWalletClient) UpdateOne(uw *UserWallet) *UserWalletUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserWalletClient) UpdateOneID

func (c *UserWalletClient) UpdateOneID(id xid.ID) *UserWalletUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserWalletClient) Use

func (c *UserWalletClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userwallet.Hooks(f(g(h())))`.

type UserWalletCreate

type UserWalletCreate struct {
	// contains filtered or unexported fields
}

UserWalletCreate is the builder for creating a UserWallet entity.

func (*UserWalletCreate) Exec

func (uwc *UserWalletCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserWalletCreate) ExecContext

func (c *UserWalletCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletCreate) ExecX

func (uwc *UserWalletCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletCreate) Mutation

func (uwc *UserWalletCreate) Mutation() *UserWalletMutation

Mutation returns the UserWalletMutation object of the builder.

func (*UserWalletCreate) OnConflict

func (uwc *UserWalletCreate) OnConflict(opts ...sql.ConflictOption) *UserWalletUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserWallet.Create().
	SetCreatedAt(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.UserWalletUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserWalletCreate) OnConflictColumns

func (uwc *UserWalletCreate) OnConflictColumns(columns ...string) *UserWalletUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserWallet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserWalletCreate) QueryContext

func (c *UserWalletCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletCreate) Save

func (uwc *UserWalletCreate) Save(ctx context.Context) (*UserWallet, error)

Save creates the UserWallet in the database.

func (*UserWalletCreate) SaveX

func (uwc *UserWalletCreate) SaveX(ctx context.Context) *UserWallet

SaveX calls Save and panics if Save returns an error.

func (*UserWalletCreate) SetBalance

func (uwc *UserWalletCreate) SetBalance(s string) *UserWalletCreate

SetBalance sets the "balance" field.

func (*UserWalletCreate) SetCreatedAt

func (uwc *UserWalletCreate) SetCreatedAt(t time.Time) *UserWalletCreate

SetCreatedAt sets the "created_at" field.

func (*UserWalletCreate) SetID

func (uwc *UserWalletCreate) SetID(x xid.ID) *UserWalletCreate

SetID sets the "id" field.

func (*UserWalletCreate) SetIsActive

func (uwc *UserWalletCreate) SetIsActive(b bool) *UserWalletCreate

SetIsActive sets the "is_active" field.

func (*UserWalletCreate) SetNillableCreatedAt

func (uwc *UserWalletCreate) SetNillableCreatedAt(t *time.Time) *UserWalletCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserWalletCreate) SetNillableID

func (uwc *UserWalletCreate) SetNillableID(x *xid.ID) *UserWalletCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserWalletCreate) SetNillableUpdatedAt

func (uwc *UserWalletCreate) SetNillableUpdatedAt(t *time.Time) *UserWalletCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserWalletCreate) SetSymbol

func (uwc *UserWalletCreate) SetSymbol(s string) *UserWalletCreate

SetSymbol sets the "symbol" field.

func (*UserWalletCreate) SetType

func (uwc *UserWalletCreate) SetType(s string) *UserWalletCreate

SetType sets the "type" field.

func (*UserWalletCreate) SetUpdatedAt

func (uwc *UserWalletCreate) SetUpdatedAt(t time.Time) *UserWalletCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletCreate) SetUserID

func (uwc *UserWalletCreate) SetUserID(s string) *UserWalletCreate

SetUserID sets the "user_id" field.

type UserWalletCreateBulk

type UserWalletCreateBulk struct {
	// contains filtered or unexported fields
}

UserWalletCreateBulk is the builder for creating many UserWallet entities in bulk.

func (*UserWalletCreateBulk) Exec

func (uwcb *UserWalletCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserWalletCreateBulk) ExecContext

func (c *UserWalletCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletCreateBulk) ExecX

func (uwcb *UserWalletCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletCreateBulk) OnConflict

func (uwcb *UserWalletCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserWalletUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserWallet.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.UserWalletUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserWalletCreateBulk) OnConflictColumns

func (uwcb *UserWalletCreateBulk) OnConflictColumns(columns ...string) *UserWalletUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserWallet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserWalletCreateBulk) QueryContext

func (c *UserWalletCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletCreateBulk) Save

func (uwcb *UserWalletCreateBulk) Save(ctx context.Context) ([]*UserWallet, error)

Save creates the UserWallet entities in the database.

func (*UserWalletCreateBulk) SaveX

func (uwcb *UserWalletCreateBulk) SaveX(ctx context.Context) []*UserWallet

SaveX is like Save, but panics if an error occurs.

type UserWalletDelete

type UserWalletDelete struct {
	// contains filtered or unexported fields
}

UserWalletDelete is the builder for deleting a UserWallet entity.

func (*UserWalletDelete) Exec

func (uwd *UserWalletDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserWalletDelete) ExecContext

func (c *UserWalletDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletDelete) ExecX

func (uwd *UserWalletDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletDelete) QueryContext

func (c *UserWalletDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletDelete) Where

Where appends a list predicates to the UserWalletDelete builder.

type UserWalletDeleteOne

type UserWalletDeleteOne struct {
	// contains filtered or unexported fields
}

UserWalletDeleteOne is the builder for deleting a single UserWallet entity.

func (*UserWalletDeleteOne) Exec

func (uwdo *UserWalletDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserWalletDeleteOne) ExecX

func (uwdo *UserWalletDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletDeleteOne) Where

Where appends a list predicates to the UserWalletDelete builder.

type UserWalletGroupBy

type UserWalletGroupBy struct {
	// contains filtered or unexported fields
}

UserWalletGroupBy is the group-by builder for UserWallet entities.

func (*UserWalletGroupBy) Aggregate

func (uwgb *UserWalletGroupBy) Aggregate(fns ...AggregateFunc) *UserWalletGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserWalletGroupBy) Bool

func (s *UserWalletGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) BoolX

func (s *UserWalletGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserWalletGroupBy) Bools

func (s *UserWalletGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) BoolsX

func (s *UserWalletGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserWalletGroupBy) Float64

func (s *UserWalletGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) Float64X

func (s *UserWalletGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserWalletGroupBy) Float64s

func (s *UserWalletGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) Float64sX

func (s *UserWalletGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserWalletGroupBy) Int

func (s *UserWalletGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) IntX

func (s *UserWalletGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserWalletGroupBy) Ints

func (s *UserWalletGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) IntsX

func (s *UserWalletGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserWalletGroupBy) Scan

func (uwgb *UserWalletGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserWalletGroupBy) ScanX

func (s *UserWalletGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserWalletGroupBy) String

func (s *UserWalletGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) StringX

func (s *UserWalletGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserWalletGroupBy) Strings

func (s *UserWalletGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserWalletGroupBy) StringsX

func (s *UserWalletGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserWalletMutation

type UserWalletMutation struct {
	// contains filtered or unexported fields
}

UserWalletMutation represents an operation that mutates the UserWallet nodes in the graph.

func (*UserWalletMutation) AddField

func (m *UserWalletMutation) 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 (*UserWalletMutation) AddedEdges

func (m *UserWalletMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserWalletMutation) AddedField

func (m *UserWalletMutation) 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 (*UserWalletMutation) AddedFields

func (m *UserWalletMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserWalletMutation) AddedIDs

func (m *UserWalletMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserWalletMutation) Balance

func (m *UserWalletMutation) Balance() (r string, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*UserWalletMutation) ClearEdge

func (m *UserWalletMutation) 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 (*UserWalletMutation) ClearField

func (m *UserWalletMutation) 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 (*UserWalletMutation) ClearedEdges

func (m *UserWalletMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserWalletMutation) ClearedFields

func (m *UserWalletMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserWalletMutation) Client

func (m UserWalletMutation) 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 (*UserWalletMutation) CreatedAt

func (m *UserWalletMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserWalletMutation) EdgeCleared

func (m *UserWalletMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserWalletMutation) ExecContext

func (c *UserWalletMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletMutation) Field

func (m *UserWalletMutation) 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 (*UserWalletMutation) FieldCleared

func (m *UserWalletMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserWalletMutation) Fields

func (m *UserWalletMutation) 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 (*UserWalletMutation) GetType

func (m *UserWalletMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*UserWalletMutation) ID

func (m *UserWalletMutation) ID() (id xid.ID, 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 (*UserWalletMutation) IDs

func (m *UserWalletMutation) IDs(ctx context.Context) ([]xid.ID, 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 (*UserWalletMutation) IsActive

func (m *UserWalletMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*UserWalletMutation) OldBalance

func (m *UserWalletMutation) OldBalance(ctx context.Context) (v string, err error)

OldBalance returns the old "balance" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) OldCreatedAt

func (m *UserWalletMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) OldField

func (m *UserWalletMutation) 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 (*UserWalletMutation) OldIsActive

func (m *UserWalletMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) OldSymbol

func (m *UserWalletMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) OldType

func (m *UserWalletMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) OldUpdatedAt

func (m *UserWalletMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) OldUserID

func (m *UserWalletMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the UserWallet entity. If the UserWallet 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 (*UserWalletMutation) Op

func (m *UserWalletMutation) Op() Op

Op returns the operation name.

func (*UserWalletMutation) QueryContext

func (c *UserWalletMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletMutation) RemovedEdges

func (m *UserWalletMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserWalletMutation) RemovedIDs

func (m *UserWalletMutation) 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 (*UserWalletMutation) ResetBalance

func (m *UserWalletMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*UserWalletMutation) ResetCreatedAt

func (m *UserWalletMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserWalletMutation) ResetEdge

func (m *UserWalletMutation) 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 (*UserWalletMutation) ResetField

func (m *UserWalletMutation) 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 (*UserWalletMutation) ResetIsActive

func (m *UserWalletMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*UserWalletMutation) ResetSymbol

func (m *UserWalletMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*UserWalletMutation) ResetType

func (m *UserWalletMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*UserWalletMutation) ResetUpdatedAt

func (m *UserWalletMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserWalletMutation) ResetUserID

func (m *UserWalletMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserWalletMutation) SetBalance

func (m *UserWalletMutation) SetBalance(s string)

SetBalance sets the "balance" field.

func (*UserWalletMutation) SetCreatedAt

func (m *UserWalletMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserWalletMutation) SetField

func (m *UserWalletMutation) 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 (*UserWalletMutation) SetID

func (m *UserWalletMutation) SetID(id xid.ID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of UserWallet entities.

func (*UserWalletMutation) SetIsActive

func (m *UserWalletMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*UserWalletMutation) SetOp

func (m *UserWalletMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserWalletMutation) SetSymbol

func (m *UserWalletMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*UserWalletMutation) SetType

func (m *UserWalletMutation) SetType(s string)

SetType sets the "type" field.

func (*UserWalletMutation) SetUpdatedAt

func (m *UserWalletMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletMutation) SetUserID

func (m *UserWalletMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*UserWalletMutation) Symbol

func (m *UserWalletMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (UserWalletMutation) Tx

func (m UserWalletMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserWalletMutation) Type

func (m *UserWalletMutation) Type() string

Type returns the node type of this mutation (UserWallet).

func (*UserWalletMutation) UpdatedAt

func (m *UserWalletMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserWalletMutation) UserID

func (m *UserWalletMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserWalletMutation) Where

func (m *UserWalletMutation) Where(ps ...predicate.UserWallet)

Where appends a list predicates to the UserWalletMutation builder.

func (*UserWalletMutation) WhereP

func (m *UserWalletMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserWalletMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserWalletQuery

type UserWalletQuery struct {
	// contains filtered or unexported fields
}

UserWalletQuery is the builder for querying UserWallet entities.

func (*UserWalletQuery) Aggregate

func (uwq *UserWalletQuery) Aggregate(fns ...AggregateFunc) *UserWalletSelect

Aggregate returns a UserWalletSelect configured with the given aggregations.

func (*UserWalletQuery) All

func (uwq *UserWalletQuery) All(ctx context.Context) ([]*UserWallet, error)

All executes the query and returns a list of UserWallets.

func (*UserWalletQuery) AllX

func (uwq *UserWalletQuery) AllX(ctx context.Context) []*UserWallet

AllX is like All, but panics if an error occurs.

func (*UserWalletQuery) Clone

func (uwq *UserWalletQuery) Clone() *UserWalletQuery

Clone returns a duplicate of the UserWalletQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserWalletQuery) Count

func (uwq *UserWalletQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserWalletQuery) CountX

func (uwq *UserWalletQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserWalletQuery) ExecContext

func (c *UserWalletQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletQuery) Exist

func (uwq *UserWalletQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserWalletQuery) ExistX

func (uwq *UserWalletQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserWalletQuery) First

func (uwq *UserWalletQuery) First(ctx context.Context) (*UserWallet, error)

First returns the first UserWallet entity from the query. Returns a *NotFoundError when no UserWallet was found.

func (*UserWalletQuery) FirstID

func (uwq *UserWalletQuery) FirstID(ctx context.Context) (id xid.ID, err error)

FirstID returns the first UserWallet ID from the query. Returns a *NotFoundError when no UserWallet ID was found.

func (*UserWalletQuery) FirstIDX

func (uwq *UserWalletQuery) FirstIDX(ctx context.Context) xid.ID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserWalletQuery) FirstX

func (uwq *UserWalletQuery) FirstX(ctx context.Context) *UserWallet

FirstX is like First, but panics if an error occurs.

func (*UserWalletQuery) GroupBy

func (uwq *UserWalletQuery) GroupBy(field string, fields ...string) *UserWalletGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserWallet.Query().
	GroupBy(userwallet.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserWalletQuery) IDs

func (uwq *UserWalletQuery) IDs(ctx context.Context) (ids []xid.ID, err error)

IDs executes the query and returns a list of UserWallet IDs.

func (*UserWalletQuery) IDsX

func (uwq *UserWalletQuery) IDsX(ctx context.Context) []xid.ID

IDsX is like IDs, but panics if an error occurs.

func (*UserWalletQuery) Limit

func (uwq *UserWalletQuery) Limit(limit int) *UserWalletQuery

Limit the number of records to be returned by this query.

func (*UserWalletQuery) Modify

func (uwq *UserWalletQuery) Modify(modifiers ...func(s *sql.Selector)) *UserWalletSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserWalletQuery) Offset

func (uwq *UserWalletQuery) Offset(offset int) *UserWalletQuery

Offset to start from.

func (*UserWalletQuery) Only

func (uwq *UserWalletQuery) Only(ctx context.Context) (*UserWallet, error)

Only returns a single UserWallet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserWallet entity is found. Returns a *NotFoundError when no UserWallet entities are found.

func (*UserWalletQuery) OnlyID

func (uwq *UserWalletQuery) OnlyID(ctx context.Context) (id xid.ID, err error)

OnlyID is like Only, but returns the only UserWallet ID in the query. Returns a *NotSingularError when more than one UserWallet ID is found. Returns a *NotFoundError when no entities are found.

func (*UserWalletQuery) OnlyIDX

func (uwq *UserWalletQuery) OnlyIDX(ctx context.Context) xid.ID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserWalletQuery) OnlyX

func (uwq *UserWalletQuery) OnlyX(ctx context.Context) *UserWallet

OnlyX is like Only, but panics if an error occurs.

func (*UserWalletQuery) Order

Order specifies how the records should be ordered.

func (*UserWalletQuery) QueryContext

func (c *UserWalletQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletQuery) Select

func (uwq *UserWalletQuery) Select(fields ...string) *UserWalletSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserWallet.Query().
	Select(userwallet.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserWalletQuery) Unique

func (uwq *UserWalletQuery) Unique(unique bool) *UserWalletQuery

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 (*UserWalletQuery) Where

Where adds a new predicate for the UserWalletQuery builder.

type UserWalletSelect

type UserWalletSelect struct {
	*UserWalletQuery
	// contains filtered or unexported fields
}

UserWalletSelect is the builder for selecting fields of UserWallet entities.

func (*UserWalletSelect) Aggregate

func (uws *UserWalletSelect) Aggregate(fns ...AggregateFunc) *UserWalletSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserWalletSelect) Bool

func (s *UserWalletSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) BoolX

func (s *UserWalletSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserWalletSelect) Bools

func (s *UserWalletSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) BoolsX

func (s *UserWalletSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (UserWalletSelect) ExecContext

func (c UserWalletSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletSelect) Float64

func (s *UserWalletSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) Float64X

func (s *UserWalletSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserWalletSelect) Float64s

func (s *UserWalletSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) Float64sX

func (s *UserWalletSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserWalletSelect) Int

func (s *UserWalletSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) IntX

func (s *UserWalletSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserWalletSelect) Ints

func (s *UserWalletSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) IntsX

func (s *UserWalletSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserWalletSelect) Modify

func (uws *UserWalletSelect) Modify(modifiers ...func(s *sql.Selector)) *UserWalletSelect

Modify adds a query modifier for attaching custom logic to queries.

func (UserWalletSelect) QueryContext

func (c UserWalletSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletSelect) Scan

func (uws *UserWalletSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserWalletSelect) ScanX

func (s *UserWalletSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserWalletSelect) String

func (s *UserWalletSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) StringX

func (s *UserWalletSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserWalletSelect) Strings

func (s *UserWalletSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserWalletSelect) StringsX

func (s *UserWalletSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserWalletUpdate

type UserWalletUpdate struct {
	// contains filtered or unexported fields
}

UserWalletUpdate is the builder for updating UserWallet entities.

func (*UserWalletUpdate) Exec

func (uwu *UserWalletUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserWalletUpdate) ExecContext

func (c *UserWalletUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletUpdate) ExecX

func (uwu *UserWalletUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletUpdate) Modify

func (uwu *UserWalletUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserWalletUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserWalletUpdate) Mutation

func (uwu *UserWalletUpdate) Mutation() *UserWalletMutation

Mutation returns the UserWalletMutation object of the builder.

func (*UserWalletUpdate) QueryContext

func (c *UserWalletUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletUpdate) Save

func (uwu *UserWalletUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserWalletUpdate) SaveX

func (uwu *UserWalletUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserWalletUpdate) SetBalance

func (uwu *UserWalletUpdate) SetBalance(s string) *UserWalletUpdate

SetBalance sets the "balance" field.

func (*UserWalletUpdate) SetIsActive

func (uwu *UserWalletUpdate) SetIsActive(b bool) *UserWalletUpdate

SetIsActive sets the "is_active" field.

func (*UserWalletUpdate) SetNillableBalance

func (uwu *UserWalletUpdate) SetNillableBalance(s *string) *UserWalletUpdate

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*UserWalletUpdate) SetNillableIsActive

func (uwu *UserWalletUpdate) SetNillableIsActive(b *bool) *UserWalletUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserWalletUpdate) SetNillableSymbol

func (uwu *UserWalletUpdate) SetNillableSymbol(s *string) *UserWalletUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*UserWalletUpdate) SetNillableType

func (uwu *UserWalletUpdate) SetNillableType(s *string) *UserWalletUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*UserWalletUpdate) SetNillableUserID

func (uwu *UserWalletUpdate) SetNillableUserID(s *string) *UserWalletUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserWalletUpdate) SetSymbol

func (uwu *UserWalletUpdate) SetSymbol(s string) *UserWalletUpdate

SetSymbol sets the "symbol" field.

func (*UserWalletUpdate) SetType

func (uwu *UserWalletUpdate) SetType(s string) *UserWalletUpdate

SetType sets the "type" field.

func (*UserWalletUpdate) SetUpdatedAt

func (uwu *UserWalletUpdate) SetUpdatedAt(t time.Time) *UserWalletUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletUpdate) SetUserID

func (uwu *UserWalletUpdate) SetUserID(s string) *UserWalletUpdate

SetUserID sets the "user_id" field.

func (*UserWalletUpdate) Where

Where appends a list predicates to the UserWalletUpdate builder.

type UserWalletUpdateOne

type UserWalletUpdateOne struct {
	// contains filtered or unexported fields
}

UserWalletUpdateOne is the builder for updating a single UserWallet entity.

func (*UserWalletUpdateOne) Exec

func (uwuo *UserWalletUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserWalletUpdateOne) ExecContext

func (c *UserWalletUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserWalletUpdateOne) ExecX

func (uwuo *UserWalletUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletUpdateOne) Modify

func (uwuo *UserWalletUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserWalletUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserWalletUpdateOne) Mutation

func (uwuo *UserWalletUpdateOne) Mutation() *UserWalletMutation

Mutation returns the UserWalletMutation object of the builder.

func (*UserWalletUpdateOne) QueryContext

func (c *UserWalletUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserWalletUpdateOne) Save

func (uwuo *UserWalletUpdateOne) Save(ctx context.Context) (*UserWallet, error)

Save executes the query and returns the updated UserWallet entity.

func (*UserWalletUpdateOne) SaveX

func (uwuo *UserWalletUpdateOne) SaveX(ctx context.Context) *UserWallet

SaveX is like Save, but panics if an error occurs.

func (*UserWalletUpdateOne) Select

func (uwuo *UserWalletUpdateOne) Select(field string, fields ...string) *UserWalletUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserWalletUpdateOne) SetBalance

func (uwuo *UserWalletUpdateOne) SetBalance(s string) *UserWalletUpdateOne

SetBalance sets the "balance" field.

func (*UserWalletUpdateOne) SetIsActive

func (uwuo *UserWalletUpdateOne) SetIsActive(b bool) *UserWalletUpdateOne

SetIsActive sets the "is_active" field.

func (*UserWalletUpdateOne) SetNillableBalance

func (uwuo *UserWalletUpdateOne) SetNillableBalance(s *string) *UserWalletUpdateOne

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*UserWalletUpdateOne) SetNillableIsActive

func (uwuo *UserWalletUpdateOne) SetNillableIsActive(b *bool) *UserWalletUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserWalletUpdateOne) SetNillableSymbol

func (uwuo *UserWalletUpdateOne) SetNillableSymbol(s *string) *UserWalletUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*UserWalletUpdateOne) SetNillableType

func (uwuo *UserWalletUpdateOne) SetNillableType(s *string) *UserWalletUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*UserWalletUpdateOne) SetNillableUserID

func (uwuo *UserWalletUpdateOne) SetNillableUserID(s *string) *UserWalletUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserWalletUpdateOne) SetSymbol

func (uwuo *UserWalletUpdateOne) SetSymbol(s string) *UserWalletUpdateOne

SetSymbol sets the "symbol" field.

func (*UserWalletUpdateOne) SetType

SetType sets the "type" field.

func (*UserWalletUpdateOne) SetUpdatedAt

func (uwuo *UserWalletUpdateOne) SetUpdatedAt(t time.Time) *UserWalletUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletUpdateOne) SetUserID

func (uwuo *UserWalletUpdateOne) SetUserID(s string) *UserWalletUpdateOne

SetUserID sets the "user_id" field.

func (*UserWalletUpdateOne) Where

Where appends a list predicates to the UserWalletUpdate builder.

type UserWalletUpsert

type UserWalletUpsert struct {
	*sql.UpdateSet
}

UserWalletUpsert is the "OnConflict" setter.

func (*UserWalletUpsert) SetBalance

func (u *UserWalletUpsert) SetBalance(v string) *UserWalletUpsert

SetBalance sets the "balance" field.

func (*UserWalletUpsert) SetIsActive

func (u *UserWalletUpsert) SetIsActive(v bool) *UserWalletUpsert

SetIsActive sets the "is_active" field.

func (*UserWalletUpsert) SetSymbol

func (u *UserWalletUpsert) SetSymbol(v string) *UserWalletUpsert

SetSymbol sets the "symbol" field.

func (*UserWalletUpsert) SetType

func (u *UserWalletUpsert) SetType(v string) *UserWalletUpsert

SetType sets the "type" field.

func (*UserWalletUpsert) SetUpdatedAt

func (u *UserWalletUpsert) SetUpdatedAt(v time.Time) *UserWalletUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletUpsert) SetUserID

func (u *UserWalletUpsert) SetUserID(v string) *UserWalletUpsert

SetUserID sets the "user_id" field.

func (*UserWalletUpsert) UpdateBalance

func (u *UserWalletUpsert) UpdateBalance() *UserWalletUpsert

UpdateBalance sets the "balance" field to the value that was provided on create.

func (*UserWalletUpsert) UpdateIsActive

func (u *UserWalletUpsert) UpdateIsActive() *UserWalletUpsert

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*UserWalletUpsert) UpdateSymbol

func (u *UserWalletUpsert) UpdateSymbol() *UserWalletUpsert

UpdateSymbol sets the "symbol" field to the value that was provided on create.

func (*UserWalletUpsert) UpdateType

func (u *UserWalletUpsert) UpdateType() *UserWalletUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*UserWalletUpsert) UpdateUpdatedAt

func (u *UserWalletUpsert) UpdateUpdatedAt() *UserWalletUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserWalletUpsert) UpdateUserID

func (u *UserWalletUpsert) UpdateUserID() *UserWalletUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserWalletUpsertBulk

type UserWalletUpsertBulk struct {
	// contains filtered or unexported fields
}

UserWalletUpsertBulk is the builder for "upsert"-ing a bulk of UserWallet nodes.

func (*UserWalletUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserWalletUpsertBulk) Exec

Exec executes the query.

func (*UserWalletUpsertBulk) ExecX

func (u *UserWalletUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserWallet.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserWalletUpsertBulk) SetBalance

SetBalance sets the "balance" field.

func (*UserWalletUpsertBulk) SetIsActive

func (u *UserWalletUpsertBulk) SetIsActive(v bool) *UserWalletUpsertBulk

SetIsActive sets the "is_active" field.

func (*UserWalletUpsertBulk) SetSymbol

SetSymbol sets the "symbol" field.

func (*UserWalletUpsertBulk) SetType

SetType sets the "type" field.

func (*UserWalletUpsertBulk) SetUpdatedAt

func (u *UserWalletUpsertBulk) SetUpdatedAt(v time.Time) *UserWalletUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*UserWalletUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the UserWalletCreateBulk.OnConflict documentation for more info.

func (*UserWalletUpsertBulk) UpdateBalance

func (u *UserWalletUpsertBulk) UpdateBalance() *UserWalletUpsertBulk

UpdateBalance sets the "balance" field to the value that was provided on create.

func (*UserWalletUpsertBulk) UpdateIsActive

func (u *UserWalletUpsertBulk) UpdateIsActive() *UserWalletUpsertBulk

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*UserWalletUpsertBulk) UpdateNewValues

func (u *UserWalletUpsertBulk) UpdateNewValues() *UserWalletUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserWallet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(userwallet.FieldID)
		}),
	).
	Exec(ctx)

func (*UserWalletUpsertBulk) UpdateSymbol

func (u *UserWalletUpsertBulk) UpdateSymbol() *UserWalletUpsertBulk

UpdateSymbol sets the "symbol" field to the value that was provided on create.

func (*UserWalletUpsertBulk) UpdateType

func (u *UserWalletUpsertBulk) UpdateType() *UserWalletUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*UserWalletUpsertBulk) UpdateUpdatedAt

func (u *UserWalletUpsertBulk) UpdateUpdatedAt() *UserWalletUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserWalletUpsertBulk) UpdateUserID

func (u *UserWalletUpsertBulk) UpdateUserID() *UserWalletUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserWalletUpsertOne

type UserWalletUpsertOne struct {
	// contains filtered or unexported fields
}

UserWalletUpsertOne is the builder for "upsert"-ing

one UserWallet node.

func (*UserWalletUpsertOne) DoNothing

func (u *UserWalletUpsertOne) DoNothing() *UserWalletUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserWalletUpsertOne) Exec

Exec executes the query.

func (*UserWalletUpsertOne) ExecX

func (u *UserWalletUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserWalletUpsertOne) ID

func (u *UserWalletUpsertOne) ID(ctx context.Context) (id xid.ID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserWalletUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*UserWalletUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserWallet.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserWalletUpsertOne) SetBalance

SetBalance sets the "balance" field.

func (*UserWalletUpsertOne) SetIsActive

func (u *UserWalletUpsertOne) SetIsActive(v bool) *UserWalletUpsertOne

SetIsActive sets the "is_active" field.

func (*UserWalletUpsertOne) SetSymbol

SetSymbol sets the "symbol" field.

func (*UserWalletUpsertOne) SetType

SetType sets the "type" field.

func (*UserWalletUpsertOne) SetUpdatedAt

func (u *UserWalletUpsertOne) SetUpdatedAt(v time.Time) *UserWalletUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserWalletUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*UserWalletUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the UserWalletCreate.OnConflict documentation for more info.

func (*UserWalletUpsertOne) UpdateBalance

func (u *UserWalletUpsertOne) UpdateBalance() *UserWalletUpsertOne

UpdateBalance sets the "balance" field to the value that was provided on create.

func (*UserWalletUpsertOne) UpdateIsActive

func (u *UserWalletUpsertOne) UpdateIsActive() *UserWalletUpsertOne

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*UserWalletUpsertOne) UpdateNewValues

func (u *UserWalletUpsertOne) UpdateNewValues() *UserWalletUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.UserWallet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(userwallet.FieldID)
		}),
	).
	Exec(ctx)

func (*UserWalletUpsertOne) UpdateSymbol

func (u *UserWalletUpsertOne) UpdateSymbol() *UserWalletUpsertOne

UpdateSymbol sets the "symbol" field to the value that was provided on create.

func (*UserWalletUpsertOne) UpdateType

func (u *UserWalletUpsertOne) UpdateType() *UserWalletUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*UserWalletUpsertOne) UpdateUpdatedAt

func (u *UserWalletUpsertOne) UpdateUpdatedAt() *UserWalletUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserWalletUpsertOne) UpdateUserID

func (u *UserWalletUpsertOne) UpdateUserID() *UserWalletUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserWallets

type UserWallets []*UserWallet

UserWallets is a parsable slice of UserWallet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL