ent

package
v0.0.0-...-984c388 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 22 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.
	TypeCard             = "Card"
	TypeContact          = "Contact"
	TypeFinancialAccount = "FinancialAccount"
	TypeUser             = "User"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Card

type Card struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Version holds the value of the "version" field.
	Version uint32 `json:"version,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"`
	// FinancialAccountID holds the value of the "financial_account_id" field.
	FinancialAccountID string `json:"financial_account_id,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// BankName holds the value of the "bank_name" field.
	BankName string `json:"bank_name,omitempty"`
	// LastDigits holds the value of the "last_digits" field.
	LastDigits uint16 `json:"last_digits,omitempty"`
	// Balance holds the value of the "balance" field.
	Balance float64 `json:"balance,omitempty"`
	// BalanceLimit holds the value of the "balance_limit" field.
	BalanceLimit float64 `json:"balance_limit,omitempty"`
	// CurrencyCode holds the value of the "currency_code" field.
	CurrencyCode string `json:"currency_code,omitempty"`
	// CardType holds the value of the "card_type" field.
	CardType string `json:"card_type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CardQuery when eager-loading is set.
	Edges CardEdges `json:"edges"`
	// contains filtered or unexported fields
}

Card is the model entity for the Card schema.

func (*Card) QueryFinancialAccount

func (c *Card) QueryFinancialAccount() *FinancialAccountQuery

QueryFinancialAccount queries the "financial_account" edge of the Card entity.

func (*Card) QueryUser

func (c *Card) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Card entity.

func (*Card) String

func (c *Card) String() string

String implements the fmt.Stringer.

func (*Card) Unwrap

func (c *Card) Unwrap() *Card

Unwrap unwraps the Card entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Card) Update

func (c *Card) Update() *CardUpdateOne

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

type CardClient

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

CardClient is a client for the Card schema.

func NewCardClient

func NewCardClient(c config) *CardClient

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

func (*CardClient) Create

func (c *CardClient) Create() *CardCreate

Create returns a builder for creating a Card entity.

func (*CardClient) CreateBulk

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

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

func (*CardClient) Delete

func (c *CardClient) Delete() *CardDelete

Delete returns a delete builder for Card.

func (*CardClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*CardClient) DeleteOneID

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

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

func (*CardClient) Get

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

Get returns a Card entity by its id.

func (*CardClient) GetX

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

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

func (*CardClient) Hooks

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

Hooks returns the client hooks.

func (*CardClient) Intercept

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

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

func (*CardClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CardClient) Query

func (c *CardClient) Query() *CardQuery

Query returns a query builder for Card.

func (*CardClient) QueryFinancialAccount

func (c *CardClient) QueryFinancialAccount(ca *Card) *FinancialAccountQuery

QueryFinancialAccount queries the financial_account edge of a Card.

func (*CardClient) QueryUser

func (c *CardClient) QueryUser(ca *Card) *UserQuery

QueryUser queries the user edge of a Card.

func (*CardClient) Update

func (c *CardClient) Update() *CardUpdate

Update returns an update builder for Card.

func (*CardClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*CardClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*CardClient) Use

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

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

type CardCreate

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

CardCreate is the builder for creating a Card entity.

func (*CardCreate) Exec

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

Exec executes the query.

func (*CardCreate) ExecX

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

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

func (*CardCreate) Mutation

func (cc *CardCreate) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardCreate) OnConflict

func (cc *CardCreate) OnConflict(opts ...sql.ConflictOption) *CardUpsertOne

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

client.Card.Create().
	SetIsActive(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.CardUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*CardCreate) OnConflictColumns

func (cc *CardCreate) OnConflictColumns(columns ...string) *CardUpsertOne

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

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

func (*CardCreate) Save

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

Save creates the Card in the database.

func (*CardCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*CardCreate) SetBalance

func (cc *CardCreate) SetBalance(f float64) *CardCreate

SetBalance sets the "balance" field.

func (*CardCreate) SetBalanceLimit

func (cc *CardCreate) SetBalanceLimit(f float64) *CardCreate

SetBalanceLimit sets the "balance_limit" field.

func (*CardCreate) SetBankName

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

SetBankName sets the "bank_name" field.

func (*CardCreate) SetCardType

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

SetCardType sets the "card_type" field.

func (*CardCreate) SetCreatedAt

func (cc *CardCreate) SetCreatedAt(t time.Time) *CardCreate

SetCreatedAt sets the "created_at" field.

func (*CardCreate) SetCurrencyCode

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

SetCurrencyCode sets the "currency_code" field.

func (*CardCreate) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*CardCreate) SetFinancialAccount

func (cc *CardCreate) SetFinancialAccount(f *FinancialAccount) *CardCreate

SetFinancialAccount sets the "financial_account" edge to the FinancialAccount entity.

func (*CardCreate) SetFinancialAccountID

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

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardCreate) SetID

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

SetID sets the "id" field.

func (*CardCreate) SetIsActive

func (cc *CardCreate) SetIsActive(b bool) *CardCreate

SetIsActive sets the "is_active" field.

func (*CardCreate) SetLastDigits

func (cc *CardCreate) SetLastDigits(u uint16) *CardCreate

SetLastDigits sets the "last_digits" field.

func (*CardCreate) SetNillableBankName

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

SetNillableBankName sets the "bank_name" field if the given value is not nil.

func (*CardCreate) SetNillableFinancialAccountID

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

SetNillableFinancialAccountID sets the "financial_account_id" field if the given value is not nil.

func (*CardCreate) SetNillableLastDigits

func (cc *CardCreate) SetNillableLastDigits(u *uint16) *CardCreate

SetNillableLastDigits sets the "last_digits" field if the given value is not nil.

func (*CardCreate) SetUpdatedAt

func (cc *CardCreate) SetUpdatedAt(t time.Time) *CardCreate

SetUpdatedAt sets the "updated_at" field.

func (*CardCreate) SetUser

func (cc *CardCreate) SetUser(u *User) *CardCreate

SetUser sets the "user" edge to the User entity.

func (*CardCreate) SetUserID

func (cc *CardCreate) SetUserID(id string) *CardCreate

SetUserID sets the "user" edge to the User entity by ID.

func (*CardCreate) SetVersion

func (cc *CardCreate) SetVersion(u uint32) *CardCreate

SetVersion sets the "version" field.

type CardCreateBulk

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

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

func (*CardCreateBulk) Exec

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

Exec executes the query.

func (*CardCreateBulk) ExecX

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

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

func (*CardCreateBulk) OnConflict

func (ccb *CardCreateBulk) OnConflict(opts ...sql.ConflictOption) *CardUpsertBulk

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

client.Card.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.CardUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*CardCreateBulk) OnConflictColumns

func (ccb *CardCreateBulk) OnConflictColumns(columns ...string) *CardUpsertBulk

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

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

func (*CardCreateBulk) Save

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

Save creates the Card entities in the database.

func (*CardCreateBulk) SaveX

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

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

type CardDelete

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

CardDelete is the builder for deleting a Card entity.

func (*CardDelete) Exec

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

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

func (*CardDelete) ExecX

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

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

func (*CardDelete) Where

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

Where appends a list predicates to the CardDelete builder.

type CardDeleteOne

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

CardDeleteOne is the builder for deleting a single Card entity.

func (*CardDeleteOne) Exec

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

Exec executes the deletion query.

func (*CardDeleteOne) ExecX

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

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

type CardEdges

type CardEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// FinancialAccount holds the value of the financial_account edge.
	FinancialAccount *FinancialAccount `json:"financial_account,omitempty"`
	// contains filtered or unexported fields
}

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

func (CardEdges) FinancialAccountOrErr

func (e CardEdges) FinancialAccountOrErr() (*FinancialAccount, error)

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

func (CardEdges) UserOrErr

func (e CardEdges) UserOrErr() (*User, error)

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

type CardGroupBy

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

CardGroupBy is the group-by builder for Card entities.

func (*CardGroupBy) Aggregate

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

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

func (*CardGroupBy) Bool

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

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

func (*CardGroupBy) BoolX

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

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

func (*CardGroupBy) Bools

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

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

func (*CardGroupBy) BoolsX

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

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

func (*CardGroupBy) Float64

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

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

func (*CardGroupBy) Float64X

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

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

func (*CardGroupBy) Float64s

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

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

func (*CardGroupBy) Float64sX

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

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

func (*CardGroupBy) Int

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

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

func (*CardGroupBy) IntX

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

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

func (*CardGroupBy) Ints

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

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

func (*CardGroupBy) IntsX

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

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

func (*CardGroupBy) Scan

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

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

func (*CardGroupBy) ScanX

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

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

func (*CardGroupBy) String

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

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

func (*CardGroupBy) StringX

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

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

func (*CardGroupBy) Strings

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

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

func (*CardGroupBy) StringsX

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

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

type CardMutation

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

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

func (*CardMutation) AddBalance

func (m *CardMutation) AddBalance(f float64)

AddBalance adds f to the "balance" field.

func (*CardMutation) AddBalanceLimit

func (m *CardMutation) AddBalanceLimit(f float64)

AddBalanceLimit adds f to the "balance_limit" field.

func (*CardMutation) AddField

func (m *CardMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CardMutation) AddLastDigits

func (m *CardMutation) AddLastDigits(u int16)

AddLastDigits adds u to the "last_digits" field.

func (*CardMutation) AddVersion

func (m *CardMutation) AddVersion(u int32)

AddVersion adds u to the "version" field.

func (*CardMutation) AddedBalance

func (m *CardMutation) AddedBalance() (r float64, exists bool)

AddedBalance returns the value that was added to the "balance" field in this mutation.

func (*CardMutation) AddedBalanceLimit

func (m *CardMutation) AddedBalanceLimit() (r float64, exists bool)

AddedBalanceLimit returns the value that was added to the "balance_limit" field in this mutation.

func (*CardMutation) AddedEdges

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

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

func (*CardMutation) AddedField

func (m *CardMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CardMutation) AddedFields

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

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

func (*CardMutation) AddedIDs

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

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

func (*CardMutation) AddedLastDigits

func (m *CardMutation) AddedLastDigits() (r int16, exists bool)

AddedLastDigits returns the value that was added to the "last_digits" field in this mutation.

func (*CardMutation) AddedVersion

func (m *CardMutation) AddedVersion() (r int32, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*CardMutation) Balance

func (m *CardMutation) Balance() (r float64, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*CardMutation) BalanceLimit

func (m *CardMutation) BalanceLimit() (r float64, exists bool)

BalanceLimit returns the value of the "balance_limit" field in the mutation.

func (*CardMutation) BankName

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

BankName returns the value of the "bank_name" field in the mutation.

func (*CardMutation) BankNameCleared

func (m *CardMutation) BankNameCleared() bool

BankNameCleared returns if the "bank_name" field was cleared in this mutation.

func (*CardMutation) CardType

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

CardType returns the value of the "card_type" field in the mutation.

func (*CardMutation) ClearBankName

func (m *CardMutation) ClearBankName()

ClearBankName clears the value of the "bank_name" field.

func (*CardMutation) ClearEdge

func (m *CardMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*CardMutation) ClearField

func (m *CardMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*CardMutation) ClearFinancialAccount

func (m *CardMutation) ClearFinancialAccount()

ClearFinancialAccount clears the "financial_account" edge to the FinancialAccount entity.

func (*CardMutation) ClearFinancialAccountID

func (m *CardMutation) ClearFinancialAccountID()

ClearFinancialAccountID clears the value of the "financial_account_id" field.

func (*CardMutation) ClearLastDigits

func (m *CardMutation) ClearLastDigits()

ClearLastDigits clears the value of the "last_digits" field.

func (*CardMutation) ClearUser

func (m *CardMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*CardMutation) ClearedEdges

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

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

func (*CardMutation) ClearedFields

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

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

func (CardMutation) Client

func (m CardMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CardMutation) CreatedAt

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

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

func (*CardMutation) CurrencyCode

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

CurrencyCode returns the value of the "currency_code" field in the mutation.

func (*CardMutation) DisplayName

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

DisplayName returns the value of the "display_name" field in the mutation.

func (*CardMutation) EdgeCleared

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

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

func (*CardMutation) Field

func (m *CardMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CardMutation) FieldCleared

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

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

func (*CardMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*CardMutation) FinancialAccountCleared

func (m *CardMutation) FinancialAccountCleared() bool

FinancialAccountCleared reports if the "financial_account" edge to the FinancialAccount entity was cleared.

func (*CardMutation) FinancialAccountID

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

FinancialAccountID returns the value of the "financial_account_id" field in the mutation.

func (*CardMutation) FinancialAccountIDCleared

func (m *CardMutation) FinancialAccountIDCleared() bool

FinancialAccountIDCleared returns if the "financial_account_id" field was cleared in this mutation.

func (*CardMutation) FinancialAccountIDs

func (m *CardMutation) FinancialAccountIDs() (ids []string)

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

func (*CardMutation) ID

func (m *CardMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CardMutation) IDs

func (m *CardMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CardMutation) IsActive

func (m *CardMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*CardMutation) LastDigits

func (m *CardMutation) LastDigits() (r uint16, exists bool)

LastDigits returns the value of the "last_digits" field in the mutation.

func (*CardMutation) LastDigitsCleared

func (m *CardMutation) LastDigitsCleared() bool

LastDigitsCleared returns if the "last_digits" field was cleared in this mutation.

func (*CardMutation) OldBalance

func (m *CardMutation) OldBalance(ctx context.Context) (v float64, err error)

OldBalance returns the old "balance" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldBalanceLimit

func (m *CardMutation) OldBalanceLimit(ctx context.Context) (v float64, err error)

OldBalanceLimit returns the old "balance_limit" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldBankName

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

OldBankName returns the old "bank_name" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldCardType

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

OldCardType returns the old "card_type" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldCurrencyCode

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

OldCurrencyCode returns the old "currency_code" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldDisplayName

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

OldDisplayName returns the old "display_name" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldField

func (m *CardMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*CardMutation) OldFinancialAccountID

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

OldFinancialAccountID returns the old "financial_account_id" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldIsActive

func (m *CardMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldLastDigits

func (m *CardMutation) OldLastDigits(ctx context.Context) (v uint16, err error)

OldLastDigits returns the old "last_digits" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) OldVersion

func (m *CardMutation) OldVersion(ctx context.Context) (v uint32, err error)

OldVersion returns the old "version" field's value of the Card entity. If the Card object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CardMutation) Op

func (m *CardMutation) Op() Op

Op returns the operation name.

func (*CardMutation) RemovedEdges

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

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

func (*CardMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*CardMutation) ResetBalance

func (m *CardMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*CardMutation) ResetBalanceLimit

func (m *CardMutation) ResetBalanceLimit()

ResetBalanceLimit resets all changes to the "balance_limit" field.

func (*CardMutation) ResetBankName

func (m *CardMutation) ResetBankName()

ResetBankName resets all changes to the "bank_name" field.

func (*CardMutation) ResetCardType

func (m *CardMutation) ResetCardType()

ResetCardType resets all changes to the "card_type" field.

func (*CardMutation) ResetCreatedAt

func (m *CardMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CardMutation) ResetCurrencyCode

func (m *CardMutation) ResetCurrencyCode()

ResetCurrencyCode resets all changes to the "currency_code" field.

func (*CardMutation) ResetDisplayName

func (m *CardMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*CardMutation) ResetEdge

func (m *CardMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*CardMutation) ResetField

func (m *CardMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*CardMutation) ResetFinancialAccount

func (m *CardMutation) ResetFinancialAccount()

ResetFinancialAccount resets all changes to the "financial_account" edge.

func (*CardMutation) ResetFinancialAccountID

func (m *CardMutation) ResetFinancialAccountID()

ResetFinancialAccountID resets all changes to the "financial_account_id" field.

func (*CardMutation) ResetIsActive

func (m *CardMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*CardMutation) ResetLastDigits

func (m *CardMutation) ResetLastDigits()

ResetLastDigits resets all changes to the "last_digits" field.

func (*CardMutation) ResetUpdatedAt

func (m *CardMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CardMutation) ResetUser

func (m *CardMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*CardMutation) ResetVersion

func (m *CardMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*CardMutation) SetBalance

func (m *CardMutation) SetBalance(f float64)

SetBalance sets the "balance" field.

func (*CardMutation) SetBalanceLimit

func (m *CardMutation) SetBalanceLimit(f float64)

SetBalanceLimit sets the "balance_limit" field.

func (*CardMutation) SetBankName

func (m *CardMutation) SetBankName(s string)

SetBankName sets the "bank_name" field.

func (*CardMutation) SetCardType

func (m *CardMutation) SetCardType(s string)

SetCardType sets the "card_type" field.

func (*CardMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CardMutation) SetCurrencyCode

func (m *CardMutation) SetCurrencyCode(s string)

SetCurrencyCode sets the "currency_code" field.

func (*CardMutation) SetDisplayName

func (m *CardMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*CardMutation) SetField

func (m *CardMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CardMutation) SetFinancialAccountID

func (m *CardMutation) SetFinancialAccountID(s string)

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardMutation) SetID

func (m *CardMutation) SetID(id string)

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

func (*CardMutation) SetIsActive

func (m *CardMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*CardMutation) SetLastDigits

func (m *CardMutation) SetLastDigits(u uint16)

SetLastDigits sets the "last_digits" field.

func (*CardMutation) SetOp

func (m *CardMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CardMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CardMutation) SetUserID

func (m *CardMutation) SetUserID(id string)

SetUserID sets the "user" edge to the User entity by id.

func (*CardMutation) SetVersion

func (m *CardMutation) SetVersion(u uint32)

SetVersion sets the "version" field.

func (CardMutation) Tx

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

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

func (*CardMutation) Type

func (m *CardMutation) Type() string

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

func (*CardMutation) UpdatedAt

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

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

func (*CardMutation) UserCleared

func (m *CardMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*CardMutation) UserID

func (m *CardMutation) UserID() (id string, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*CardMutation) UserIDs

func (m *CardMutation) UserIDs() (ids []string)

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

func (*CardMutation) Version

func (m *CardMutation) Version() (r uint32, exists bool)

Version returns the value of the "version" field in the mutation.

func (*CardMutation) Where

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

Where appends a list predicates to the CardMutation builder.

func (*CardMutation) WhereP

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

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

type CardQuery

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

CardQuery is the builder for querying Card entities.

func (*CardQuery) Aggregate

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

Aggregate returns a CardSelect configured with the given aggregations.

func (*CardQuery) All

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

All executes the query and returns a list of Cards.

func (*CardQuery) AllX

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

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

func (*CardQuery) Clone

func (cq *CardQuery) Clone() *CardQuery

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

func (*CardQuery) Count

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

Count returns the count of the given query.

func (*CardQuery) CountX

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

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

func (*CardQuery) Exist

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

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

func (*CardQuery) ExistX

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

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

func (*CardQuery) First

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

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

func (*CardQuery) FirstID

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

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

func (*CardQuery) FirstIDX

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

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

func (*CardQuery) FirstX

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

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

func (*CardQuery) GroupBy

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

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

Example:

var v []struct {
	IsActive bool `json:"is_active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Card.Query().
	GroupBy(card.FieldIsActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CardQuery) IDs

func (cq *CardQuery) IDs(ctx context.Context) ([]string, error)

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

func (*CardQuery) IDsX

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

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

func (*CardQuery) Limit

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

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

func (*CardQuery) Offset

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

Offset to start from.

func (*CardQuery) Only

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

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

func (*CardQuery) OnlyID

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

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

func (*CardQuery) OnlyIDX

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

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

func (*CardQuery) OnlyX

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

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

func (*CardQuery) Order

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

Order specifies how the records should be ordered.

func (*CardQuery) QueryFinancialAccount

func (cq *CardQuery) QueryFinancialAccount() *FinancialAccountQuery

QueryFinancialAccount chains the current query on the "financial_account" edge.

func (*CardQuery) QueryUser

func (cq *CardQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*CardQuery) Select

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

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

Example:

var v []struct {
	IsActive bool `json:"is_active,omitempty"`
}

client.Card.Query().
	Select(card.FieldIsActive).
	Scan(ctx, &v)

func (*CardQuery) Unique

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

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*CardQuery) Where

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

Where adds a new predicate for the CardQuery builder.

func (*CardQuery) WithFinancialAccount

func (cq *CardQuery) WithFinancialAccount(opts ...func(*FinancialAccountQuery)) *CardQuery

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

func (*CardQuery) WithUser

func (cq *CardQuery) WithUser(opts ...func(*UserQuery)) *CardQuery

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

type CardSelect

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

CardSelect is the builder for selecting fields of Card entities.

func (*CardSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CardSelect) Bool

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

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

func (*CardSelect) BoolX

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

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

func (*CardSelect) Bools

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

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

func (*CardSelect) BoolsX

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

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

func (*CardSelect) Float64

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

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

func (*CardSelect) Float64X

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

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

func (*CardSelect) Float64s

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

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

func (*CardSelect) Float64sX

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

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

func (*CardSelect) Int

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

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

func (*CardSelect) IntX

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

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

func (*CardSelect) Ints

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

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

func (*CardSelect) IntsX

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

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

func (*CardSelect) Scan

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

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

func (*CardSelect) ScanX

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

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

func (*CardSelect) String

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

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

func (*CardSelect) StringX

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

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

func (*CardSelect) Strings

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

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

func (*CardSelect) StringsX

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

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

type CardUpdate

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

CardUpdate is the builder for updating Card entities.

func (*CardUpdate) AddBalance

func (cu *CardUpdate) AddBalance(f float64) *CardUpdate

AddBalance adds f to the "balance" field.

func (*CardUpdate) AddBalanceLimit

func (cu *CardUpdate) AddBalanceLimit(f float64) *CardUpdate

AddBalanceLimit adds f to the "balance_limit" field.

func (*CardUpdate) AddLastDigits

func (cu *CardUpdate) AddLastDigits(u int16) *CardUpdate

AddLastDigits adds u to the "last_digits" field.

func (*CardUpdate) AddVersion

func (cu *CardUpdate) AddVersion(u int32) *CardUpdate

AddVersion adds u to the "version" field.

func (*CardUpdate) ClearBankName

func (cu *CardUpdate) ClearBankName() *CardUpdate

ClearBankName clears the value of the "bank_name" field.

func (*CardUpdate) ClearFinancialAccount

func (cu *CardUpdate) ClearFinancialAccount() *CardUpdate

ClearFinancialAccount clears the "financial_account" edge to the FinancialAccount entity.

func (*CardUpdate) ClearFinancialAccountID

func (cu *CardUpdate) ClearFinancialAccountID() *CardUpdate

ClearFinancialAccountID clears the value of the "financial_account_id" field.

func (*CardUpdate) ClearLastDigits

func (cu *CardUpdate) ClearLastDigits() *CardUpdate

ClearLastDigits clears the value of the "last_digits" field.

func (*CardUpdate) Exec

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

Exec executes the query.

func (*CardUpdate) ExecX

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

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

func (*CardUpdate) Mutation

func (cu *CardUpdate) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardUpdate) Save

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

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

func (*CardUpdate) SaveX

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

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

func (*CardUpdate) SetBalance

func (cu *CardUpdate) SetBalance(f float64) *CardUpdate

SetBalance sets the "balance" field.

func (*CardUpdate) SetBalanceLimit

func (cu *CardUpdate) SetBalanceLimit(f float64) *CardUpdate

SetBalanceLimit sets the "balance_limit" field.

func (*CardUpdate) SetBankName

func (cu *CardUpdate) SetBankName(s string) *CardUpdate

SetBankName sets the "bank_name" field.

func (*CardUpdate) SetCardType

func (cu *CardUpdate) SetCardType(s string) *CardUpdate

SetCardType sets the "card_type" field.

func (*CardUpdate) SetCurrencyCode

func (cu *CardUpdate) SetCurrencyCode(s string) *CardUpdate

SetCurrencyCode sets the "currency_code" field.

func (*CardUpdate) SetDisplayName

func (cu *CardUpdate) SetDisplayName(s string) *CardUpdate

SetDisplayName sets the "display_name" field.

func (*CardUpdate) SetFinancialAccount

func (cu *CardUpdate) SetFinancialAccount(f *FinancialAccount) *CardUpdate

SetFinancialAccount sets the "financial_account" edge to the FinancialAccount entity.

func (*CardUpdate) SetFinancialAccountID

func (cu *CardUpdate) SetFinancialAccountID(s string) *CardUpdate

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardUpdate) SetIsActive

func (cu *CardUpdate) SetIsActive(b bool) *CardUpdate

SetIsActive sets the "is_active" field.

func (*CardUpdate) SetLastDigits

func (cu *CardUpdate) SetLastDigits(u uint16) *CardUpdate

SetLastDigits sets the "last_digits" field.

func (*CardUpdate) SetNillableBankName

func (cu *CardUpdate) SetNillableBankName(s *string) *CardUpdate

SetNillableBankName sets the "bank_name" field if the given value is not nil.

func (*CardUpdate) SetNillableFinancialAccountID

func (cu *CardUpdate) SetNillableFinancialAccountID(s *string) *CardUpdate

SetNillableFinancialAccountID sets the "financial_account_id" field if the given value is not nil.

func (*CardUpdate) SetNillableLastDigits

func (cu *CardUpdate) SetNillableLastDigits(u *uint16) *CardUpdate

SetNillableLastDigits sets the "last_digits" field if the given value is not nil.

func (*CardUpdate) SetUpdatedAt

func (cu *CardUpdate) SetUpdatedAt(t time.Time) *CardUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CardUpdate) SetVersion

func (cu *CardUpdate) SetVersion(u uint32) *CardUpdate

SetVersion sets the "version" field.

func (*CardUpdate) Where

func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate

Where appends a list predicates to the CardUpdate builder.

type CardUpdateOne

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

CardUpdateOne is the builder for updating a single Card entity.

func (*CardUpdateOne) AddBalance

func (cuo *CardUpdateOne) AddBalance(f float64) *CardUpdateOne

AddBalance adds f to the "balance" field.

func (*CardUpdateOne) AddBalanceLimit

func (cuo *CardUpdateOne) AddBalanceLimit(f float64) *CardUpdateOne

AddBalanceLimit adds f to the "balance_limit" field.

func (*CardUpdateOne) AddLastDigits

func (cuo *CardUpdateOne) AddLastDigits(u int16) *CardUpdateOne

AddLastDigits adds u to the "last_digits" field.

func (*CardUpdateOne) AddVersion

func (cuo *CardUpdateOne) AddVersion(u int32) *CardUpdateOne

AddVersion adds u to the "version" field.

func (*CardUpdateOne) ClearBankName

func (cuo *CardUpdateOne) ClearBankName() *CardUpdateOne

ClearBankName clears the value of the "bank_name" field.

func (*CardUpdateOne) ClearFinancialAccount

func (cuo *CardUpdateOne) ClearFinancialAccount() *CardUpdateOne

ClearFinancialAccount clears the "financial_account" edge to the FinancialAccount entity.

func (*CardUpdateOne) ClearFinancialAccountID

func (cuo *CardUpdateOne) ClearFinancialAccountID() *CardUpdateOne

ClearFinancialAccountID clears the value of the "financial_account_id" field.

func (*CardUpdateOne) ClearLastDigits

func (cuo *CardUpdateOne) ClearLastDigits() *CardUpdateOne

ClearLastDigits clears the value of the "last_digits" field.

func (*CardUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CardUpdateOne) ExecX

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

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

func (*CardUpdateOne) Mutation

func (cuo *CardUpdateOne) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardUpdateOne) Save

func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)

Save executes the query and returns the updated Card entity.

func (*CardUpdateOne) SaveX

func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card

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

func (*CardUpdateOne) Select

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

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

func (*CardUpdateOne) SetBalance

func (cuo *CardUpdateOne) SetBalance(f float64) *CardUpdateOne

SetBalance sets the "balance" field.

func (*CardUpdateOne) SetBalanceLimit

func (cuo *CardUpdateOne) SetBalanceLimit(f float64) *CardUpdateOne

SetBalanceLimit sets the "balance_limit" field.

func (*CardUpdateOne) SetBankName

func (cuo *CardUpdateOne) SetBankName(s string) *CardUpdateOne

SetBankName sets the "bank_name" field.

func (*CardUpdateOne) SetCardType

func (cuo *CardUpdateOne) SetCardType(s string) *CardUpdateOne

SetCardType sets the "card_type" field.

func (*CardUpdateOne) SetCurrencyCode

func (cuo *CardUpdateOne) SetCurrencyCode(s string) *CardUpdateOne

SetCurrencyCode sets the "currency_code" field.

func (*CardUpdateOne) SetDisplayName

func (cuo *CardUpdateOne) SetDisplayName(s string) *CardUpdateOne

SetDisplayName sets the "display_name" field.

func (*CardUpdateOne) SetFinancialAccount

func (cuo *CardUpdateOne) SetFinancialAccount(f *FinancialAccount) *CardUpdateOne

SetFinancialAccount sets the "financial_account" edge to the FinancialAccount entity.

func (*CardUpdateOne) SetFinancialAccountID

func (cuo *CardUpdateOne) SetFinancialAccountID(s string) *CardUpdateOne

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardUpdateOne) SetIsActive

func (cuo *CardUpdateOne) SetIsActive(b bool) *CardUpdateOne

SetIsActive sets the "is_active" field.

func (*CardUpdateOne) SetLastDigits

func (cuo *CardUpdateOne) SetLastDigits(u uint16) *CardUpdateOne

SetLastDigits sets the "last_digits" field.

func (*CardUpdateOne) SetNillableBankName

func (cuo *CardUpdateOne) SetNillableBankName(s *string) *CardUpdateOne

SetNillableBankName sets the "bank_name" field if the given value is not nil.

func (*CardUpdateOne) SetNillableFinancialAccountID

func (cuo *CardUpdateOne) SetNillableFinancialAccountID(s *string) *CardUpdateOne

SetNillableFinancialAccountID sets the "financial_account_id" field if the given value is not nil.

func (*CardUpdateOne) SetNillableLastDigits

func (cuo *CardUpdateOne) SetNillableLastDigits(u *uint16) *CardUpdateOne

SetNillableLastDigits sets the "last_digits" field if the given value is not nil.

func (*CardUpdateOne) SetUpdatedAt

func (cuo *CardUpdateOne) SetUpdatedAt(t time.Time) *CardUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CardUpdateOne) SetVersion

func (cuo *CardUpdateOne) SetVersion(u uint32) *CardUpdateOne

SetVersion sets the "version" field.

type CardUpsert

type CardUpsert struct {
	*sql.UpdateSet
}

CardUpsert is the "OnConflict" setter.

func (*CardUpsert) AddBalance

func (u *CardUpsert) AddBalance(v float64) *CardUpsert

AddBalance adds v to the "balance" field.

func (*CardUpsert) AddBalanceLimit

func (u *CardUpsert) AddBalanceLimit(v float64) *CardUpsert

AddBalanceLimit adds v to the "balance_limit" field.

func (*CardUpsert) AddLastDigits

func (u *CardUpsert) AddLastDigits(v uint16) *CardUpsert

AddLastDigits adds v to the "last_digits" field.

func (*CardUpsert) AddVersion

func (u *CardUpsert) AddVersion(v uint32) *CardUpsert

AddVersion adds v to the "version" field.

func (*CardUpsert) ClearBankName

func (u *CardUpsert) ClearBankName() *CardUpsert

ClearBankName clears the value of the "bank_name" field.

func (*CardUpsert) ClearFinancialAccountID

func (u *CardUpsert) ClearFinancialAccountID() *CardUpsert

ClearFinancialAccountID clears the value of the "financial_account_id" field.

func (*CardUpsert) ClearLastDigits

func (u *CardUpsert) ClearLastDigits() *CardUpsert

ClearLastDigits clears the value of the "last_digits" field.

func (*CardUpsert) SetBalance

func (u *CardUpsert) SetBalance(v float64) *CardUpsert

SetBalance sets the "balance" field.

func (*CardUpsert) SetBalanceLimit

func (u *CardUpsert) SetBalanceLimit(v float64) *CardUpsert

SetBalanceLimit sets the "balance_limit" field.

func (*CardUpsert) SetBankName

func (u *CardUpsert) SetBankName(v string) *CardUpsert

SetBankName sets the "bank_name" field.

func (*CardUpsert) SetCardType

func (u *CardUpsert) SetCardType(v string) *CardUpsert

SetCardType sets the "card_type" field.

func (*CardUpsert) SetCurrencyCode

func (u *CardUpsert) SetCurrencyCode(v string) *CardUpsert

SetCurrencyCode sets the "currency_code" field.

func (*CardUpsert) SetDisplayName

func (u *CardUpsert) SetDisplayName(v string) *CardUpsert

SetDisplayName sets the "display_name" field.

func (*CardUpsert) SetFinancialAccountID

func (u *CardUpsert) SetFinancialAccountID(v string) *CardUpsert

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardUpsert) SetIsActive

func (u *CardUpsert) SetIsActive(v bool) *CardUpsert

SetIsActive sets the "is_active" field.

func (*CardUpsert) SetLastDigits

func (u *CardUpsert) SetLastDigits(v uint16) *CardUpsert

SetLastDigits sets the "last_digits" field.

func (*CardUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CardUpsert) SetVersion

func (u *CardUpsert) SetVersion(v uint32) *CardUpsert

SetVersion sets the "version" field.

func (*CardUpsert) UpdateBalance

func (u *CardUpsert) UpdateBalance() *CardUpsert

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

func (*CardUpsert) UpdateBalanceLimit

func (u *CardUpsert) UpdateBalanceLimit() *CardUpsert

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

func (*CardUpsert) UpdateBankName

func (u *CardUpsert) UpdateBankName() *CardUpsert

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

func (*CardUpsert) UpdateCardType

func (u *CardUpsert) UpdateCardType() *CardUpsert

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

func (*CardUpsert) UpdateCurrencyCode

func (u *CardUpsert) UpdateCurrencyCode() *CardUpsert

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

func (*CardUpsert) UpdateDisplayName

func (u *CardUpsert) UpdateDisplayName() *CardUpsert

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

func (*CardUpsert) UpdateFinancialAccountID

func (u *CardUpsert) UpdateFinancialAccountID() *CardUpsert

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

func (*CardUpsert) UpdateIsActive

func (u *CardUpsert) UpdateIsActive() *CardUpsert

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

func (*CardUpsert) UpdateLastDigits

func (u *CardUpsert) UpdateLastDigits() *CardUpsert

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

func (*CardUpsert) UpdateUpdatedAt

func (u *CardUpsert) UpdateUpdatedAt() *CardUpsert

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

func (*CardUpsert) UpdateVersion

func (u *CardUpsert) UpdateVersion() *CardUpsert

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

type CardUpsertBulk

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

CardUpsertBulk is the builder for "upsert"-ing a bulk of Card nodes.

func (*CardUpsertBulk) AddBalance

func (u *CardUpsertBulk) AddBalance(v float64) *CardUpsertBulk

AddBalance adds v to the "balance" field.

func (*CardUpsertBulk) AddBalanceLimit

func (u *CardUpsertBulk) AddBalanceLimit(v float64) *CardUpsertBulk

AddBalanceLimit adds v to the "balance_limit" field.

func (*CardUpsertBulk) AddLastDigits

func (u *CardUpsertBulk) AddLastDigits(v uint16) *CardUpsertBulk

AddLastDigits adds v to the "last_digits" field.

func (*CardUpsertBulk) AddVersion

func (u *CardUpsertBulk) AddVersion(v uint32) *CardUpsertBulk

AddVersion adds v to the "version" field.

func (*CardUpsertBulk) ClearBankName

func (u *CardUpsertBulk) ClearBankName() *CardUpsertBulk

ClearBankName clears the value of the "bank_name" field.

func (*CardUpsertBulk) ClearFinancialAccountID

func (u *CardUpsertBulk) ClearFinancialAccountID() *CardUpsertBulk

ClearFinancialAccountID clears the value of the "financial_account_id" field.

func (*CardUpsertBulk) ClearLastDigits

func (u *CardUpsertBulk) ClearLastDigits() *CardUpsertBulk

ClearLastDigits clears the value of the "last_digits" field.

func (*CardUpsertBulk) DoNothing

func (u *CardUpsertBulk) DoNothing() *CardUpsertBulk

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

func (*CardUpsertBulk) Exec

func (u *CardUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CardUpsertBulk) ExecX

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

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

func (*CardUpsertBulk) Ignore

func (u *CardUpsertBulk) Ignore() *CardUpsertBulk

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

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

func (*CardUpsertBulk) SetBalance

func (u *CardUpsertBulk) SetBalance(v float64) *CardUpsertBulk

SetBalance sets the "balance" field.

func (*CardUpsertBulk) SetBalanceLimit

func (u *CardUpsertBulk) SetBalanceLimit(v float64) *CardUpsertBulk

SetBalanceLimit sets the "balance_limit" field.

func (*CardUpsertBulk) SetBankName

func (u *CardUpsertBulk) SetBankName(v string) *CardUpsertBulk

SetBankName sets the "bank_name" field.

func (*CardUpsertBulk) SetCardType

func (u *CardUpsertBulk) SetCardType(v string) *CardUpsertBulk

SetCardType sets the "card_type" field.

func (*CardUpsertBulk) SetCurrencyCode

func (u *CardUpsertBulk) SetCurrencyCode(v string) *CardUpsertBulk

SetCurrencyCode sets the "currency_code" field.

func (*CardUpsertBulk) SetDisplayName

func (u *CardUpsertBulk) SetDisplayName(v string) *CardUpsertBulk

SetDisplayName sets the "display_name" field.

func (*CardUpsertBulk) SetFinancialAccountID

func (u *CardUpsertBulk) SetFinancialAccountID(v string) *CardUpsertBulk

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardUpsertBulk) SetIsActive

func (u *CardUpsertBulk) SetIsActive(v bool) *CardUpsertBulk

SetIsActive sets the "is_active" field.

func (*CardUpsertBulk) SetLastDigits

func (u *CardUpsertBulk) SetLastDigits(v uint16) *CardUpsertBulk

SetLastDigits sets the "last_digits" field.

func (*CardUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CardUpsertBulk) SetVersion

func (u *CardUpsertBulk) SetVersion(v uint32) *CardUpsertBulk

SetVersion sets the "version" field.

func (*CardUpsertBulk) Update

func (u *CardUpsertBulk) Update(set func(*CardUpsert)) *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateBalance

func (u *CardUpsertBulk) UpdateBalance() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateBalanceLimit

func (u *CardUpsertBulk) UpdateBalanceLimit() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateBankName

func (u *CardUpsertBulk) UpdateBankName() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateCardType

func (u *CardUpsertBulk) UpdateCardType() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateCurrencyCode

func (u *CardUpsertBulk) UpdateCurrencyCode() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateDisplayName

func (u *CardUpsertBulk) UpdateDisplayName() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateFinancialAccountID

func (u *CardUpsertBulk) UpdateFinancialAccountID() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateIsActive

func (u *CardUpsertBulk) UpdateIsActive() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateLastDigits

func (u *CardUpsertBulk) UpdateLastDigits() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateNewValues

func (u *CardUpsertBulk) UpdateNewValues() *CardUpsertBulk

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

client.Card.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(card.FieldID)
		}),
	).
	Exec(ctx)

func (*CardUpsertBulk) UpdateUpdatedAt

func (u *CardUpsertBulk) UpdateUpdatedAt() *CardUpsertBulk

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

func (*CardUpsertBulk) UpdateVersion

func (u *CardUpsertBulk) UpdateVersion() *CardUpsertBulk

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

type CardUpsertOne

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

CardUpsertOne is the builder for "upsert"-ing

one Card node.

func (*CardUpsertOne) AddBalance

func (u *CardUpsertOne) AddBalance(v float64) *CardUpsertOne

AddBalance adds v to the "balance" field.

func (*CardUpsertOne) AddBalanceLimit

func (u *CardUpsertOne) AddBalanceLimit(v float64) *CardUpsertOne

AddBalanceLimit adds v to the "balance_limit" field.

func (*CardUpsertOne) AddLastDigits

func (u *CardUpsertOne) AddLastDigits(v uint16) *CardUpsertOne

AddLastDigits adds v to the "last_digits" field.

func (*CardUpsertOne) AddVersion

func (u *CardUpsertOne) AddVersion(v uint32) *CardUpsertOne

AddVersion adds v to the "version" field.

func (*CardUpsertOne) ClearBankName

func (u *CardUpsertOne) ClearBankName() *CardUpsertOne

ClearBankName clears the value of the "bank_name" field.

func (*CardUpsertOne) ClearFinancialAccountID

func (u *CardUpsertOne) ClearFinancialAccountID() *CardUpsertOne

ClearFinancialAccountID clears the value of the "financial_account_id" field.

func (*CardUpsertOne) ClearLastDigits

func (u *CardUpsertOne) ClearLastDigits() *CardUpsertOne

ClearLastDigits clears the value of the "last_digits" field.

func (*CardUpsertOne) DoNothing

func (u *CardUpsertOne) DoNothing() *CardUpsertOne

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

func (*CardUpsertOne) Exec

func (u *CardUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*CardUpsertOne) ExecX

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

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

func (*CardUpsertOne) ID

func (u *CardUpsertOne) ID(ctx context.Context) (id string, err error)

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

func (*CardUpsertOne) IDX

func (u *CardUpsertOne) IDX(ctx context.Context) string

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

func (*CardUpsertOne) Ignore

func (u *CardUpsertOne) Ignore() *CardUpsertOne

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

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

func (*CardUpsertOne) SetBalance

func (u *CardUpsertOne) SetBalance(v float64) *CardUpsertOne

SetBalance sets the "balance" field.

func (*CardUpsertOne) SetBalanceLimit

func (u *CardUpsertOne) SetBalanceLimit(v float64) *CardUpsertOne

SetBalanceLimit sets the "balance_limit" field.

func (*CardUpsertOne) SetBankName

func (u *CardUpsertOne) SetBankName(v string) *CardUpsertOne

SetBankName sets the "bank_name" field.

func (*CardUpsertOne) SetCardType

func (u *CardUpsertOne) SetCardType(v string) *CardUpsertOne

SetCardType sets the "card_type" field.

func (*CardUpsertOne) SetCurrencyCode

func (u *CardUpsertOne) SetCurrencyCode(v string) *CardUpsertOne

SetCurrencyCode sets the "currency_code" field.

func (*CardUpsertOne) SetDisplayName

func (u *CardUpsertOne) SetDisplayName(v string) *CardUpsertOne

SetDisplayName sets the "display_name" field.

func (*CardUpsertOne) SetFinancialAccountID

func (u *CardUpsertOne) SetFinancialAccountID(v string) *CardUpsertOne

SetFinancialAccountID sets the "financial_account_id" field.

func (*CardUpsertOne) SetIsActive

func (u *CardUpsertOne) SetIsActive(v bool) *CardUpsertOne

SetIsActive sets the "is_active" field.

func (*CardUpsertOne) SetLastDigits

func (u *CardUpsertOne) SetLastDigits(v uint16) *CardUpsertOne

SetLastDigits sets the "last_digits" field.

func (*CardUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CardUpsertOne) SetVersion

func (u *CardUpsertOne) SetVersion(v uint32) *CardUpsertOne

SetVersion sets the "version" field.

func (*CardUpsertOne) Update

func (u *CardUpsertOne) Update(set func(*CardUpsert)) *CardUpsertOne

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

func (*CardUpsertOne) UpdateBalance

func (u *CardUpsertOne) UpdateBalance() *CardUpsertOne

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

func (*CardUpsertOne) UpdateBalanceLimit

func (u *CardUpsertOne) UpdateBalanceLimit() *CardUpsertOne

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

func (*CardUpsertOne) UpdateBankName

func (u *CardUpsertOne) UpdateBankName() *CardUpsertOne

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

func (*CardUpsertOne) UpdateCardType

func (u *CardUpsertOne) UpdateCardType() *CardUpsertOne

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

func (*CardUpsertOne) UpdateCurrencyCode

func (u *CardUpsertOne) UpdateCurrencyCode() *CardUpsertOne

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

func (*CardUpsertOne) UpdateDisplayName

func (u *CardUpsertOne) UpdateDisplayName() *CardUpsertOne

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

func (*CardUpsertOne) UpdateFinancialAccountID

func (u *CardUpsertOne) UpdateFinancialAccountID() *CardUpsertOne

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

func (*CardUpsertOne) UpdateIsActive

func (u *CardUpsertOne) UpdateIsActive() *CardUpsertOne

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

func (*CardUpsertOne) UpdateLastDigits

func (u *CardUpsertOne) UpdateLastDigits() *CardUpsertOne

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

func (*CardUpsertOne) UpdateNewValues

func (u *CardUpsertOne) UpdateNewValues() *CardUpsertOne

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.Card.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(card.FieldID)
		}),
	).
	Exec(ctx)

func (*CardUpsertOne) UpdateUpdatedAt

func (u *CardUpsertOne) UpdateUpdatedAt() *CardUpsertOne

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

func (*CardUpsertOne) UpdateVersion

func (u *CardUpsertOne) UpdateVersion() *CardUpsertOne

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

type Cards

type Cards []*Card

Cards is a parsable slice of Card.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Card is the client for interacting with the Card builders.
	Card *CardClient
	// Contact is the client for interacting with the Contact builders.
	Contact *ContactClient
	// FinancialAccount is the client for interacting with the FinancialAccount builders.
	FinancialAccount *FinancialAccountClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	Card.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Contact

type Contact struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Version holds the value of the "version" field.
	Version uint32 `json:"version,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"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// LinkedToUser holds the value of the "linked_to_user" field.
	LinkedToUser string `json:"linked_to_user,omitempty"`
	// ImageURL holds the value of the "image_url" field.
	ImageURL string `json:"image_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ContactQuery when eager-loading is set.
	Edges ContactEdges `json:"edges"`
	// contains filtered or unexported fields
}

Contact is the model entity for the Contact schema.

func (*Contact) QueryLinkedTo

func (c *Contact) QueryLinkedTo() *UserQuery

QueryLinkedTo queries the "linked_to" edge of the Contact entity.

func (*Contact) QueryOwner

func (c *Contact) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Contact entity.

func (*Contact) String

func (c *Contact) String() string

String implements the fmt.Stringer.

func (*Contact) Unwrap

func (c *Contact) Unwrap() *Contact

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

func (c *Contact) Update() *ContactUpdateOne

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

type ContactClient

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

ContactClient is a client for the Contact schema.

func NewContactClient

func NewContactClient(c config) *ContactClient

NewContactClient returns a client for the Contact from the given config.

func (*ContactClient) Create

func (c *ContactClient) Create() *ContactCreate

Create returns a builder for creating a Contact entity.

func (*ContactClient) CreateBulk

func (c *ContactClient) CreateBulk(builders ...*ContactCreate) *ContactCreateBulk

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

func (*ContactClient) Delete

func (c *ContactClient) Delete() *ContactDelete

Delete returns a delete builder for Contact.

func (*ContactClient) DeleteOne

func (c *ContactClient) DeleteOne(co *Contact) *ContactDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContactClient) DeleteOneID

func (c *ContactClient) DeleteOneID(id string) *ContactDeleteOne

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

func (*ContactClient) Get

func (c *ContactClient) Get(ctx context.Context, id string) (*Contact, error)

Get returns a Contact entity by its id.

func (*ContactClient) GetX

func (c *ContactClient) GetX(ctx context.Context, id string) *Contact

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

func (*ContactClient) Hooks

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

Hooks returns the client hooks.

func (*ContactClient) Intercept

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

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

func (*ContactClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ContactClient) Query

func (c *ContactClient) Query() *ContactQuery

Query returns a query builder for Contact.

func (*ContactClient) QueryLinkedTo

func (c *ContactClient) QueryLinkedTo(co *Contact) *UserQuery

QueryLinkedTo queries the linked_to edge of a Contact.

func (*ContactClient) QueryOwner

func (c *ContactClient) QueryOwner(co *Contact) *UserQuery

QueryOwner queries the owner edge of a Contact.

func (*ContactClient) Update

func (c *ContactClient) Update() *ContactUpdate

Update returns an update builder for Contact.

func (*ContactClient) UpdateOne

func (c *ContactClient) UpdateOne(co *Contact) *ContactUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContactClient) UpdateOneID

func (c *ContactClient) UpdateOneID(id string) *ContactUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ContactClient) Use

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

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

type ContactCreate

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

ContactCreate is the builder for creating a Contact entity.

func (*ContactCreate) Exec

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

Exec executes the query.

func (*ContactCreate) ExecX

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

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

func (*ContactCreate) Mutation

func (cc *ContactCreate) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactCreate) OnConflict

func (cc *ContactCreate) OnConflict(opts ...sql.ConflictOption) *ContactUpsertOne

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

client.Contact.Create().
	SetIsActive(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.ContactUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*ContactCreate) OnConflictColumns

func (cc *ContactCreate) OnConflictColumns(columns ...string) *ContactUpsertOne

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

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

func (*ContactCreate) Save

func (cc *ContactCreate) Save(ctx context.Context) (*Contact, error)

Save creates the Contact in the database.

func (*ContactCreate) SaveX

func (cc *ContactCreate) SaveX(ctx context.Context) *Contact

SaveX calls Save and panics if Save returns an error.

func (*ContactCreate) SetCreatedAt

func (cc *ContactCreate) SetCreatedAt(t time.Time) *ContactCreate

SetCreatedAt sets the "created_at" field.

func (*ContactCreate) SetDisplayName

func (cc *ContactCreate) SetDisplayName(s string) *ContactCreate

SetDisplayName sets the "display_name" field.

func (*ContactCreate) SetID

func (cc *ContactCreate) SetID(s string) *ContactCreate

SetID sets the "id" field.

func (*ContactCreate) SetImageURL

func (cc *ContactCreate) SetImageURL(s string) *ContactCreate

SetImageURL sets the "image_url" field.

func (*ContactCreate) SetIsActive

func (cc *ContactCreate) SetIsActive(b bool) *ContactCreate

SetIsActive sets the "is_active" field.

func (*ContactCreate) SetLinkedTo

func (cc *ContactCreate) SetLinkedTo(u *User) *ContactCreate

SetLinkedTo sets the "linked_to" edge to the User entity.

func (*ContactCreate) SetLinkedToID

func (cc *ContactCreate) SetLinkedToID(id string) *ContactCreate

SetLinkedToID sets the "linked_to" edge to the User entity by ID.

func (*ContactCreate) SetLinkedToUser

func (cc *ContactCreate) SetLinkedToUser(s string) *ContactCreate

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactCreate) SetNillableImageURL

func (cc *ContactCreate) SetNillableImageURL(s *string) *ContactCreate

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*ContactCreate) SetNillableLinkedToID

func (cc *ContactCreate) SetNillableLinkedToID(id *string) *ContactCreate

SetNillableLinkedToID sets the "linked_to" edge to the User entity by ID if the given value is not nil.

func (*ContactCreate) SetNillableLinkedToUser

func (cc *ContactCreate) SetNillableLinkedToUser(s *string) *ContactCreate

SetNillableLinkedToUser sets the "linked_to_user" field if the given value is not nil.

func (*ContactCreate) SetOwner

func (cc *ContactCreate) SetOwner(u *User) *ContactCreate

SetOwner sets the "owner" edge to the User entity.

func (*ContactCreate) SetOwnerID

func (cc *ContactCreate) SetOwnerID(id string) *ContactCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ContactCreate) SetUpdatedAt

func (cc *ContactCreate) SetUpdatedAt(t time.Time) *ContactCreate

SetUpdatedAt sets the "updated_at" field.

func (*ContactCreate) SetVersion

func (cc *ContactCreate) SetVersion(u uint32) *ContactCreate

SetVersion sets the "version" field.

type ContactCreateBulk

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

ContactCreateBulk is the builder for creating many Contact entities in bulk.

func (*ContactCreateBulk) Exec

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

Exec executes the query.

func (*ContactCreateBulk) ExecX

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

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

func (*ContactCreateBulk) OnConflict

func (ccb *ContactCreateBulk) OnConflict(opts ...sql.ConflictOption) *ContactUpsertBulk

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

client.Contact.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.ContactUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*ContactCreateBulk) OnConflictColumns

func (ccb *ContactCreateBulk) OnConflictColumns(columns ...string) *ContactUpsertBulk

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

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

func (*ContactCreateBulk) Save

func (ccb *ContactCreateBulk) Save(ctx context.Context) ([]*Contact, error)

Save creates the Contact entities in the database.

func (*ContactCreateBulk) SaveX

func (ccb *ContactCreateBulk) SaveX(ctx context.Context) []*Contact

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

type ContactDelete

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

ContactDelete is the builder for deleting a Contact entity.

func (*ContactDelete) Exec

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

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

func (*ContactDelete) ExecX

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

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

func (*ContactDelete) Where

func (cd *ContactDelete) Where(ps ...predicate.Contact) *ContactDelete

Where appends a list predicates to the ContactDelete builder.

type ContactDeleteOne

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

ContactDeleteOne is the builder for deleting a single Contact entity.

func (*ContactDeleteOne) Exec

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

Exec executes the deletion query.

func (*ContactDeleteOne) ExecX

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

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

type ContactEdges

type ContactEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// LinkedTo holds the value of the linked_to edge.
	LinkedTo *User `json:"linked_to,omitempty"`
	// contains filtered or unexported fields
}

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

func (ContactEdges) LinkedToOrErr

func (e ContactEdges) LinkedToOrErr() (*User, error)

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

func (ContactEdges) OwnerOrErr

func (e ContactEdges) OwnerOrErr() (*User, error)

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

type ContactGroupBy

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

ContactGroupBy is the group-by builder for Contact entities.

func (*ContactGroupBy) Aggregate

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

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

func (*ContactGroupBy) Bool

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

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

func (*ContactGroupBy) BoolX

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

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

func (*ContactGroupBy) Bools

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

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

func (*ContactGroupBy) BoolsX

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

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

func (*ContactGroupBy) Float64

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

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

func (*ContactGroupBy) Float64X

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

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

func (*ContactGroupBy) Float64s

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

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

func (*ContactGroupBy) Float64sX

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

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

func (*ContactGroupBy) Int

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

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

func (*ContactGroupBy) IntX

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

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

func (*ContactGroupBy) Ints

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

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

func (*ContactGroupBy) IntsX

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

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

func (*ContactGroupBy) Scan

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

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

func (*ContactGroupBy) ScanX

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

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

func (*ContactGroupBy) String

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

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

func (*ContactGroupBy) StringX

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

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

func (*ContactGroupBy) Strings

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

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

func (*ContactGroupBy) StringsX

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

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

type ContactMutation

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

ContactMutation represents an operation that mutates the Contact nodes in the graph.

func (*ContactMutation) AddField

func (m *ContactMutation) 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 (*ContactMutation) AddVersion

func (m *ContactMutation) AddVersion(u int32)

AddVersion adds u to the "version" field.

func (*ContactMutation) AddedEdges

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

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

func (*ContactMutation) AddedField

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

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

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

func (*ContactMutation) AddedIDs

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

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

func (*ContactMutation) AddedVersion

func (m *ContactMutation) AddedVersion() (r int32, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*ContactMutation) ClearEdge

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

func (m *ContactMutation) 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 (*ContactMutation) ClearImageURL

func (m *ContactMutation) ClearImageURL()

ClearImageURL clears the value of the "image_url" field.

func (*ContactMutation) ClearLinkedTo

func (m *ContactMutation) ClearLinkedTo()

ClearLinkedTo clears the "linked_to" edge to the User entity.

func (*ContactMutation) ClearLinkedToUser

func (m *ContactMutation) ClearLinkedToUser()

ClearLinkedToUser clears the value of the "linked_to_user" field.

func (*ContactMutation) ClearOwner

func (m *ContactMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*ContactMutation) ClearedEdges

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

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

func (*ContactMutation) ClearedFields

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

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

func (ContactMutation) Client

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

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

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

func (*ContactMutation) DisplayName

func (m *ContactMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*ContactMutation) EdgeCleared

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

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

func (*ContactMutation) Field

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

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

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

func (*ContactMutation) Fields

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

func (m *ContactMutation) ID() (id string, 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 (*ContactMutation) IDs

func (m *ContactMutation) IDs(ctx context.Context) ([]string, 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 (*ContactMutation) ImageURL

func (m *ContactMutation) ImageURL() (r string, exists bool)

ImageURL returns the value of the "image_url" field in the mutation.

func (*ContactMutation) ImageURLCleared

func (m *ContactMutation) ImageURLCleared() bool

ImageURLCleared returns if the "image_url" field was cleared in this mutation.

func (*ContactMutation) IsActive

func (m *ContactMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*ContactMutation) LinkedToCleared

func (m *ContactMutation) LinkedToCleared() bool

LinkedToCleared reports if the "linked_to" edge to the User entity was cleared.

func (*ContactMutation) LinkedToID

func (m *ContactMutation) LinkedToID() (id string, exists bool)

LinkedToID returns the "linked_to" edge ID in the mutation.

func (*ContactMutation) LinkedToIDs

func (m *ContactMutation) LinkedToIDs() (ids []string)

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

func (*ContactMutation) LinkedToUser

func (m *ContactMutation) LinkedToUser() (r string, exists bool)

LinkedToUser returns the value of the "linked_to_user" field in the mutation.

func (*ContactMutation) LinkedToUserCleared

func (m *ContactMutation) LinkedToUserCleared() bool

LinkedToUserCleared returns if the "linked_to_user" field was cleared in this mutation.

func (*ContactMutation) OldCreatedAt

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

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

func (m *ContactMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldField

func (m *ContactMutation) 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 (*ContactMutation) OldImageURL

func (m *ContactMutation) OldImageURL(ctx context.Context) (v string, err error)

OldImageURL returns the old "image_url" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldIsActive

func (m *ContactMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldLinkedToUser

func (m *ContactMutation) OldLinkedToUser(ctx context.Context) (v string, err error)

OldLinkedToUser returns the old "linked_to_user" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldUpdatedAt

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

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

func (m *ContactMutation) OldVersion(ctx context.Context) (v uint32, err error)

OldVersion returns the old "version" field's value of the Contact entity. If the Contact 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 (*ContactMutation) Op

func (m *ContactMutation) Op() Op

Op returns the operation name.

func (*ContactMutation) OwnerCleared

func (m *ContactMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*ContactMutation) OwnerID

func (m *ContactMutation) OwnerID() (id string, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*ContactMutation) OwnerIDs

func (m *ContactMutation) OwnerIDs() (ids []string)

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

func (*ContactMutation) RemovedEdges

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

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

func (*ContactMutation) RemovedIDs

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

func (m *ContactMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ContactMutation) ResetDisplayName

func (m *ContactMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*ContactMutation) ResetEdge

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

func (m *ContactMutation) 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 (*ContactMutation) ResetImageURL

func (m *ContactMutation) ResetImageURL()

ResetImageURL resets all changes to the "image_url" field.

func (*ContactMutation) ResetIsActive

func (m *ContactMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*ContactMutation) ResetLinkedTo

func (m *ContactMutation) ResetLinkedTo()

ResetLinkedTo resets all changes to the "linked_to" edge.

func (*ContactMutation) ResetLinkedToUser

func (m *ContactMutation) ResetLinkedToUser()

ResetLinkedToUser resets all changes to the "linked_to_user" field.

func (*ContactMutation) ResetOwner

func (m *ContactMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*ContactMutation) ResetUpdatedAt

func (m *ContactMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ContactMutation) ResetVersion

func (m *ContactMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*ContactMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ContactMutation) SetDisplayName

func (m *ContactMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*ContactMutation) SetField

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

func (m *ContactMutation) SetID(id string)

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

func (*ContactMutation) SetImageURL

func (m *ContactMutation) SetImageURL(s string)

SetImageURL sets the "image_url" field.

func (*ContactMutation) SetIsActive

func (m *ContactMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*ContactMutation) SetLinkedToID

func (m *ContactMutation) SetLinkedToID(id string)

SetLinkedToID sets the "linked_to" edge to the User entity by id.

func (*ContactMutation) SetLinkedToUser

func (m *ContactMutation) SetLinkedToUser(s string)

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactMutation) SetOp

func (m *ContactMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ContactMutation) SetOwnerID

func (m *ContactMutation) SetOwnerID(id string)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*ContactMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ContactMutation) SetVersion

func (m *ContactMutation) SetVersion(u uint32)

SetVersion sets the "version" field.

func (ContactMutation) Tx

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

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

func (*ContactMutation) Type

func (m *ContactMutation) Type() string

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

func (*ContactMutation) UpdatedAt

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

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

func (*ContactMutation) Version

func (m *ContactMutation) Version() (r uint32, exists bool)

Version returns the value of the "version" field in the mutation.

func (*ContactMutation) Where

func (m *ContactMutation) Where(ps ...predicate.Contact)

Where appends a list predicates to the ContactMutation builder.

func (*ContactMutation) WhereP

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

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

type ContactQuery

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

ContactQuery is the builder for querying Contact entities.

func (*ContactQuery) Aggregate

func (cq *ContactQuery) Aggregate(fns ...AggregateFunc) *ContactSelect

Aggregate returns a ContactSelect configured with the given aggregations.

func (*ContactQuery) All

func (cq *ContactQuery) All(ctx context.Context) ([]*Contact, error)

All executes the query and returns a list of Contacts.

func (*ContactQuery) AllX

func (cq *ContactQuery) AllX(ctx context.Context) []*Contact

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

func (*ContactQuery) Clone

func (cq *ContactQuery) Clone() *ContactQuery

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

func (*ContactQuery) Count

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

Count returns the count of the given query.

func (*ContactQuery) CountX

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

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

func (*ContactQuery) Exist

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

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

func (*ContactQuery) ExistX

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

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

func (*ContactQuery) First

func (cq *ContactQuery) First(ctx context.Context) (*Contact, error)

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

func (*ContactQuery) FirstID

func (cq *ContactQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*ContactQuery) FirstIDX

func (cq *ContactQuery) FirstIDX(ctx context.Context) string

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

func (*ContactQuery) FirstX

func (cq *ContactQuery) FirstX(ctx context.Context) *Contact

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

func (*ContactQuery) GroupBy

func (cq *ContactQuery) GroupBy(field string, fields ...string) *ContactGroupBy

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 {
	IsActive bool `json:"is_active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Contact.Query().
	GroupBy(contact.FieldIsActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ContactQuery) IDs

func (cq *ContactQuery) IDs(ctx context.Context) ([]string, error)

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

func (*ContactQuery) IDsX

func (cq *ContactQuery) IDsX(ctx context.Context) []string

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

func (*ContactQuery) Limit

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

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

func (*ContactQuery) Offset

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

Offset to start from.

func (*ContactQuery) Only

func (cq *ContactQuery) Only(ctx context.Context) (*Contact, error)

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

func (*ContactQuery) OnlyID

func (cq *ContactQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*ContactQuery) OnlyIDX

func (cq *ContactQuery) OnlyIDX(ctx context.Context) string

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

func (*ContactQuery) OnlyX

func (cq *ContactQuery) OnlyX(ctx context.Context) *Contact

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

func (*ContactQuery) Order

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

Order specifies how the records should be ordered.

func (*ContactQuery) QueryLinkedTo

func (cq *ContactQuery) QueryLinkedTo() *UserQuery

QueryLinkedTo chains the current query on the "linked_to" edge.

func (*ContactQuery) QueryOwner

func (cq *ContactQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*ContactQuery) Select

func (cq *ContactQuery) Select(fields ...string) *ContactSelect

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 {
	IsActive bool `json:"is_active,omitempty"`
}

client.Contact.Query().
	Select(contact.FieldIsActive).
	Scan(ctx, &v)

func (*ContactQuery) Unique

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

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

func (cq *ContactQuery) Where(ps ...predicate.Contact) *ContactQuery

Where adds a new predicate for the ContactQuery builder.

func (*ContactQuery) WithLinkedTo

func (cq *ContactQuery) WithLinkedTo(opts ...func(*UserQuery)) *ContactQuery

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

func (*ContactQuery) WithOwner

func (cq *ContactQuery) WithOwner(opts ...func(*UserQuery)) *ContactQuery

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

type ContactSelect

type ContactSelect struct {
	*ContactQuery
	// contains filtered or unexported fields
}

ContactSelect is the builder for selecting fields of Contact entities.

func (*ContactSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ContactSelect) Bool

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

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

func (*ContactSelect) BoolX

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

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

func (*ContactSelect) Bools

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

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

func (*ContactSelect) BoolsX

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

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

func (*ContactSelect) Float64

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

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

func (*ContactSelect) Float64X

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

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

func (*ContactSelect) Float64s

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

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

func (*ContactSelect) Float64sX

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

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

func (*ContactSelect) Int

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

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

func (*ContactSelect) IntX

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

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

func (*ContactSelect) Ints

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

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

func (*ContactSelect) IntsX

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

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

func (*ContactSelect) Scan

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

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

func (*ContactSelect) ScanX

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

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

func (*ContactSelect) String

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

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

func (*ContactSelect) StringX

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

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

func (*ContactSelect) Strings

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

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

func (*ContactSelect) StringsX

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

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

type ContactUpdate

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

ContactUpdate is the builder for updating Contact entities.

func (*ContactUpdate) AddVersion

func (cu *ContactUpdate) AddVersion(u int32) *ContactUpdate

AddVersion adds u to the "version" field.

func (*ContactUpdate) ClearImageURL

func (cu *ContactUpdate) ClearImageURL() *ContactUpdate

ClearImageURL clears the value of the "image_url" field.

func (*ContactUpdate) ClearLinkedTo

func (cu *ContactUpdate) ClearLinkedTo() *ContactUpdate

ClearLinkedTo clears the "linked_to" edge to the User entity.

func (*ContactUpdate) ClearLinkedToUser

func (cu *ContactUpdate) ClearLinkedToUser() *ContactUpdate

ClearLinkedToUser clears the value of the "linked_to_user" field.

func (*ContactUpdate) Exec

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

Exec executes the query.

func (*ContactUpdate) ExecX

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

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

func (*ContactUpdate) Mutation

func (cu *ContactUpdate) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactUpdate) Save

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

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

func (*ContactUpdate) SaveX

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

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

func (*ContactUpdate) SetDisplayName

func (cu *ContactUpdate) SetDisplayName(s string) *ContactUpdate

SetDisplayName sets the "display_name" field.

func (*ContactUpdate) SetImageURL

func (cu *ContactUpdate) SetImageURL(s string) *ContactUpdate

SetImageURL sets the "image_url" field.

func (*ContactUpdate) SetIsActive

func (cu *ContactUpdate) SetIsActive(b bool) *ContactUpdate

SetIsActive sets the "is_active" field.

func (*ContactUpdate) SetLinkedTo

func (cu *ContactUpdate) SetLinkedTo(u *User) *ContactUpdate

SetLinkedTo sets the "linked_to" edge to the User entity.

func (*ContactUpdate) SetLinkedToID

func (cu *ContactUpdate) SetLinkedToID(id string) *ContactUpdate

SetLinkedToID sets the "linked_to" edge to the User entity by ID.

func (*ContactUpdate) SetLinkedToUser

func (cu *ContactUpdate) SetLinkedToUser(s string) *ContactUpdate

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactUpdate) SetNillableImageURL

func (cu *ContactUpdate) SetNillableImageURL(s *string) *ContactUpdate

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*ContactUpdate) SetNillableLinkedToID

func (cu *ContactUpdate) SetNillableLinkedToID(id *string) *ContactUpdate

SetNillableLinkedToID sets the "linked_to" edge to the User entity by ID if the given value is not nil.

func (*ContactUpdate) SetNillableLinkedToUser

func (cu *ContactUpdate) SetNillableLinkedToUser(s *string) *ContactUpdate

SetNillableLinkedToUser sets the "linked_to_user" field if the given value is not nil.

func (*ContactUpdate) SetUpdatedAt

func (cu *ContactUpdate) SetUpdatedAt(t time.Time) *ContactUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ContactUpdate) SetVersion

func (cu *ContactUpdate) SetVersion(u uint32) *ContactUpdate

SetVersion sets the "version" field.

func (*ContactUpdate) Where

func (cu *ContactUpdate) Where(ps ...predicate.Contact) *ContactUpdate

Where appends a list predicates to the ContactUpdate builder.

type ContactUpdateOne

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

ContactUpdateOne is the builder for updating a single Contact entity.

func (*ContactUpdateOne) AddVersion

func (cuo *ContactUpdateOne) AddVersion(u int32) *ContactUpdateOne

AddVersion adds u to the "version" field.

func (*ContactUpdateOne) ClearImageURL

func (cuo *ContactUpdateOne) ClearImageURL() *ContactUpdateOne

ClearImageURL clears the value of the "image_url" field.

func (*ContactUpdateOne) ClearLinkedTo

func (cuo *ContactUpdateOne) ClearLinkedTo() *ContactUpdateOne

ClearLinkedTo clears the "linked_to" edge to the User entity.

func (*ContactUpdateOne) ClearLinkedToUser

func (cuo *ContactUpdateOne) ClearLinkedToUser() *ContactUpdateOne

ClearLinkedToUser clears the value of the "linked_to_user" field.

func (*ContactUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ContactUpdateOne) ExecX

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

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

func (*ContactUpdateOne) Mutation

func (cuo *ContactUpdateOne) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactUpdateOne) Save

func (cuo *ContactUpdateOne) Save(ctx context.Context) (*Contact, error)

Save executes the query and returns the updated Contact entity.

func (*ContactUpdateOne) SaveX

func (cuo *ContactUpdateOne) SaveX(ctx context.Context) *Contact

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

func (*ContactUpdateOne) Select

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

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

func (*ContactUpdateOne) SetDisplayName

func (cuo *ContactUpdateOne) SetDisplayName(s string) *ContactUpdateOne

SetDisplayName sets the "display_name" field.

func (*ContactUpdateOne) SetImageURL

func (cuo *ContactUpdateOne) SetImageURL(s string) *ContactUpdateOne

SetImageURL sets the "image_url" field.

func (*ContactUpdateOne) SetIsActive

func (cuo *ContactUpdateOne) SetIsActive(b bool) *ContactUpdateOne

SetIsActive sets the "is_active" field.

func (*ContactUpdateOne) SetLinkedTo

func (cuo *ContactUpdateOne) SetLinkedTo(u *User) *ContactUpdateOne

SetLinkedTo sets the "linked_to" edge to the User entity.

func (*ContactUpdateOne) SetLinkedToID

func (cuo *ContactUpdateOne) SetLinkedToID(id string) *ContactUpdateOne

SetLinkedToID sets the "linked_to" edge to the User entity by ID.

func (*ContactUpdateOne) SetLinkedToUser

func (cuo *ContactUpdateOne) SetLinkedToUser(s string) *ContactUpdateOne

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactUpdateOne) SetNillableImageURL

func (cuo *ContactUpdateOne) SetNillableImageURL(s *string) *ContactUpdateOne

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableLinkedToID

func (cuo *ContactUpdateOne) SetNillableLinkedToID(id *string) *ContactUpdateOne

SetNillableLinkedToID sets the "linked_to" edge to the User entity by ID if the given value is not nil.

func (*ContactUpdateOne) SetNillableLinkedToUser

func (cuo *ContactUpdateOne) SetNillableLinkedToUser(s *string) *ContactUpdateOne

SetNillableLinkedToUser sets the "linked_to_user" field if the given value is not nil.

func (*ContactUpdateOne) SetUpdatedAt

func (cuo *ContactUpdateOne) SetUpdatedAt(t time.Time) *ContactUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ContactUpdateOne) SetVersion

func (cuo *ContactUpdateOne) SetVersion(u uint32) *ContactUpdateOne

SetVersion sets the "version" field.

type ContactUpsert

type ContactUpsert struct {
	*sql.UpdateSet
}

ContactUpsert is the "OnConflict" setter.

func (*ContactUpsert) AddVersion

func (u *ContactUpsert) AddVersion(v uint32) *ContactUpsert

AddVersion adds v to the "version" field.

func (*ContactUpsert) ClearImageURL

func (u *ContactUpsert) ClearImageURL() *ContactUpsert

ClearImageURL clears the value of the "image_url" field.

func (*ContactUpsert) ClearLinkedToUser

func (u *ContactUpsert) ClearLinkedToUser() *ContactUpsert

ClearLinkedToUser clears the value of the "linked_to_user" field.

func (*ContactUpsert) SetDisplayName

func (u *ContactUpsert) SetDisplayName(v string) *ContactUpsert

SetDisplayName sets the "display_name" field.

func (*ContactUpsert) SetImageURL

func (u *ContactUpsert) SetImageURL(v string) *ContactUpsert

SetImageURL sets the "image_url" field.

func (*ContactUpsert) SetIsActive

func (u *ContactUpsert) SetIsActive(v bool) *ContactUpsert

SetIsActive sets the "is_active" field.

func (*ContactUpsert) SetLinkedToUser

func (u *ContactUpsert) SetLinkedToUser(v string) *ContactUpsert

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ContactUpsert) SetVersion

func (u *ContactUpsert) SetVersion(v uint32) *ContactUpsert

SetVersion sets the "version" field.

func (*ContactUpsert) UpdateDisplayName

func (u *ContactUpsert) UpdateDisplayName() *ContactUpsert

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

func (*ContactUpsert) UpdateImageURL

func (u *ContactUpsert) UpdateImageURL() *ContactUpsert

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

func (*ContactUpsert) UpdateIsActive

func (u *ContactUpsert) UpdateIsActive() *ContactUpsert

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

func (*ContactUpsert) UpdateLinkedToUser

func (u *ContactUpsert) UpdateLinkedToUser() *ContactUpsert

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

func (*ContactUpsert) UpdateUpdatedAt

func (u *ContactUpsert) UpdateUpdatedAt() *ContactUpsert

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

func (*ContactUpsert) UpdateVersion

func (u *ContactUpsert) UpdateVersion() *ContactUpsert

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

type ContactUpsertBulk

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

ContactUpsertBulk is the builder for "upsert"-ing a bulk of Contact nodes.

func (*ContactUpsertBulk) AddVersion

func (u *ContactUpsertBulk) AddVersion(v uint32) *ContactUpsertBulk

AddVersion adds v to the "version" field.

func (*ContactUpsertBulk) ClearImageURL

func (u *ContactUpsertBulk) ClearImageURL() *ContactUpsertBulk

ClearImageURL clears the value of the "image_url" field.

func (*ContactUpsertBulk) ClearLinkedToUser

func (u *ContactUpsertBulk) ClearLinkedToUser() *ContactUpsertBulk

ClearLinkedToUser clears the value of the "linked_to_user" field.

func (*ContactUpsertBulk) DoNothing

func (u *ContactUpsertBulk) DoNothing() *ContactUpsertBulk

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

func (*ContactUpsertBulk) Exec

func (u *ContactUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactUpsertBulk) ExecX

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

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

func (*ContactUpsertBulk) Ignore

func (u *ContactUpsertBulk) Ignore() *ContactUpsertBulk

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

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

func (*ContactUpsertBulk) SetDisplayName

func (u *ContactUpsertBulk) SetDisplayName(v string) *ContactUpsertBulk

SetDisplayName sets the "display_name" field.

func (*ContactUpsertBulk) SetImageURL

func (u *ContactUpsertBulk) SetImageURL(v string) *ContactUpsertBulk

SetImageURL sets the "image_url" field.

func (*ContactUpsertBulk) SetIsActive

func (u *ContactUpsertBulk) SetIsActive(v bool) *ContactUpsertBulk

SetIsActive sets the "is_active" field.

func (*ContactUpsertBulk) SetLinkedToUser

func (u *ContactUpsertBulk) SetLinkedToUser(v string) *ContactUpsertBulk

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ContactUpsertBulk) SetVersion

func (u *ContactUpsertBulk) SetVersion(v uint32) *ContactUpsertBulk

SetVersion sets the "version" field.

func (*ContactUpsertBulk) Update

func (u *ContactUpsertBulk) Update(set func(*ContactUpsert)) *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateDisplayName

func (u *ContactUpsertBulk) UpdateDisplayName() *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateImageURL

func (u *ContactUpsertBulk) UpdateImageURL() *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateIsActive

func (u *ContactUpsertBulk) UpdateIsActive() *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateLinkedToUser

func (u *ContactUpsertBulk) UpdateLinkedToUser() *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateNewValues

func (u *ContactUpsertBulk) UpdateNewValues() *ContactUpsertBulk

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

client.Contact.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(contact.FieldID)
		}),
	).
	Exec(ctx)

func (*ContactUpsertBulk) UpdateUpdatedAt

func (u *ContactUpsertBulk) UpdateUpdatedAt() *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateVersion

func (u *ContactUpsertBulk) UpdateVersion() *ContactUpsertBulk

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

type ContactUpsertOne

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

ContactUpsertOne is the builder for "upsert"-ing

one Contact node.

func (*ContactUpsertOne) AddVersion

func (u *ContactUpsertOne) AddVersion(v uint32) *ContactUpsertOne

AddVersion adds v to the "version" field.

func (*ContactUpsertOne) ClearImageURL

func (u *ContactUpsertOne) ClearImageURL() *ContactUpsertOne

ClearImageURL clears the value of the "image_url" field.

func (*ContactUpsertOne) ClearLinkedToUser

func (u *ContactUpsertOne) ClearLinkedToUser() *ContactUpsertOne

ClearLinkedToUser clears the value of the "linked_to_user" field.

func (*ContactUpsertOne) DoNothing

func (u *ContactUpsertOne) DoNothing() *ContactUpsertOne

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

func (*ContactUpsertOne) Exec

func (u *ContactUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactUpsertOne) ExecX

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

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

func (*ContactUpsertOne) ID

func (u *ContactUpsertOne) ID(ctx context.Context) (id string, err error)

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

func (*ContactUpsertOne) IDX

func (u *ContactUpsertOne) IDX(ctx context.Context) string

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

func (*ContactUpsertOne) Ignore

func (u *ContactUpsertOne) Ignore() *ContactUpsertOne

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

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

func (*ContactUpsertOne) SetDisplayName

func (u *ContactUpsertOne) SetDisplayName(v string) *ContactUpsertOne

SetDisplayName sets the "display_name" field.

func (*ContactUpsertOne) SetImageURL

func (u *ContactUpsertOne) SetImageURL(v string) *ContactUpsertOne

SetImageURL sets the "image_url" field.

func (*ContactUpsertOne) SetIsActive

func (u *ContactUpsertOne) SetIsActive(v bool) *ContactUpsertOne

SetIsActive sets the "is_active" field.

func (*ContactUpsertOne) SetLinkedToUser

func (u *ContactUpsertOne) SetLinkedToUser(v string) *ContactUpsertOne

SetLinkedToUser sets the "linked_to_user" field.

func (*ContactUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ContactUpsertOne) SetVersion

func (u *ContactUpsertOne) SetVersion(v uint32) *ContactUpsertOne

SetVersion sets the "version" field.

func (*ContactUpsertOne) Update

func (u *ContactUpsertOne) Update(set func(*ContactUpsert)) *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateDisplayName

func (u *ContactUpsertOne) UpdateDisplayName() *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateImageURL

func (u *ContactUpsertOne) UpdateImageURL() *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateIsActive

func (u *ContactUpsertOne) UpdateIsActive() *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateLinkedToUser

func (u *ContactUpsertOne) UpdateLinkedToUser() *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateNewValues

func (u *ContactUpsertOne) UpdateNewValues() *ContactUpsertOne

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.Contact.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(contact.FieldID)
		}),
	).
	Exec(ctx)

func (*ContactUpsertOne) UpdateUpdatedAt

func (u *ContactUpsertOne) UpdateUpdatedAt() *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateVersion

func (u *ContactUpsertOne) UpdateVersion() *ContactUpsertOne

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

type Contacts

type Contacts []*Contact

Contacts is a parsable slice of Contact.

type FinancialAccount

type FinancialAccount struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Version holds the value of the "version" field.
	Version uint32 `json:"version,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"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// BankName holds the value of the "bank_name" field.
	BankName string `json:"bank_name,omitempty"`
	// AccountType holds the value of the "account_type" field.
	AccountType string `json:"account_type,omitempty"`
	// Balance holds the value of the "balance" field.
	Balance float64 `json:"balance,omitempty"`
	// CurrencyCode holds the value of the "currency_code" field.
	CurrencyCode string `json:"currency_code,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FinancialAccountQuery when eager-loading is set.
	Edges FinancialAccountEdges `json:"edges"`
	// contains filtered or unexported fields
}

FinancialAccount is the model entity for the FinancialAccount schema.

func (*FinancialAccount) QueryCards

func (fa *FinancialAccount) QueryCards() *CardQuery

QueryCards queries the "cards" edge of the FinancialAccount entity.

func (*FinancialAccount) QueryOwner

func (fa *FinancialAccount) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the FinancialAccount entity.

func (*FinancialAccount) String

func (fa *FinancialAccount) String() string

String implements the fmt.Stringer.

func (*FinancialAccount) Unwrap

func (fa *FinancialAccount) Unwrap() *FinancialAccount

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

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

type FinancialAccountClient

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

FinancialAccountClient is a client for the FinancialAccount schema.

func NewFinancialAccountClient

func NewFinancialAccountClient(c config) *FinancialAccountClient

NewFinancialAccountClient returns a client for the FinancialAccount from the given config.

func (*FinancialAccountClient) Create

Create returns a builder for creating a FinancialAccount entity.

func (*FinancialAccountClient) CreateBulk

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

func (*FinancialAccountClient) Delete

Delete returns a delete builder for FinancialAccount.

func (*FinancialAccountClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FinancialAccountClient) DeleteOneID

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

func (*FinancialAccountClient) Get

Get returns a FinancialAccount entity by its id.

func (*FinancialAccountClient) GetX

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

func (*FinancialAccountClient) Hooks

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

Hooks returns the client hooks.

func (*FinancialAccountClient) Intercept

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

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

func (*FinancialAccountClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FinancialAccountClient) Query

Query returns a query builder for FinancialAccount.

func (*FinancialAccountClient) QueryCards

QueryCards queries the cards edge of a FinancialAccount.

func (*FinancialAccountClient) QueryOwner

QueryOwner queries the owner edge of a FinancialAccount.

func (*FinancialAccountClient) Update

Update returns an update builder for FinancialAccount.

func (*FinancialAccountClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*FinancialAccountClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*FinancialAccountClient) Use

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

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

type FinancialAccountCreate

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

FinancialAccountCreate is the builder for creating a FinancialAccount entity.

func (*FinancialAccountCreate) AddCardIDs

func (fac *FinancialAccountCreate) AddCardIDs(ids ...string) *FinancialAccountCreate

AddCardIDs adds the "cards" edge to the Card entity by IDs.

func (*FinancialAccountCreate) AddCards

func (fac *FinancialAccountCreate) AddCards(c ...*Card) *FinancialAccountCreate

AddCards adds the "cards" edges to the Card entity.

func (*FinancialAccountCreate) Exec

Exec executes the query.

func (*FinancialAccountCreate) ExecX

func (fac *FinancialAccountCreate) ExecX(ctx context.Context)

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

func (*FinancialAccountCreate) Mutation

Mutation returns the FinancialAccountMutation object of the builder.

func (*FinancialAccountCreate) OnConflict

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

client.FinancialAccount.Create().
	SetIsActive(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.FinancialAccountUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*FinancialAccountCreate) OnConflictColumns

func (fac *FinancialAccountCreate) OnConflictColumns(columns ...string) *FinancialAccountUpsertOne

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

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

func (*FinancialAccountCreate) Save

Save creates the FinancialAccount in the database.

func (*FinancialAccountCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*FinancialAccountCreate) SetAccountType

func (fac *FinancialAccountCreate) SetAccountType(s string) *FinancialAccountCreate

SetAccountType sets the "account_type" field.

func (*FinancialAccountCreate) SetBalance

SetBalance sets the "balance" field.

func (*FinancialAccountCreate) SetBankName

SetBankName sets the "bank_name" field.

func (*FinancialAccountCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*FinancialAccountCreate) SetCurrencyCode

func (fac *FinancialAccountCreate) SetCurrencyCode(s string) *FinancialAccountCreate

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountCreate) SetDisplayName

func (fac *FinancialAccountCreate) SetDisplayName(s string) *FinancialAccountCreate

SetDisplayName sets the "display_name" field.

func (*FinancialAccountCreate) SetID

SetID sets the "id" field.

func (*FinancialAccountCreate) SetIsActive

func (fac *FinancialAccountCreate) SetIsActive(b bool) *FinancialAccountCreate

SetIsActive sets the "is_active" field.

func (*FinancialAccountCreate) SetNillableBankName

func (fac *FinancialAccountCreate) SetNillableBankName(s *string) *FinancialAccountCreate

SetNillableBankName sets the "bank_name" field if the given value is not nil.

func (*FinancialAccountCreate) SetOwner

SetOwner sets the "owner" edge to the User entity.

func (*FinancialAccountCreate) SetOwnerID

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*FinancialAccountCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountCreate) SetVersion

SetVersion sets the "version" field.

type FinancialAccountCreateBulk

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

FinancialAccountCreateBulk is the builder for creating many FinancialAccount entities in bulk.

func (*FinancialAccountCreateBulk) Exec

Exec executes the query.

func (*FinancialAccountCreateBulk) ExecX

func (facb *FinancialAccountCreateBulk) ExecX(ctx context.Context)

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

func (*FinancialAccountCreateBulk) OnConflict

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

client.FinancialAccount.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.FinancialAccountUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*FinancialAccountCreateBulk) OnConflictColumns

func (facb *FinancialAccountCreateBulk) OnConflictColumns(columns ...string) *FinancialAccountUpsertBulk

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

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

func (*FinancialAccountCreateBulk) Save

Save creates the FinancialAccount entities in the database.

func (*FinancialAccountCreateBulk) SaveX

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

type FinancialAccountDelete

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

FinancialAccountDelete is the builder for deleting a FinancialAccount entity.

func (*FinancialAccountDelete) Exec

func (fad *FinancialAccountDelete) Exec(ctx context.Context) (int, error)

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

func (*FinancialAccountDelete) ExecX

func (fad *FinancialAccountDelete) ExecX(ctx context.Context) int

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

func (*FinancialAccountDelete) Where

Where appends a list predicates to the FinancialAccountDelete builder.

type FinancialAccountDeleteOne

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

FinancialAccountDeleteOne is the builder for deleting a single FinancialAccount entity.

func (*FinancialAccountDeleteOne) Exec

Exec executes the deletion query.

func (*FinancialAccountDeleteOne) ExecX

func (fado *FinancialAccountDeleteOne) ExecX(ctx context.Context)

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

type FinancialAccountEdges

type FinancialAccountEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// Cards holds the value of the cards edge.
	Cards []*Card `json:"cards,omitempty"`
	// contains filtered or unexported fields
}

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

func (FinancialAccountEdges) CardsOrErr

func (e FinancialAccountEdges) CardsOrErr() ([]*Card, error)

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

func (FinancialAccountEdges) OwnerOrErr

func (e FinancialAccountEdges) OwnerOrErr() (*User, error)

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

type FinancialAccountGroupBy

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

FinancialAccountGroupBy is the group-by builder for FinancialAccount entities.

func (*FinancialAccountGroupBy) Aggregate

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

func (*FinancialAccountGroupBy) Bool

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

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

func (*FinancialAccountGroupBy) BoolX

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

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

func (*FinancialAccountGroupBy) Bools

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

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

func (*FinancialAccountGroupBy) BoolsX

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

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

func (*FinancialAccountGroupBy) Float64

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

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

func (*FinancialAccountGroupBy) Float64X

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

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

func (*FinancialAccountGroupBy) Float64s

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

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

func (*FinancialAccountGroupBy) Float64sX

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

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

func (*FinancialAccountGroupBy) Int

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

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

func (*FinancialAccountGroupBy) IntX

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

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

func (*FinancialAccountGroupBy) Ints

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

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

func (*FinancialAccountGroupBy) IntsX

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

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

func (*FinancialAccountGroupBy) Scan

func (fagb *FinancialAccountGroupBy) Scan(ctx context.Context, v any) error

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

func (*FinancialAccountGroupBy) ScanX

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

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

func (*FinancialAccountGroupBy) String

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

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

func (*FinancialAccountGroupBy) StringX

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

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

func (*FinancialAccountGroupBy) Strings

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

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

func (*FinancialAccountGroupBy) StringsX

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

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

type FinancialAccountMutation

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

FinancialAccountMutation represents an operation that mutates the FinancialAccount nodes in the graph.

func (*FinancialAccountMutation) AccountType

func (m *FinancialAccountMutation) AccountType() (r string, exists bool)

AccountType returns the value of the "account_type" field in the mutation.

func (*FinancialAccountMutation) AddBalance

func (m *FinancialAccountMutation) AddBalance(f float64)

AddBalance adds f to the "balance" field.

func (*FinancialAccountMutation) AddCardIDs

func (m *FinancialAccountMutation) AddCardIDs(ids ...string)

AddCardIDs adds the "cards" edge to the Card entity by ids.

func (*FinancialAccountMutation) AddField

func (m *FinancialAccountMutation) 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 (*FinancialAccountMutation) AddVersion

func (m *FinancialAccountMutation) AddVersion(u int32)

AddVersion adds u to the "version" field.

func (*FinancialAccountMutation) AddedBalance

func (m *FinancialAccountMutation) AddedBalance() (r float64, exists bool)

AddedBalance returns the value that was added to the "balance" field in this mutation.

func (*FinancialAccountMutation) AddedEdges

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

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

func (*FinancialAccountMutation) AddedField

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

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

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

func (*FinancialAccountMutation) AddedIDs

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

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

func (*FinancialAccountMutation) AddedVersion

func (m *FinancialAccountMutation) AddedVersion() (r int32, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*FinancialAccountMutation) Balance

func (m *FinancialAccountMutation) Balance() (r float64, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*FinancialAccountMutation) BankName

func (m *FinancialAccountMutation) BankName() (r string, exists bool)

BankName returns the value of the "bank_name" field in the mutation.

func (*FinancialAccountMutation) BankNameCleared

func (m *FinancialAccountMutation) BankNameCleared() bool

BankNameCleared returns if the "bank_name" field was cleared in this mutation.

func (*FinancialAccountMutation) CardsCleared

func (m *FinancialAccountMutation) CardsCleared() bool

CardsCleared reports if the "cards" edge to the Card entity was cleared.

func (*FinancialAccountMutation) CardsIDs

func (m *FinancialAccountMutation) CardsIDs() (ids []string)

CardsIDs returns the "cards" edge IDs in the mutation.

func (*FinancialAccountMutation) ClearBankName

func (m *FinancialAccountMutation) ClearBankName()

ClearBankName clears the value of the "bank_name" field.

func (*FinancialAccountMutation) ClearCards

func (m *FinancialAccountMutation) ClearCards()

ClearCards clears the "cards" edge to the Card entity.

func (*FinancialAccountMutation) ClearEdge

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

func (m *FinancialAccountMutation) 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 (*FinancialAccountMutation) ClearOwner

func (m *FinancialAccountMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*FinancialAccountMutation) ClearedEdges

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

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

func (*FinancialAccountMutation) ClearedFields

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

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

func (FinancialAccountMutation) Client

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

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

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

func (*FinancialAccountMutation) CurrencyCode

func (m *FinancialAccountMutation) CurrencyCode() (r string, exists bool)

CurrencyCode returns the value of the "currency_code" field in the mutation.

func (*FinancialAccountMutation) DisplayName

func (m *FinancialAccountMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*FinancialAccountMutation) EdgeCleared

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

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

func (*FinancialAccountMutation) Field

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

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

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

func (*FinancialAccountMutation) Fields

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

func (m *FinancialAccountMutation) ID() (id string, 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 (*FinancialAccountMutation) IDs

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 (*FinancialAccountMutation) IsActive

func (m *FinancialAccountMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*FinancialAccountMutation) OldAccountType

func (m *FinancialAccountMutation) OldAccountType(ctx context.Context) (v string, err error)

OldAccountType returns the old "account_type" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) OldBalance

func (m *FinancialAccountMutation) OldBalance(ctx context.Context) (v float64, err error)

OldBalance returns the old "balance" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) OldBankName

func (m *FinancialAccountMutation) OldBankName(ctx context.Context) (v string, err error)

OldBankName returns the old "bank_name" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) OldCreatedAt

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

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

func (m *FinancialAccountMutation) OldCurrencyCode(ctx context.Context) (v string, err error)

OldCurrencyCode returns the old "currency_code" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) OldDisplayName

func (m *FinancialAccountMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) OldField

func (m *FinancialAccountMutation) 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 (*FinancialAccountMutation) OldIsActive

func (m *FinancialAccountMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) OldUpdatedAt

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

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

func (m *FinancialAccountMutation) OldVersion(ctx context.Context) (v uint32, err error)

OldVersion returns the old "version" field's value of the FinancialAccount entity. If the FinancialAccount 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 (*FinancialAccountMutation) Op

func (m *FinancialAccountMutation) Op() Op

Op returns the operation name.

func (*FinancialAccountMutation) OwnerCleared

func (m *FinancialAccountMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*FinancialAccountMutation) OwnerID

func (m *FinancialAccountMutation) OwnerID() (id string, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*FinancialAccountMutation) OwnerIDs

func (m *FinancialAccountMutation) OwnerIDs() (ids []string)

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

func (*FinancialAccountMutation) RemoveCardIDs

func (m *FinancialAccountMutation) RemoveCardIDs(ids ...string)

RemoveCardIDs removes the "cards" edge to the Card entity by IDs.

func (*FinancialAccountMutation) RemovedCardsIDs

func (m *FinancialAccountMutation) RemovedCardsIDs() (ids []string)

RemovedCards returns the removed IDs of the "cards" edge to the Card entity.

func (*FinancialAccountMutation) RemovedEdges

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

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

func (*FinancialAccountMutation) RemovedIDs

func (m *FinancialAccountMutation) 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 (*FinancialAccountMutation) ResetAccountType

func (m *FinancialAccountMutation) ResetAccountType()

ResetAccountType resets all changes to the "account_type" field.

func (*FinancialAccountMutation) ResetBalance

func (m *FinancialAccountMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*FinancialAccountMutation) ResetBankName

func (m *FinancialAccountMutation) ResetBankName()

ResetBankName resets all changes to the "bank_name" field.

func (*FinancialAccountMutation) ResetCards

func (m *FinancialAccountMutation) ResetCards()

ResetCards resets all changes to the "cards" edge.

func (*FinancialAccountMutation) ResetCreatedAt

func (m *FinancialAccountMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FinancialAccountMutation) ResetCurrencyCode

func (m *FinancialAccountMutation) ResetCurrencyCode()

ResetCurrencyCode resets all changes to the "currency_code" field.

func (*FinancialAccountMutation) ResetDisplayName

func (m *FinancialAccountMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*FinancialAccountMutation) ResetEdge

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

func (m *FinancialAccountMutation) 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 (*FinancialAccountMutation) ResetIsActive

func (m *FinancialAccountMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*FinancialAccountMutation) ResetOwner

func (m *FinancialAccountMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*FinancialAccountMutation) ResetUpdatedAt

func (m *FinancialAccountMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FinancialAccountMutation) ResetVersion

func (m *FinancialAccountMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*FinancialAccountMutation) SetAccountType

func (m *FinancialAccountMutation) SetAccountType(s string)

SetAccountType sets the "account_type" field.

func (*FinancialAccountMutation) SetBalance

func (m *FinancialAccountMutation) SetBalance(f float64)

SetBalance sets the "balance" field.

func (*FinancialAccountMutation) SetBankName

func (m *FinancialAccountMutation) SetBankName(s string)

SetBankName sets the "bank_name" field.

func (*FinancialAccountMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FinancialAccountMutation) SetCurrencyCode

func (m *FinancialAccountMutation) SetCurrencyCode(s string)

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountMutation) SetDisplayName

func (m *FinancialAccountMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*FinancialAccountMutation) SetField

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

func (m *FinancialAccountMutation) SetID(id string)

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

func (*FinancialAccountMutation) SetIsActive

func (m *FinancialAccountMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*FinancialAccountMutation) SetOp

func (m *FinancialAccountMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FinancialAccountMutation) SetOwnerID

func (m *FinancialAccountMutation) SetOwnerID(id string)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*FinancialAccountMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountMutation) SetVersion

func (m *FinancialAccountMutation) SetVersion(u uint32)

SetVersion sets the "version" field.

func (FinancialAccountMutation) Tx

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

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

func (*FinancialAccountMutation) Type

func (m *FinancialAccountMutation) Type() string

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

func (*FinancialAccountMutation) UpdatedAt

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

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

func (*FinancialAccountMutation) Version

func (m *FinancialAccountMutation) Version() (r uint32, exists bool)

Version returns the value of the "version" field in the mutation.

func (*FinancialAccountMutation) Where

Where appends a list predicates to the FinancialAccountMutation builder.

func (*FinancialAccountMutation) WhereP

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

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

type FinancialAccountQuery

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

FinancialAccountQuery is the builder for querying FinancialAccount entities.

func (*FinancialAccountQuery) Aggregate

Aggregate returns a FinancialAccountSelect configured with the given aggregations.

func (*FinancialAccountQuery) All

All executes the query and returns a list of FinancialAccounts.

func (*FinancialAccountQuery) AllX

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

func (*FinancialAccountQuery) Clone

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

func (*FinancialAccountQuery) Count

func (faq *FinancialAccountQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FinancialAccountQuery) CountX

func (faq *FinancialAccountQuery) CountX(ctx context.Context) int

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

func (*FinancialAccountQuery) Exist

func (faq *FinancialAccountQuery) Exist(ctx context.Context) (bool, error)

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

func (*FinancialAccountQuery) ExistX

func (faq *FinancialAccountQuery) ExistX(ctx context.Context) bool

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

func (*FinancialAccountQuery) First

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

func (*FinancialAccountQuery) FirstID

func (faq *FinancialAccountQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FinancialAccountQuery) FirstIDX

func (faq *FinancialAccountQuery) FirstIDX(ctx context.Context) string

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

func (*FinancialAccountQuery) FirstX

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

func (*FinancialAccountQuery) GroupBy

func (faq *FinancialAccountQuery) GroupBy(field string, fields ...string) *FinancialAccountGroupBy

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 {
	IsActive bool `json:"is_active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.FinancialAccount.Query().
	GroupBy(financialaccount.FieldIsActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FinancialAccountQuery) IDs

func (faq *FinancialAccountQuery) IDs(ctx context.Context) ([]string, error)

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

func (*FinancialAccountQuery) IDsX

func (faq *FinancialAccountQuery) IDsX(ctx context.Context) []string

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

func (*FinancialAccountQuery) Limit

func (faq *FinancialAccountQuery) Limit(limit int) *FinancialAccountQuery

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

func (*FinancialAccountQuery) Offset

func (faq *FinancialAccountQuery) Offset(offset int) *FinancialAccountQuery

Offset to start from.

func (*FinancialAccountQuery) Only

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

func (*FinancialAccountQuery) OnlyID

func (faq *FinancialAccountQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*FinancialAccountQuery) OnlyIDX

func (faq *FinancialAccountQuery) OnlyIDX(ctx context.Context) string

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

func (*FinancialAccountQuery) OnlyX

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

func (*FinancialAccountQuery) Order

Order specifies how the records should be ordered.

func (*FinancialAccountQuery) QueryCards

func (faq *FinancialAccountQuery) QueryCards() *CardQuery

QueryCards chains the current query on the "cards" edge.

func (*FinancialAccountQuery) QueryOwner

func (faq *FinancialAccountQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*FinancialAccountQuery) Select

func (faq *FinancialAccountQuery) Select(fields ...string) *FinancialAccountSelect

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 {
	IsActive bool `json:"is_active,omitempty"`
}

client.FinancialAccount.Query().
	Select(financialaccount.FieldIsActive).
	Scan(ctx, &v)

func (*FinancialAccountQuery) Unique

func (faq *FinancialAccountQuery) Unique(unique bool) *FinancialAccountQuery

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

Where adds a new predicate for the FinancialAccountQuery builder.

func (*FinancialAccountQuery) WithCards

func (faq *FinancialAccountQuery) WithCards(opts ...func(*CardQuery)) *FinancialAccountQuery

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

func (*FinancialAccountQuery) WithOwner

func (faq *FinancialAccountQuery) WithOwner(opts ...func(*UserQuery)) *FinancialAccountQuery

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

type FinancialAccountSelect

type FinancialAccountSelect struct {
	*FinancialAccountQuery
	// contains filtered or unexported fields
}

FinancialAccountSelect is the builder for selecting fields of FinancialAccount entities.

func (*FinancialAccountSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*FinancialAccountSelect) Bool

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

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

func (*FinancialAccountSelect) BoolX

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

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

func (*FinancialAccountSelect) Bools

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

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

func (*FinancialAccountSelect) BoolsX

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

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

func (*FinancialAccountSelect) Float64

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

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

func (*FinancialAccountSelect) Float64X

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

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

func (*FinancialAccountSelect) Float64s

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

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

func (*FinancialAccountSelect) Float64sX

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

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

func (*FinancialAccountSelect) Int

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

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

func (*FinancialAccountSelect) IntX

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

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

func (*FinancialAccountSelect) Ints

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

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

func (*FinancialAccountSelect) IntsX

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

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

func (*FinancialAccountSelect) Scan

func (fas *FinancialAccountSelect) Scan(ctx context.Context, v any) error

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

func (*FinancialAccountSelect) ScanX

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

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

func (*FinancialAccountSelect) String

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

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

func (*FinancialAccountSelect) StringX

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

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

func (*FinancialAccountSelect) Strings

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

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

func (*FinancialAccountSelect) StringsX

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

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

type FinancialAccountUpdate

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

FinancialAccountUpdate is the builder for updating FinancialAccount entities.

func (*FinancialAccountUpdate) AddBalance

AddBalance adds f to the "balance" field.

func (*FinancialAccountUpdate) AddCardIDs

func (fau *FinancialAccountUpdate) AddCardIDs(ids ...string) *FinancialAccountUpdate

AddCardIDs adds the "cards" edge to the Card entity by IDs.

func (*FinancialAccountUpdate) AddCards

func (fau *FinancialAccountUpdate) AddCards(c ...*Card) *FinancialAccountUpdate

AddCards adds the "cards" edges to the Card entity.

func (*FinancialAccountUpdate) AddVersion

AddVersion adds u to the "version" field.

func (*FinancialAccountUpdate) ClearBankName

func (fau *FinancialAccountUpdate) ClearBankName() *FinancialAccountUpdate

ClearBankName clears the value of the "bank_name" field.

func (*FinancialAccountUpdate) ClearCards

ClearCards clears all "cards" edges to the Card entity.

func (*FinancialAccountUpdate) Exec

Exec executes the query.

func (*FinancialAccountUpdate) ExecX

func (fau *FinancialAccountUpdate) ExecX(ctx context.Context)

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

func (*FinancialAccountUpdate) Mutation

Mutation returns the FinancialAccountMutation object of the builder.

func (*FinancialAccountUpdate) RemoveCardIDs

func (fau *FinancialAccountUpdate) RemoveCardIDs(ids ...string) *FinancialAccountUpdate

RemoveCardIDs removes the "cards" edge to Card entities by IDs.

func (*FinancialAccountUpdate) RemoveCards

func (fau *FinancialAccountUpdate) RemoveCards(c ...*Card) *FinancialAccountUpdate

RemoveCards removes "cards" edges to Card entities.

func (*FinancialAccountUpdate) Save

func (fau *FinancialAccountUpdate) Save(ctx context.Context) (int, error)

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

func (*FinancialAccountUpdate) SaveX

func (fau *FinancialAccountUpdate) SaveX(ctx context.Context) int

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

func (*FinancialAccountUpdate) SetAccountType

func (fau *FinancialAccountUpdate) SetAccountType(s string) *FinancialAccountUpdate

SetAccountType sets the "account_type" field.

func (*FinancialAccountUpdate) SetBalance

SetBalance sets the "balance" field.

func (*FinancialAccountUpdate) SetBankName

SetBankName sets the "bank_name" field.

func (*FinancialAccountUpdate) SetCurrencyCode

func (fau *FinancialAccountUpdate) SetCurrencyCode(s string) *FinancialAccountUpdate

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountUpdate) SetDisplayName

func (fau *FinancialAccountUpdate) SetDisplayName(s string) *FinancialAccountUpdate

SetDisplayName sets the "display_name" field.

func (*FinancialAccountUpdate) SetIsActive

func (fau *FinancialAccountUpdate) SetIsActive(b bool) *FinancialAccountUpdate

SetIsActive sets the "is_active" field.

func (*FinancialAccountUpdate) SetNillableBankName

func (fau *FinancialAccountUpdate) SetNillableBankName(s *string) *FinancialAccountUpdate

SetNillableBankName sets the "bank_name" field if the given value is not nil.

func (*FinancialAccountUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountUpdate) SetVersion

SetVersion sets the "version" field.

func (*FinancialAccountUpdate) Where

Where appends a list predicates to the FinancialAccountUpdate builder.

type FinancialAccountUpdateOne

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

FinancialAccountUpdateOne is the builder for updating a single FinancialAccount entity.

func (*FinancialAccountUpdateOne) AddBalance

AddBalance adds f to the "balance" field.

func (*FinancialAccountUpdateOne) AddCardIDs

AddCardIDs adds the "cards" edge to the Card entity by IDs.

func (*FinancialAccountUpdateOne) AddCards

AddCards adds the "cards" edges to the Card entity.

func (*FinancialAccountUpdateOne) AddVersion

AddVersion adds u to the "version" field.

func (*FinancialAccountUpdateOne) ClearBankName

ClearBankName clears the value of the "bank_name" field.

func (*FinancialAccountUpdateOne) ClearCards

ClearCards clears all "cards" edges to the Card entity.

func (*FinancialAccountUpdateOne) Exec

Exec executes the query on the entity.

func (*FinancialAccountUpdateOne) ExecX

func (fauo *FinancialAccountUpdateOne) ExecX(ctx context.Context)

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

func (*FinancialAccountUpdateOne) Mutation

Mutation returns the FinancialAccountMutation object of the builder.

func (*FinancialAccountUpdateOne) RemoveCardIDs

func (fauo *FinancialAccountUpdateOne) RemoveCardIDs(ids ...string) *FinancialAccountUpdateOne

RemoveCardIDs removes the "cards" edge to Card entities by IDs.

func (*FinancialAccountUpdateOne) RemoveCards

func (fauo *FinancialAccountUpdateOne) RemoveCards(c ...*Card) *FinancialAccountUpdateOne

RemoveCards removes "cards" edges to Card entities.

func (*FinancialAccountUpdateOne) Save

Save executes the query and returns the updated FinancialAccount entity.

func (*FinancialAccountUpdateOne) SaveX

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

func (*FinancialAccountUpdateOne) Select

func (fauo *FinancialAccountUpdateOne) Select(field string, fields ...string) *FinancialAccountUpdateOne

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

func (*FinancialAccountUpdateOne) SetAccountType

SetAccountType sets the "account_type" field.

func (*FinancialAccountUpdateOne) SetBalance

SetBalance sets the "balance" field.

func (*FinancialAccountUpdateOne) SetBankName

SetBankName sets the "bank_name" field.

func (*FinancialAccountUpdateOne) SetCurrencyCode

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountUpdateOne) SetDisplayName

SetDisplayName sets the "display_name" field.

func (*FinancialAccountUpdateOne) SetIsActive

SetIsActive sets the "is_active" field.

func (*FinancialAccountUpdateOne) SetNillableBankName

func (fauo *FinancialAccountUpdateOne) SetNillableBankName(s *string) *FinancialAccountUpdateOne

SetNillableBankName sets the "bank_name" field if the given value is not nil.

func (*FinancialAccountUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountUpdateOne) SetVersion

SetVersion sets the "version" field.

type FinancialAccountUpsert

type FinancialAccountUpsert struct {
	*sql.UpdateSet
}

FinancialAccountUpsert is the "OnConflict" setter.

func (*FinancialAccountUpsert) AddBalance

AddBalance adds v to the "balance" field.

func (*FinancialAccountUpsert) AddVersion

AddVersion adds v to the "version" field.

func (*FinancialAccountUpsert) ClearBankName

func (u *FinancialAccountUpsert) ClearBankName() *FinancialAccountUpsert

ClearBankName clears the value of the "bank_name" field.

func (*FinancialAccountUpsert) SetAccountType

SetAccountType sets the "account_type" field.

func (*FinancialAccountUpsert) SetBalance

SetBalance sets the "balance" field.

func (*FinancialAccountUpsert) SetBankName

SetBankName sets the "bank_name" field.

func (*FinancialAccountUpsert) SetCurrencyCode

func (u *FinancialAccountUpsert) SetCurrencyCode(v string) *FinancialAccountUpsert

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountUpsert) SetDisplayName

SetDisplayName sets the "display_name" field.

func (*FinancialAccountUpsert) SetIsActive

SetIsActive sets the "is_active" field.

func (*FinancialAccountUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountUpsert) SetVersion

SetVersion sets the "version" field.

func (*FinancialAccountUpsert) UpdateAccountType

func (u *FinancialAccountUpsert) UpdateAccountType() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateBalance

func (u *FinancialAccountUpsert) UpdateBalance() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateBankName

func (u *FinancialAccountUpsert) UpdateBankName() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateCurrencyCode

func (u *FinancialAccountUpsert) UpdateCurrencyCode() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateDisplayName

func (u *FinancialAccountUpsert) UpdateDisplayName() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateIsActive

func (u *FinancialAccountUpsert) UpdateIsActive() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateUpdatedAt

func (u *FinancialAccountUpsert) UpdateUpdatedAt() *FinancialAccountUpsert

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

func (*FinancialAccountUpsert) UpdateVersion

func (u *FinancialAccountUpsert) UpdateVersion() *FinancialAccountUpsert

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

type FinancialAccountUpsertBulk

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

FinancialAccountUpsertBulk is the builder for "upsert"-ing a bulk of FinancialAccount nodes.

func (*FinancialAccountUpsertBulk) AddBalance

AddBalance adds v to the "balance" field.

func (*FinancialAccountUpsertBulk) AddVersion

AddVersion adds v to the "version" field.

func (*FinancialAccountUpsertBulk) ClearBankName

ClearBankName clears the value of the "bank_name" field.

func (*FinancialAccountUpsertBulk) DoNothing

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

func (*FinancialAccountUpsertBulk) Exec

Exec executes the query.

func (*FinancialAccountUpsertBulk) ExecX

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

func (*FinancialAccountUpsertBulk) Ignore

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

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

func (*FinancialAccountUpsertBulk) SetAccountType

SetAccountType sets the "account_type" field.

func (*FinancialAccountUpsertBulk) SetBalance

SetBalance sets the "balance" field.

func (*FinancialAccountUpsertBulk) SetBankName

SetBankName sets the "bank_name" field.

func (*FinancialAccountUpsertBulk) SetCurrencyCode

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountUpsertBulk) SetDisplayName

SetDisplayName sets the "display_name" field.

func (*FinancialAccountUpsertBulk) SetIsActive

SetIsActive sets the "is_active" field.

func (*FinancialAccountUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountUpsertBulk) SetVersion

SetVersion sets the "version" field.

func (*FinancialAccountUpsertBulk) Update

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

func (*FinancialAccountUpsertBulk) UpdateAccountType

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

func (*FinancialAccountUpsertBulk) UpdateBalance

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

func (*FinancialAccountUpsertBulk) UpdateBankName

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

func (*FinancialAccountUpsertBulk) UpdateCurrencyCode

func (u *FinancialAccountUpsertBulk) UpdateCurrencyCode() *FinancialAccountUpsertBulk

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

func (*FinancialAccountUpsertBulk) UpdateDisplayName

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

func (*FinancialAccountUpsertBulk) UpdateIsActive

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

func (*FinancialAccountUpsertBulk) UpdateNewValues

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

client.FinancialAccount.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(financialaccount.FieldID)
		}),
	).
	Exec(ctx)

func (*FinancialAccountUpsertBulk) UpdateUpdatedAt

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

func (*FinancialAccountUpsertBulk) UpdateVersion

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

type FinancialAccountUpsertOne

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

FinancialAccountUpsertOne is the builder for "upsert"-ing

one FinancialAccount node.

func (*FinancialAccountUpsertOne) AddBalance

AddBalance adds v to the "balance" field.

func (*FinancialAccountUpsertOne) AddVersion

AddVersion adds v to the "version" field.

func (*FinancialAccountUpsertOne) ClearBankName

ClearBankName clears the value of the "bank_name" field.

func (*FinancialAccountUpsertOne) DoNothing

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

func (*FinancialAccountUpsertOne) Exec

Exec executes the query.

func (*FinancialAccountUpsertOne) ExecX

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

func (*FinancialAccountUpsertOne) ID

func (u *FinancialAccountUpsertOne) ID(ctx context.Context) (id string, err error)

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

func (*FinancialAccountUpsertOne) IDX

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

func (*FinancialAccountUpsertOne) Ignore

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

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

func (*FinancialAccountUpsertOne) SetAccountType

SetAccountType sets the "account_type" field.

func (*FinancialAccountUpsertOne) SetBalance

SetBalance sets the "balance" field.

func (*FinancialAccountUpsertOne) SetBankName

SetBankName sets the "bank_name" field.

func (*FinancialAccountUpsertOne) SetCurrencyCode

SetCurrencyCode sets the "currency_code" field.

func (*FinancialAccountUpsertOne) SetDisplayName

SetDisplayName sets the "display_name" field.

func (*FinancialAccountUpsertOne) SetIsActive

SetIsActive sets the "is_active" field.

func (*FinancialAccountUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialAccountUpsertOne) SetVersion

SetVersion sets the "version" field.

func (*FinancialAccountUpsertOne) Update

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

func (*FinancialAccountUpsertOne) UpdateAccountType

func (u *FinancialAccountUpsertOne) UpdateAccountType() *FinancialAccountUpsertOne

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

func (*FinancialAccountUpsertOne) UpdateBalance

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

func (*FinancialAccountUpsertOne) UpdateBankName

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

func (*FinancialAccountUpsertOne) UpdateCurrencyCode

func (u *FinancialAccountUpsertOne) UpdateCurrencyCode() *FinancialAccountUpsertOne

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

func (*FinancialAccountUpsertOne) UpdateDisplayName

func (u *FinancialAccountUpsertOne) UpdateDisplayName() *FinancialAccountUpsertOne

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

func (*FinancialAccountUpsertOne) UpdateIsActive

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

func (*FinancialAccountUpsertOne) UpdateNewValues

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.FinancialAccount.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(financialaccount.FieldID)
		}),
	).
	Exec(ctx)

func (*FinancialAccountUpsertOne) UpdateUpdatedAt

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

func (*FinancialAccountUpsertOne) UpdateVersion

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

type FinancialAccounts

type FinancialAccounts []*FinancialAccount

FinancialAccounts is a parsable slice of FinancialAccount.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type 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 RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Card is the client for interacting with the Card builders.
	Card *CardClient
	// Contact is the client for interacting with the Contact builders.
	Contact *ContactClient
	// FinancialAccount is the client for interacting with the FinancialAccount builders.
	FinancialAccount *FinancialAccountClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Version holds the value of the "version" field.
	Version uint32 `json:"version,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"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryCards

func (u *User) QueryCards() *CardQuery

QueryCards queries the "cards" edge of the User entity.

func (u *User) QueryContactLinks() *ContactQuery

QueryContactLinks queries the "contact_links" edge of the User entity.

func (*User) QueryContacts

func (u *User) QueryContacts() *ContactQuery

QueryContacts queries the "contacts" edge of the User entity.

func (*User) QueryFinancialAccounts

func (u *User) QueryFinancialAccounts() *FinancialAccountQuery

QueryFinancialAccounts queries the "financial_accounts" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id string) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id string) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id string) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryCards

func (c *UserClient) QueryCards(u *User) *CardQuery

QueryCards queries the cards edge of a User.

func (c *UserClient) QueryContactLinks(u *User) *ContactQuery

QueryContactLinks queries the contact_links edge of a User.

func (*UserClient) QueryContacts

func (c *UserClient) QueryContacts(u *User) *ContactQuery

QueryContacts queries the contacts edge of a User.

func (*UserClient) QueryFinancialAccounts

func (c *UserClient) QueryFinancialAccounts(u *User) *FinancialAccountQuery

QueryFinancialAccounts queries the financial_accounts edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id string) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddCardIDs

func (uc *UserCreate) AddCardIDs(ids ...string) *UserCreate

AddCardIDs adds the "cards" edge to the Card entity by IDs.

func (*UserCreate) AddCards

func (uc *UserCreate) AddCards(c ...*Card) *UserCreate

AddCards adds the "cards" edges to the Card entity.

func (*UserCreate) AddContactIDs

func (uc *UserCreate) AddContactIDs(ids ...string) *UserCreate

AddContactIDs adds the "contacts" edge to the Contact entity by IDs.

func (*UserCreate) AddContactLinkIDs

func (uc *UserCreate) AddContactLinkIDs(ids ...string) *UserCreate

AddContactLinkIDs adds the "contact_links" edge to the Contact entity by IDs.

func (uc *UserCreate) AddContactLinks(c ...*Contact) *UserCreate

AddContactLinks adds the "contact_links" edges to the Contact entity.

func (*UserCreate) AddContacts

func (uc *UserCreate) AddContacts(c ...*Contact) *UserCreate

AddContacts adds the "contacts" edges to the Contact entity.

func (*UserCreate) AddFinancialAccountIDs

func (uc *UserCreate) AddFinancialAccountIDs(ids ...string) *UserCreate

AddFinancialAccountIDs adds the "financial_accounts" edge to the FinancialAccount entity by IDs.

func (*UserCreate) AddFinancialAccounts

func (uc *UserCreate) AddFinancialAccounts(f ...*FinancialAccount) *UserCreate

AddFinancialAccounts adds the "financial_accounts" edges to the FinancialAccount entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetIsActive(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.UserUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDisplayName

func (uc *UserCreate) SetDisplayName(s string) *UserCreate

SetDisplayName sets the "display_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(s string) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsActive

func (uc *UserCreate) SetIsActive(b bool) *UserCreate

SetIsActive sets the "is_active" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetVersion

func (uc *UserCreate) SetVersion(u uint32) *UserCreate

SetVersion sets the "version" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.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.UserUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type UserEdges

type UserEdges struct {
	// Contacts holds the value of the contacts edge.
	Contacts []*Contact `json:"contacts,omitempty"`
	// ContactLinks holds the value of the contact_links edge.
	ContactLinks []*Contact `json:"contact_links,omitempty"`
	// FinancialAccounts holds the value of the financial_accounts edge.
	FinancialAccounts []*FinancialAccount `json:"financial_accounts,omitempty"`
	// Cards holds the value of the cards edge.
	Cards []*Card `json:"cards,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) CardsOrErr

func (e UserEdges) CardsOrErr() ([]*Card, error)

CardsOrErr returns the Cards value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ContactLinksOrErr

func (e UserEdges) ContactLinksOrErr() ([]*Contact, error)

ContactLinksOrErr returns the ContactLinks value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ContactsOrErr

func (e UserEdges) ContactsOrErr() ([]*Contact, error)

ContactsOrErr returns the Contacts value or an error if the edge was not loaded in eager-loading.

func (UserEdges) FinancialAccountsOrErr

func (e UserEdges) FinancialAccountsOrErr() ([]*FinancialAccount, error)

FinancialAccountsOrErr returns the FinancialAccounts value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddCardIDs

func (m *UserMutation) AddCardIDs(ids ...string)

AddCardIDs adds the "cards" edge to the Card entity by ids.

func (*UserMutation) AddContactIDs

func (m *UserMutation) AddContactIDs(ids ...string)

AddContactIDs adds the "contacts" edge to the Contact entity by ids.

func (*UserMutation) AddContactLinkIDs

func (m *UserMutation) AddContactLinkIDs(ids ...string)

AddContactLinkIDs adds the "contact_links" edge to the Contact entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddFinancialAccountIDs

func (m *UserMutation) AddFinancialAccountIDs(ids ...string)

AddFinancialAccountIDs adds the "financial_accounts" edge to the FinancialAccount entity by ids.

func (*UserMutation) AddVersion

func (m *UserMutation) AddVersion(u int32)

AddVersion adds u to the "version" field.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AddedVersion

func (m *UserMutation) AddedVersion() (r int32, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*UserMutation) CardsCleared

func (m *UserMutation) CardsCleared() bool

CardsCleared reports if the "cards" edge to the Card entity was cleared.

func (*UserMutation) CardsIDs

func (m *UserMutation) CardsIDs() (ids []string)

CardsIDs returns the "cards" edge IDs in the mutation.

func (*UserMutation) ClearCards

func (m *UserMutation) ClearCards()

ClearCards clears the "cards" edge to the Card entity.

func (m *UserMutation) ClearContactLinks()

ClearContactLinks clears the "contact_links" edge to the Contact entity.

func (*UserMutation) ClearContacts

func (m *UserMutation) ClearContacts()

ClearContacts clears the "contacts" edge to the Contact entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearFinancialAccounts

func (m *UserMutation) ClearFinancialAccounts()

ClearFinancialAccounts clears the "financial_accounts" edge to the FinancialAccount entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) ContactLinksCleared

func (m *UserMutation) ContactLinksCleared() bool

ContactLinksCleared reports if the "contact_links" edge to the Contact entity was cleared.

func (*UserMutation) ContactLinksIDs

func (m *UserMutation) ContactLinksIDs() (ids []string)

ContactLinksIDs returns the "contact_links" edge IDs in the mutation.

func (*UserMutation) ContactsCleared

func (m *UserMutation) ContactsCleared() bool

ContactsCleared reports if the "contacts" edge to the Contact entity was cleared.

func (*UserMutation) ContactsIDs

func (m *UserMutation) ContactsIDs() (ids []string)

ContactsIDs returns the "contacts" edge IDs in the mutation.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DisplayName

func (m *UserMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) FinancialAccountsCleared

func (m *UserMutation) FinancialAccountsCleared() bool

FinancialAccountsCleared reports if the "financial_accounts" edge to the FinancialAccount entity was cleared.

func (*UserMutation) FinancialAccountsIDs

func (m *UserMutation) FinancialAccountsIDs() (ids []string)

FinancialAccountsIDs returns the "financial_accounts" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id string, 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 (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]string, 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 (*UserMutation) IsActive

func (m *UserMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldDisplayName

func (m *UserMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldIsActive

func (m *UserMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the User entity. If the User 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 (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User 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 (*UserMutation) OldVersion

func (m *UserMutation) OldVersion(ctx context.Context) (v uint32, err error)

OldVersion returns the old "version" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemoveCardIDs

func (m *UserMutation) RemoveCardIDs(ids ...string)

RemoveCardIDs removes the "cards" edge to the Card entity by IDs.

func (*UserMutation) RemoveContactIDs

func (m *UserMutation) RemoveContactIDs(ids ...string)

RemoveContactIDs removes the "contacts" edge to the Contact entity by IDs.

func (*UserMutation) RemoveContactLinkIDs

func (m *UserMutation) RemoveContactLinkIDs(ids ...string)

RemoveContactLinkIDs removes the "contact_links" edge to the Contact entity by IDs.

func (*UserMutation) RemoveFinancialAccountIDs

func (m *UserMutation) RemoveFinancialAccountIDs(ids ...string)

RemoveFinancialAccountIDs removes the "financial_accounts" edge to the FinancialAccount entity by IDs.

func (*UserMutation) RemovedCardsIDs

func (m *UserMutation) RemovedCardsIDs() (ids []string)

RemovedCards returns the removed IDs of the "cards" edge to the Card entity.

func (*UserMutation) RemovedContactLinksIDs

func (m *UserMutation) RemovedContactLinksIDs() (ids []string)

RemovedContactLinks returns the removed IDs of the "contact_links" edge to the Contact entity.

func (*UserMutation) RemovedContactsIDs

func (m *UserMutation) RemovedContactsIDs() (ids []string)

RemovedContacts returns the removed IDs of the "contacts" edge to the Contact entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedFinancialAccountsIDs

func (m *UserMutation) RemovedFinancialAccountsIDs() (ids []string)

RemovedFinancialAccounts returns the removed IDs of the "financial_accounts" edge to the FinancialAccount entity.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetCards

func (m *UserMutation) ResetCards()

ResetCards resets all changes to the "cards" edge.

func (m *UserMutation) ResetContactLinks()

ResetContactLinks resets all changes to the "contact_links" edge.

func (*UserMutation) ResetContacts

func (m *UserMutation) ResetContacts()

ResetContacts resets all changes to the "contacts" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDisplayName

func (m *UserMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetFinancialAccounts

func (m *UserMutation) ResetFinancialAccounts()

ResetFinancialAccounts resets all changes to the "financial_accounts" edge.

func (*UserMutation) ResetIsActive

func (m *UserMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetVersion

func (m *UserMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDisplayName

func (m *UserMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetID

func (m *UserMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIsActive

func (m *UserMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetVersion

func (m *UserMutation) SetVersion(u uint32)

SetVersion sets the "version" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Version

func (m *UserMutation) Version() (r uint32, exists bool)

Version returns the value of the "version" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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 {
	IsActive bool `json:"is_active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldIsActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryCards

func (uq *UserQuery) QueryCards() *CardQuery

QueryCards chains the current query on the "cards" edge.

func (uq *UserQuery) QueryContactLinks() *ContactQuery

QueryContactLinks chains the current query on the "contact_links" edge.

func (*UserQuery) QueryContacts

func (uq *UserQuery) QueryContacts() *ContactQuery

QueryContacts chains the current query on the "contacts" edge.

func (*UserQuery) QueryFinancialAccounts

func (uq *UserQuery) QueryFinancialAccounts() *FinancialAccountQuery

QueryFinancialAccounts chains the current query on the "financial_accounts" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	IsActive bool `json:"is_active,omitempty"`
}

client.User.Query().
	Select(user.FieldIsActive).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithCards

func (uq *UserQuery) WithCards(opts ...func(*CardQuery)) *UserQuery

WithCards tells the query-builder to eager-load the nodes that are connected to the "cards" edge. The optional arguments are used to configure the query builder of the edge.

func (uq *UserQuery) WithContactLinks(opts ...func(*ContactQuery)) *UserQuery

WithContactLinks tells the query-builder to eager-load the nodes that are connected to the "contact_links" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithContacts

func (uq *UserQuery) WithContacts(opts ...func(*ContactQuery)) *UserQuery

WithContacts tells the query-builder to eager-load the nodes that are connected to the "contacts" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithFinancialAccounts

func (uq *UserQuery) WithFinancialAccounts(opts ...func(*FinancialAccountQuery)) *UserQuery

WithFinancialAccounts tells the query-builder to eager-load the nodes that are connected to the "financial_accounts" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddCardIDs

func (uu *UserUpdate) AddCardIDs(ids ...string) *UserUpdate

AddCardIDs adds the "cards" edge to the Card entity by IDs.

func (*UserUpdate) AddCards

func (uu *UserUpdate) AddCards(c ...*Card) *UserUpdate

AddCards adds the "cards" edges to the Card entity.

func (*UserUpdate) AddContactIDs

func (uu *UserUpdate) AddContactIDs(ids ...string) *UserUpdate

AddContactIDs adds the "contacts" edge to the Contact entity by IDs.

func (*UserUpdate) AddContactLinkIDs

func (uu *UserUpdate) AddContactLinkIDs(ids ...string) *UserUpdate

AddContactLinkIDs adds the "contact_links" edge to the Contact entity by IDs.

func (uu *UserUpdate) AddContactLinks(c ...*Contact) *UserUpdate

AddContactLinks adds the "contact_links" edges to the Contact entity.

func (*UserUpdate) AddContacts

func (uu *UserUpdate) AddContacts(c ...*Contact) *UserUpdate

AddContacts adds the "contacts" edges to the Contact entity.

func (*UserUpdate) AddFinancialAccountIDs

func (uu *UserUpdate) AddFinancialAccountIDs(ids ...string) *UserUpdate

AddFinancialAccountIDs adds the "financial_accounts" edge to the FinancialAccount entity by IDs.

func (*UserUpdate) AddFinancialAccounts

func (uu *UserUpdate) AddFinancialAccounts(f ...*FinancialAccount) *UserUpdate

AddFinancialAccounts adds the "financial_accounts" edges to the FinancialAccount entity.

func (*UserUpdate) AddVersion

func (uu *UserUpdate) AddVersion(u int32) *UserUpdate

AddVersion adds u to the "version" field.

func (*UserUpdate) ClearCards

func (uu *UserUpdate) ClearCards() *UserUpdate

ClearCards clears all "cards" edges to the Card entity.

func (uu *UserUpdate) ClearContactLinks() *UserUpdate

ClearContactLinks clears all "contact_links" edges to the Contact entity.

func (*UserUpdate) ClearContacts

func (uu *UserUpdate) ClearContacts() *UserUpdate

ClearContacts clears all "contacts" edges to the Contact entity.

func (*UserUpdate) ClearFinancialAccounts

func (uu *UserUpdate) ClearFinancialAccounts() *UserUpdate

ClearFinancialAccounts clears all "financial_accounts" edges to the FinancialAccount entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveCardIDs

func (uu *UserUpdate) RemoveCardIDs(ids ...string) *UserUpdate

RemoveCardIDs removes the "cards" edge to Card entities by IDs.

func (*UserUpdate) RemoveCards

func (uu *UserUpdate) RemoveCards(c ...*Card) *UserUpdate

RemoveCards removes "cards" edges to Card entities.

func (*UserUpdate) RemoveContactIDs

func (uu *UserUpdate) RemoveContactIDs(ids ...string) *UserUpdate

RemoveContactIDs removes the "contacts" edge to Contact entities by IDs.

func (*UserUpdate) RemoveContactLinkIDs

func (uu *UserUpdate) RemoveContactLinkIDs(ids ...string) *UserUpdate

RemoveContactLinkIDs removes the "contact_links" edge to Contact entities by IDs.

func (uu *UserUpdate) RemoveContactLinks(c ...*Contact) *UserUpdate

RemoveContactLinks removes "contact_links" edges to Contact entities.

func (*UserUpdate) RemoveContacts

func (uu *UserUpdate) RemoveContacts(c ...*Contact) *UserUpdate

RemoveContacts removes "contacts" edges to Contact entities.

func (*UserUpdate) RemoveFinancialAccountIDs

func (uu *UserUpdate) RemoveFinancialAccountIDs(ids ...string) *UserUpdate

RemoveFinancialAccountIDs removes the "financial_accounts" edge to FinancialAccount entities by IDs.

func (*UserUpdate) RemoveFinancialAccounts

func (uu *UserUpdate) RemoveFinancialAccounts(f ...*FinancialAccount) *UserUpdate

RemoveFinancialAccounts removes "financial_accounts" edges to FinancialAccount entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetDisplayName

func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate

SetDisplayName sets the "display_name" field.

func (*UserUpdate) SetIsActive

func (uu *UserUpdate) SetIsActive(b bool) *UserUpdate

SetIsActive sets the "is_active" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetVersion

func (uu *UserUpdate) SetVersion(u uint32) *UserUpdate

SetVersion sets the "version" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddCardIDs

func (uuo *UserUpdateOne) AddCardIDs(ids ...string) *UserUpdateOne

AddCardIDs adds the "cards" edge to the Card entity by IDs.

func (*UserUpdateOne) AddCards

func (uuo *UserUpdateOne) AddCards(c ...*Card) *UserUpdateOne

AddCards adds the "cards" edges to the Card entity.

func (*UserUpdateOne) AddContactIDs

func (uuo *UserUpdateOne) AddContactIDs(ids ...string) *UserUpdateOne

AddContactIDs adds the "contacts" edge to the Contact entity by IDs.

func (*UserUpdateOne) AddContactLinkIDs

func (uuo *UserUpdateOne) AddContactLinkIDs(ids ...string) *UserUpdateOne

AddContactLinkIDs adds the "contact_links" edge to the Contact entity by IDs.

func (uuo *UserUpdateOne) AddContactLinks(c ...*Contact) *UserUpdateOne

AddContactLinks adds the "contact_links" edges to the Contact entity.

func (*UserUpdateOne) AddContacts

func (uuo *UserUpdateOne) AddContacts(c ...*Contact) *UserUpdateOne

AddContacts adds the "contacts" edges to the Contact entity.

func (*UserUpdateOne) AddFinancialAccountIDs

func (uuo *UserUpdateOne) AddFinancialAccountIDs(ids ...string) *UserUpdateOne

AddFinancialAccountIDs adds the "financial_accounts" edge to the FinancialAccount entity by IDs.

func (*UserUpdateOne) AddFinancialAccounts

func (uuo *UserUpdateOne) AddFinancialAccounts(f ...*FinancialAccount) *UserUpdateOne

AddFinancialAccounts adds the "financial_accounts" edges to the FinancialAccount entity.

func (*UserUpdateOne) AddVersion

func (uuo *UserUpdateOne) AddVersion(u int32) *UserUpdateOne

AddVersion adds u to the "version" field.

func (*UserUpdateOne) ClearCards

func (uuo *UserUpdateOne) ClearCards() *UserUpdateOne

ClearCards clears all "cards" edges to the Card entity.

func (uuo *UserUpdateOne) ClearContactLinks() *UserUpdateOne

ClearContactLinks clears all "contact_links" edges to the Contact entity.

func (*UserUpdateOne) ClearContacts

func (uuo *UserUpdateOne) ClearContacts() *UserUpdateOne

ClearContacts clears all "contacts" edges to the Contact entity.

func (*UserUpdateOne) ClearFinancialAccounts

func (uuo *UserUpdateOne) ClearFinancialAccounts() *UserUpdateOne

ClearFinancialAccounts clears all "financial_accounts" edges to the FinancialAccount entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveCardIDs

func (uuo *UserUpdateOne) RemoveCardIDs(ids ...string) *UserUpdateOne

RemoveCardIDs removes the "cards" edge to Card entities by IDs.

func (*UserUpdateOne) RemoveCards

func (uuo *UserUpdateOne) RemoveCards(c ...*Card) *UserUpdateOne

RemoveCards removes "cards" edges to Card entities.

func (*UserUpdateOne) RemoveContactIDs

func (uuo *UserUpdateOne) RemoveContactIDs(ids ...string) *UserUpdateOne

RemoveContactIDs removes the "contacts" edge to Contact entities by IDs.

func (*UserUpdateOne) RemoveContactLinkIDs

func (uuo *UserUpdateOne) RemoveContactLinkIDs(ids ...string) *UserUpdateOne

RemoveContactLinkIDs removes the "contact_links" edge to Contact entities by IDs.

func (uuo *UserUpdateOne) RemoveContactLinks(c ...*Contact) *UserUpdateOne

RemoveContactLinks removes "contact_links" edges to Contact entities.

func (*UserUpdateOne) RemoveContacts

func (uuo *UserUpdateOne) RemoveContacts(c ...*Contact) *UserUpdateOne

RemoveContacts removes "contacts" edges to Contact entities.

func (*UserUpdateOne) RemoveFinancialAccountIDs

func (uuo *UserUpdateOne) RemoveFinancialAccountIDs(ids ...string) *UserUpdateOne

RemoveFinancialAccountIDs removes the "financial_accounts" edge to FinancialAccount entities by IDs.

func (*UserUpdateOne) RemoveFinancialAccounts

func (uuo *UserUpdateOne) RemoveFinancialAccounts(f ...*FinancialAccount) *UserUpdateOne

RemoveFinancialAccounts removes "financial_accounts" edges to FinancialAccount entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetDisplayName

func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne

SetDisplayName sets the "display_name" field.

func (*UserUpdateOne) SetIsActive

func (uuo *UserUpdateOne) SetIsActive(b bool) *UserUpdateOne

SetIsActive sets the "is_active" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetVersion

func (uuo *UserUpdateOne) SetVersion(u uint32) *UserUpdateOne

SetVersion sets the "version" field.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) AddVersion

func (u *UserUpsert) AddVersion(v uint32) *UserUpsert

AddVersion adds v to the "version" field.

func (*UserUpsert) SetDisplayName

func (u *UserUpsert) SetDisplayName(v string) *UserUpsert

SetDisplayName sets the "display_name" field.

func (*UserUpsert) SetIsActive

func (u *UserUpsert) SetIsActive(v bool) *UserUpsert

SetIsActive sets the "is_active" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) SetVersion

func (u *UserUpsert) SetVersion(v uint32) *UserUpsert

SetVersion sets the "version" field.

func (*UserUpsert) UpdateDisplayName

func (u *UserUpsert) UpdateDisplayName() *UserUpsert

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*UserUpsert) UpdateIsActive

func (u *UserUpsert) UpdateIsActive() *UserUpsert

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsert) UpdateVersion

func (u *UserUpsert) UpdateVersion() *UserUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) AddVersion

func (u *UserUpsertBulk) AddVersion(v uint32) *UserUpsertBulk

AddVersion adds v to the "version" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetDisplayName

func (u *UserUpsertBulk) SetDisplayName(v string) *UserUpsertBulk

SetDisplayName sets the "display_name" field.

func (*UserUpsertBulk) SetIsActive

func (u *UserUpsertBulk) SetIsActive(v bool) *UserUpsertBulk

SetIsActive sets the "is_active" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) SetVersion

func (u *UserUpsertBulk) SetVersion(v uint32) *UserUpsertBulk

SetVersion sets the "version" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateDisplayName

func (u *UserUpsertBulk) UpdateDisplayName() *UserUpsertBulk

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIsActive

func (u *UserUpsertBulk) UpdateIsActive() *UserUpsertBulk

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateVersion

func (u *UserUpsertBulk) UpdateVersion() *UserUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) AddVersion

func (u *UserUpsertOne) AddVersion(v uint32) *UserUpsertOne

AddVersion adds v to the "version" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetDisplayName

func (u *UserUpsertOne) SetDisplayName(v string) *UserUpsertOne

SetDisplayName sets the "display_name" field.

func (*UserUpsertOne) SetIsActive

func (u *UserUpsertOne) SetIsActive(v bool) *UserUpsertOne

SetIsActive sets the "is_active" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) SetVersion

func (u *UserUpsertOne) SetVersion(v uint32) *UserUpsertOne

SetVersion sets the "version" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateDisplayName

func (u *UserUpsertOne) UpdateDisplayName() *UserUpsertOne

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIsActive

func (u *UserUpsertOne) UpdateIsActive() *UserUpsertOne

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

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.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateVersion

func (u *UserUpsertOne) UpdateVersion() *UserUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL