ent

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT 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.
	TypeUserWord = "UserWord"
	TypeWord     = "Word"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// UserWord is the client for interacting with the UserWord builders.
	UserWord *UserWordClient
	// Word is the client for interacting with the Word builders.
	Word *WordClient
	// 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().
	UserWord.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// UserWord is the client for interacting with the UserWord builders.
	UserWord *UserWordClient
	// Word is the client for interacting with the Word builders.
	Word *WordClient
	// 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 UserWord

type UserWord struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// Word holds the value of the "word" field.
	Word string `json:"word,omitempty"`
	// Normalized holds the value of the "normalized" field.
	Normalized string `json:"normalized,omitempty"`
	// Language holds the value of the "language" field.
	Language string `json:"language,omitempty"`
	// MasteryListen holds the value of the "mastery_listen" field.
	MasteryListen int16 `json:"mastery_listen,omitempty"`
	// MasteryRead holds the value of the "mastery_read" field.
	MasteryRead int16 `json:"mastery_read,omitempty"`
	// MasterySpell holds the value of the "mastery_spell" field.
	MasterySpell int16 `json:"mastery_spell,omitempty"`
	// MasteryPronounce holds the value of the "mastery_pronounce" field.
	MasteryPronounce int16 `json:"mastery_pronounce,omitempty"`
	// MasteryUse holds the value of the "mastery_use" field.
	MasteryUse int16 `json:"mastery_use,omitempty"`
	// MasteryOverall holds the value of the "mastery_overall" field.
	MasteryOverall int32 `json:"mastery_overall,omitempty"`
	// ReviewLastReviewAt holds the value of the "review_last_review_at" field.
	ReviewLastReviewAt *time.Time `json:"review_last_review_at,omitempty"`
	// ReviewNextReviewAt holds the value of the "review_next_review_at" field.
	ReviewNextReviewAt *time.Time `json:"review_next_review_at,omitempty"`
	// ReviewIntervalDays holds the value of the "review_interval_days" field.
	ReviewIntervalDays int32 `json:"review_interval_days,omitempty"`
	// ReviewFailCount holds the value of the "review_fail_count" field.
	ReviewFailCount int32 `json:"review_fail_count,omitempty"`
	// QueryCount holds the value of the "query_count" field.
	QueryCount int64 `json:"query_count,omitempty"`
	// Notes holds the value of the "notes" field.
	Notes *string `json:"notes,omitempty"`
	// Sentences holds the value of the "sentences" field.
	Sentences []entity.Sentence `json:"sentences,omitempty"`
	// Relations holds the value of the "relations" field.
	Relations []entity.UserWordRelation `json:"relations,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy string `json:"created_by,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"`
	// contains filtered or unexported fields
}

UserWord is the model entity for the UserWord schema.

func (*UserWord) String

func (uw *UserWord) String() string

String implements the fmt.Stringer.

func (*UserWord) Unwrap

func (uw *UserWord) Unwrap() *UserWord

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

func (uw *UserWord) Update() *UserWordUpdateOne

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

func (*UserWord) Value

func (uw *UserWord) Value(name string) (ent.Value, error)

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

type UserWordClient

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

UserWordClient is a client for the UserWord schema.

func NewUserWordClient

func NewUserWordClient(c config) *UserWordClient

NewUserWordClient returns a client for the UserWord from the given config.

func (*UserWordClient) Create

func (c *UserWordClient) Create() *UserWordCreate

Create returns a builder for creating a UserWord entity.

func (*UserWordClient) CreateBulk

func (c *UserWordClient) CreateBulk(builders ...*UserWordCreate) *UserWordCreateBulk

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

func (*UserWordClient) Delete

func (c *UserWordClient) Delete() *UserWordDelete

Delete returns a delete builder for UserWord.

func (*UserWordClient) DeleteOne

func (c *UserWordClient) DeleteOne(uw *UserWord) *UserWordDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserWordClient) DeleteOneID

func (c *UserWordClient) DeleteOneID(id int) *UserWordDeleteOne

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

func (*UserWordClient) Get

func (c *UserWordClient) Get(ctx context.Context, id int) (*UserWord, error)

Get returns a UserWord entity by its id.

func (*UserWordClient) GetX

func (c *UserWordClient) GetX(ctx context.Context, id int) *UserWord

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

func (*UserWordClient) Hooks

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

Hooks returns the client hooks.

func (*UserWordClient) Intercept

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

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

func (*UserWordClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserWordClient) MapCreateBulk

func (c *UserWordClient) MapCreateBulk(slice any, setFunc func(*UserWordCreate, int)) *UserWordCreateBulk

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

func (*UserWordClient) Query

func (c *UserWordClient) Query() *UserWordQuery

Query returns a query builder for UserWord.

func (*UserWordClient) Update

func (c *UserWordClient) Update() *UserWordUpdate

Update returns an update builder for UserWord.

func (*UserWordClient) UpdateOne

func (c *UserWordClient) UpdateOne(uw *UserWord) *UserWordUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserWordClient) UpdateOneID

func (c *UserWordClient) UpdateOneID(id int) *UserWordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserWordClient) Use

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

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

type UserWordCreate

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

UserWordCreate is the builder for creating a UserWord entity.

func (*UserWordCreate) Exec

func (uwc *UserWordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserWordCreate) ExecX

func (uwc *UserWordCreate) ExecX(ctx context.Context)

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

func (*UserWordCreate) Mutation

func (uwc *UserWordCreate) Mutation() *UserWordMutation

Mutation returns the UserWordMutation object of the builder.

func (*UserWordCreate) OnConflict added in v0.1.1

func (uwc *UserWordCreate) OnConflict(opts ...sql.ConflictOption) *UserWordUpsertOne

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

client.UserWord.Create().
	SetUserID(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.UserWordUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*UserWordCreate) OnConflictColumns added in v0.1.1

func (uwc *UserWordCreate) OnConflictColumns(columns ...string) *UserWordUpsertOne

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

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

func (*UserWordCreate) Save

func (uwc *UserWordCreate) Save(ctx context.Context) (*UserWord, error)

Save creates the UserWord in the database.

func (*UserWordCreate) SaveX

func (uwc *UserWordCreate) SaveX(ctx context.Context) *UserWord

SaveX calls Save and panics if Save returns an error.

func (*UserWordCreate) SetCreatedAt

func (uwc *UserWordCreate) SetCreatedAt(t time.Time) *UserWordCreate

SetCreatedAt sets the "created_at" field.

func (*UserWordCreate) SetCreatedBy

func (uwc *UserWordCreate) SetCreatedBy(s string) *UserWordCreate

SetCreatedBy sets the "created_by" field.

func (*UserWordCreate) SetLanguage

func (uwc *UserWordCreate) SetLanguage(s string) *UserWordCreate

SetLanguage sets the "language" field.

func (*UserWordCreate) SetMasteryListen

func (uwc *UserWordCreate) SetMasteryListen(i int16) *UserWordCreate

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordCreate) SetMasteryOverall

func (uwc *UserWordCreate) SetMasteryOverall(i int32) *UserWordCreate

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordCreate) SetMasteryPronounce

func (uwc *UserWordCreate) SetMasteryPronounce(i int16) *UserWordCreate

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordCreate) SetMasteryRead

func (uwc *UserWordCreate) SetMasteryRead(i int16) *UserWordCreate

SetMasteryRead sets the "mastery_read" field.

func (*UserWordCreate) SetMasterySpell

func (uwc *UserWordCreate) SetMasterySpell(i int16) *UserWordCreate

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordCreate) SetMasteryUse

func (uwc *UserWordCreate) SetMasteryUse(i int16) *UserWordCreate

SetMasteryUse sets the "mastery_use" field.

func (*UserWordCreate) SetNillableCreatedAt

func (uwc *UserWordCreate) SetNillableCreatedAt(t *time.Time) *UserWordCreate

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

func (*UserWordCreate) SetNillableCreatedBy

func (uwc *UserWordCreate) SetNillableCreatedBy(s *string) *UserWordCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserWordCreate) SetNillableLanguage

func (uwc *UserWordCreate) SetNillableLanguage(s *string) *UserWordCreate

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

func (*UserWordCreate) SetNillableMasteryListen

func (uwc *UserWordCreate) SetNillableMasteryListen(i *int16) *UserWordCreate

SetNillableMasteryListen sets the "mastery_listen" field if the given value is not nil.

func (*UserWordCreate) SetNillableMasteryOverall

func (uwc *UserWordCreate) SetNillableMasteryOverall(i *int32) *UserWordCreate

SetNillableMasteryOverall sets the "mastery_overall" field if the given value is not nil.

func (*UserWordCreate) SetNillableMasteryPronounce

func (uwc *UserWordCreate) SetNillableMasteryPronounce(i *int16) *UserWordCreate

SetNillableMasteryPronounce sets the "mastery_pronounce" field if the given value is not nil.

func (*UserWordCreate) SetNillableMasteryRead

func (uwc *UserWordCreate) SetNillableMasteryRead(i *int16) *UserWordCreate

SetNillableMasteryRead sets the "mastery_read" field if the given value is not nil.

func (*UserWordCreate) SetNillableMasterySpell

func (uwc *UserWordCreate) SetNillableMasterySpell(i *int16) *UserWordCreate

SetNillableMasterySpell sets the "mastery_spell" field if the given value is not nil.

func (*UserWordCreate) SetNillableMasteryUse

func (uwc *UserWordCreate) SetNillableMasteryUse(i *int16) *UserWordCreate

SetNillableMasteryUse sets the "mastery_use" field if the given value is not nil.

func (*UserWordCreate) SetNillableNormalized added in v0.1.5

func (uwc *UserWordCreate) SetNillableNormalized(s *string) *UserWordCreate

SetNillableNormalized sets the "normalized" field if the given value is not nil.

func (*UserWordCreate) SetNillableNotes

func (uwc *UserWordCreate) SetNillableNotes(s *string) *UserWordCreate

SetNillableNotes sets the "notes" field if the given value is not nil.

func (*UserWordCreate) SetNillableQueryCount

func (uwc *UserWordCreate) SetNillableQueryCount(i *int64) *UserWordCreate

SetNillableQueryCount sets the "query_count" field if the given value is not nil.

func (*UserWordCreate) SetNillableReviewFailCount

func (uwc *UserWordCreate) SetNillableReviewFailCount(i *int32) *UserWordCreate

SetNillableReviewFailCount sets the "review_fail_count" field if the given value is not nil.

func (*UserWordCreate) SetNillableReviewIntervalDays

func (uwc *UserWordCreate) SetNillableReviewIntervalDays(i *int32) *UserWordCreate

SetNillableReviewIntervalDays sets the "review_interval_days" field if the given value is not nil.

func (*UserWordCreate) SetNillableReviewLastReviewAt

func (uwc *UserWordCreate) SetNillableReviewLastReviewAt(t *time.Time) *UserWordCreate

SetNillableReviewLastReviewAt sets the "review_last_review_at" field if the given value is not nil.

func (*UserWordCreate) SetNillableReviewNextReviewAt

func (uwc *UserWordCreate) SetNillableReviewNextReviewAt(t *time.Time) *UserWordCreate

SetNillableReviewNextReviewAt sets the "review_next_review_at" field if the given value is not nil.

func (*UserWordCreate) SetNillableUpdatedAt

func (uwc *UserWordCreate) SetNillableUpdatedAt(t *time.Time) *UserWordCreate

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

func (*UserWordCreate) SetNormalized added in v0.1.5

func (uwc *UserWordCreate) SetNormalized(s string) *UserWordCreate

SetNormalized sets the "normalized" field.

func (*UserWordCreate) SetNotes

func (uwc *UserWordCreate) SetNotes(s string) *UserWordCreate

SetNotes sets the "notes" field.

func (*UserWordCreate) SetQueryCount

func (uwc *UserWordCreate) SetQueryCount(i int64) *UserWordCreate

SetQueryCount sets the "query_count" field.

func (*UserWordCreate) SetRelations

func (uwc *UserWordCreate) SetRelations(ewr []entity.UserWordRelation) *UserWordCreate

SetRelations sets the "relations" field.

func (*UserWordCreate) SetReviewFailCount

func (uwc *UserWordCreate) SetReviewFailCount(i int32) *UserWordCreate

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordCreate) SetReviewIntervalDays

func (uwc *UserWordCreate) SetReviewIntervalDays(i int32) *UserWordCreate

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordCreate) SetReviewLastReviewAt

func (uwc *UserWordCreate) SetReviewLastReviewAt(t time.Time) *UserWordCreate

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordCreate) SetReviewNextReviewAt

func (uwc *UserWordCreate) SetReviewNextReviewAt(t time.Time) *UserWordCreate

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordCreate) SetSentences

func (uwc *UserWordCreate) SetSentences(e []entity.Sentence) *UserWordCreate

SetSentences sets the "sentences" field.

func (*UserWordCreate) SetUpdatedAt

func (uwc *UserWordCreate) SetUpdatedAt(t time.Time) *UserWordCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserWordCreate) SetUserID

func (uwc *UserWordCreate) SetUserID(i int64) *UserWordCreate

SetUserID sets the "user_id" field.

func (*UserWordCreate) SetWord

func (uwc *UserWordCreate) SetWord(s string) *UserWordCreate

SetWord sets the "word" field.

type UserWordCreateBulk

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

UserWordCreateBulk is the builder for creating many UserWord entities in bulk.

func (*UserWordCreateBulk) Exec

func (uwcb *UserWordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserWordCreateBulk) ExecX

func (uwcb *UserWordCreateBulk) ExecX(ctx context.Context)

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

func (*UserWordCreateBulk) OnConflict added in v0.1.1

func (uwcb *UserWordCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserWordUpsertBulk

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

client.UserWord.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.UserWordUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*UserWordCreateBulk) OnConflictColumns added in v0.1.1

func (uwcb *UserWordCreateBulk) OnConflictColumns(columns ...string) *UserWordUpsertBulk

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

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

func (*UserWordCreateBulk) Save

func (uwcb *UserWordCreateBulk) Save(ctx context.Context) ([]*UserWord, error)

Save creates the UserWord entities in the database.

func (*UserWordCreateBulk) SaveX

func (uwcb *UserWordCreateBulk) SaveX(ctx context.Context) []*UserWord

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

type UserWordDelete

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

UserWordDelete is the builder for deleting a UserWord entity.

func (*UserWordDelete) Exec

func (uwd *UserWordDelete) Exec(ctx context.Context) (int, error)

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

func (*UserWordDelete) ExecX

func (uwd *UserWordDelete) ExecX(ctx context.Context) int

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

func (*UserWordDelete) Where

func (uwd *UserWordDelete) Where(ps ...predicate.UserWord) *UserWordDelete

Where appends a list predicates to the UserWordDelete builder.

type UserWordDeleteOne

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

UserWordDeleteOne is the builder for deleting a single UserWord entity.

func (*UserWordDeleteOne) Exec

func (uwdo *UserWordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserWordDeleteOne) ExecX

func (uwdo *UserWordDeleteOne) ExecX(ctx context.Context)

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

func (*UserWordDeleteOne) Where

Where appends a list predicates to the UserWordDelete builder.

type UserWordGroupBy

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

UserWordGroupBy is the group-by builder for UserWord entities.

func (*UserWordGroupBy) Aggregate

func (uwgb *UserWordGroupBy) Aggregate(fns ...AggregateFunc) *UserWordGroupBy

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

func (*UserWordGroupBy) Bool

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

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

func (*UserWordGroupBy) BoolX

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

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

func (*UserWordGroupBy) Bools

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

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

func (*UserWordGroupBy) BoolsX

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

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

func (*UserWordGroupBy) Float64

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

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

func (*UserWordGroupBy) Float64X

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

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

func (*UserWordGroupBy) Float64s

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

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

func (*UserWordGroupBy) Float64sX

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

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

func (*UserWordGroupBy) Int

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

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

func (*UserWordGroupBy) IntX

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

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

func (*UserWordGroupBy) Ints

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

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

func (*UserWordGroupBy) IntsX

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

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

func (*UserWordGroupBy) Scan

func (uwgb *UserWordGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserWordGroupBy) ScanX

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

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

func (*UserWordGroupBy) String

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

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

func (*UserWordGroupBy) StringX

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

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

func (*UserWordGroupBy) Strings

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

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

func (*UserWordGroupBy) StringsX

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

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

type UserWordMutation

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

UserWordMutation represents an operation that mutates the UserWord nodes in the graph.

func (*UserWordMutation) AddField

func (m *UserWordMutation) 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 (*UserWordMutation) AddMasteryListen

func (m *UserWordMutation) AddMasteryListen(i int16)

AddMasteryListen adds i to the "mastery_listen" field.

func (*UserWordMutation) AddMasteryOverall

func (m *UserWordMutation) AddMasteryOverall(i int32)

AddMasteryOverall adds i to the "mastery_overall" field.

func (*UserWordMutation) AddMasteryPronounce

func (m *UserWordMutation) AddMasteryPronounce(i int16)

AddMasteryPronounce adds i to the "mastery_pronounce" field.

func (*UserWordMutation) AddMasteryRead

func (m *UserWordMutation) AddMasteryRead(i int16)

AddMasteryRead adds i to the "mastery_read" field.

func (*UserWordMutation) AddMasterySpell

func (m *UserWordMutation) AddMasterySpell(i int16)

AddMasterySpell adds i to the "mastery_spell" field.

func (*UserWordMutation) AddMasteryUse

func (m *UserWordMutation) AddMasteryUse(i int16)

AddMasteryUse adds i to the "mastery_use" field.

func (*UserWordMutation) AddQueryCount

func (m *UserWordMutation) AddQueryCount(i int64)

AddQueryCount adds i to the "query_count" field.

func (*UserWordMutation) AddReviewFailCount

func (m *UserWordMutation) AddReviewFailCount(i int32)

AddReviewFailCount adds i to the "review_fail_count" field.

func (*UserWordMutation) AddReviewIntervalDays

func (m *UserWordMutation) AddReviewIntervalDays(i int32)

AddReviewIntervalDays adds i to the "review_interval_days" field.

func (*UserWordMutation) AddUserID

func (m *UserWordMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*UserWordMutation) AddedEdges

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

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

func (*UserWordMutation) AddedField

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

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

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

func (*UserWordMutation) AddedIDs

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

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

func (*UserWordMutation) AddedMasteryListen

func (m *UserWordMutation) AddedMasteryListen() (r int16, exists bool)

AddedMasteryListen returns the value that was added to the "mastery_listen" field in this mutation.

func (*UserWordMutation) AddedMasteryOverall

func (m *UserWordMutation) AddedMasteryOverall() (r int32, exists bool)

AddedMasteryOverall returns the value that was added to the "mastery_overall" field in this mutation.

func (*UserWordMutation) AddedMasteryPronounce

func (m *UserWordMutation) AddedMasteryPronounce() (r int16, exists bool)

AddedMasteryPronounce returns the value that was added to the "mastery_pronounce" field in this mutation.

func (*UserWordMutation) AddedMasteryRead

func (m *UserWordMutation) AddedMasteryRead() (r int16, exists bool)

AddedMasteryRead returns the value that was added to the "mastery_read" field in this mutation.

func (*UserWordMutation) AddedMasterySpell

func (m *UserWordMutation) AddedMasterySpell() (r int16, exists bool)

AddedMasterySpell returns the value that was added to the "mastery_spell" field in this mutation.

func (*UserWordMutation) AddedMasteryUse

func (m *UserWordMutation) AddedMasteryUse() (r int16, exists bool)

AddedMasteryUse returns the value that was added to the "mastery_use" field in this mutation.

func (*UserWordMutation) AddedQueryCount

func (m *UserWordMutation) AddedQueryCount() (r int64, exists bool)

AddedQueryCount returns the value that was added to the "query_count" field in this mutation.

func (*UserWordMutation) AddedReviewFailCount

func (m *UserWordMutation) AddedReviewFailCount() (r int32, exists bool)

AddedReviewFailCount returns the value that was added to the "review_fail_count" field in this mutation.

func (*UserWordMutation) AddedReviewIntervalDays

func (m *UserWordMutation) AddedReviewIntervalDays() (r int32, exists bool)

AddedReviewIntervalDays returns the value that was added to the "review_interval_days" field in this mutation.

func (*UserWordMutation) AddedUserID

func (m *UserWordMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*UserWordMutation) AppendRelations

func (m *UserWordMutation) AppendRelations(ewr []entity.UserWordRelation)

AppendRelations adds ewr to the "relations" field.

func (*UserWordMutation) AppendSentences

func (m *UserWordMutation) AppendSentences(e []entity.Sentence)

AppendSentences adds e to the "sentences" field.

func (*UserWordMutation) AppendedRelations

func (m *UserWordMutation) AppendedRelations() ([]entity.UserWordRelation, bool)

AppendedRelations returns the list of values that were appended to the "relations" field in this mutation.

func (*UserWordMutation) AppendedSentences

func (m *UserWordMutation) AppendedSentences() ([]entity.Sentence, bool)

AppendedSentences returns the list of values that were appended to the "sentences" field in this mutation.

func (*UserWordMutation) ClearEdge

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

func (m *UserWordMutation) 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 (*UserWordMutation) ClearNotes

func (m *UserWordMutation) ClearNotes()

ClearNotes clears the value of the "notes" field.

func (*UserWordMutation) ClearReviewLastReviewAt

func (m *UserWordMutation) ClearReviewLastReviewAt()

ClearReviewLastReviewAt clears the value of the "review_last_review_at" field.

func (*UserWordMutation) ClearReviewNextReviewAt

func (m *UserWordMutation) ClearReviewNextReviewAt()

ClearReviewNextReviewAt clears the value of the "review_next_review_at" field.

func (*UserWordMutation) ClearedEdges

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

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

func (*UserWordMutation) ClearedFields

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

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

func (UserWordMutation) Client

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

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

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

func (*UserWordMutation) CreatedBy

func (m *UserWordMutation) CreatedBy() (r string, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UserWordMutation) EdgeCleared

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

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

func (*UserWordMutation) Field

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

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

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

func (*UserWordMutation) Fields

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

func (m *UserWordMutation) ID() (id int, exists bool)

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

func (*UserWordMutation) IDs

func (m *UserWordMutation) IDs(ctx context.Context) ([]int, error)

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

func (*UserWordMutation) Language

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

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

func (*UserWordMutation) MasteryListen

func (m *UserWordMutation) MasteryListen() (r int16, exists bool)

MasteryListen returns the value of the "mastery_listen" field in the mutation.

func (*UserWordMutation) MasteryOverall

func (m *UserWordMutation) MasteryOverall() (r int32, exists bool)

MasteryOverall returns the value of the "mastery_overall" field in the mutation.

func (*UserWordMutation) MasteryPronounce

func (m *UserWordMutation) MasteryPronounce() (r int16, exists bool)

MasteryPronounce returns the value of the "mastery_pronounce" field in the mutation.

func (*UserWordMutation) MasteryRead

func (m *UserWordMutation) MasteryRead() (r int16, exists bool)

MasteryRead returns the value of the "mastery_read" field in the mutation.

func (*UserWordMutation) MasterySpell

func (m *UserWordMutation) MasterySpell() (r int16, exists bool)

MasterySpell returns the value of the "mastery_spell" field in the mutation.

func (*UserWordMutation) MasteryUse

func (m *UserWordMutation) MasteryUse() (r int16, exists bool)

MasteryUse returns the value of the "mastery_use" field in the mutation.

func (*UserWordMutation) Normalized added in v0.1.5

func (m *UserWordMutation) Normalized() (r string, exists bool)

Normalized returns the value of the "normalized" field in the mutation.

func (*UserWordMutation) Notes

func (m *UserWordMutation) Notes() (r string, exists bool)

Notes returns the value of the "notes" field in the mutation.

func (*UserWordMutation) NotesCleared

func (m *UserWordMutation) NotesCleared() bool

NotesCleared returns if the "notes" field was cleared in this mutation.

func (*UserWordMutation) OldCreatedAt

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

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

func (m *UserWordMutation) OldCreatedBy(ctx context.Context) (v string, err error)

OldCreatedBy returns the old "created_by" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldField

func (m *UserWordMutation) 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 (*UserWordMutation) OldLanguage

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

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

func (m *UserWordMutation) OldMasteryListen(ctx context.Context) (v int16, err error)

OldMasteryListen returns the old "mastery_listen" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldMasteryOverall

func (m *UserWordMutation) OldMasteryOverall(ctx context.Context) (v int32, err error)

OldMasteryOverall returns the old "mastery_overall" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldMasteryPronounce

func (m *UserWordMutation) OldMasteryPronounce(ctx context.Context) (v int16, err error)

OldMasteryPronounce returns the old "mastery_pronounce" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldMasteryRead

func (m *UserWordMutation) OldMasteryRead(ctx context.Context) (v int16, err error)

OldMasteryRead returns the old "mastery_read" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldMasterySpell

func (m *UserWordMutation) OldMasterySpell(ctx context.Context) (v int16, err error)

OldMasterySpell returns the old "mastery_spell" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldMasteryUse

func (m *UserWordMutation) OldMasteryUse(ctx context.Context) (v int16, err error)

OldMasteryUse returns the old "mastery_use" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldNormalized added in v0.1.5

func (m *UserWordMutation) OldNormalized(ctx context.Context) (v string, err error)

OldNormalized returns the old "normalized" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldNotes

func (m *UserWordMutation) OldNotes(ctx context.Context) (v *string, err error)

OldNotes returns the old "notes" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldQueryCount

func (m *UserWordMutation) OldQueryCount(ctx context.Context) (v int64, err error)

OldQueryCount returns the old "query_count" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldRelations

func (m *UserWordMutation) OldRelations(ctx context.Context) (v []entity.UserWordRelation, err error)

OldRelations returns the old "relations" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldReviewFailCount

func (m *UserWordMutation) OldReviewFailCount(ctx context.Context) (v int32, err error)

OldReviewFailCount returns the old "review_fail_count" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldReviewIntervalDays

func (m *UserWordMutation) OldReviewIntervalDays(ctx context.Context) (v int32, err error)

OldReviewIntervalDays returns the old "review_interval_days" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldReviewLastReviewAt

func (m *UserWordMutation) OldReviewLastReviewAt(ctx context.Context) (v *time.Time, err error)

OldReviewLastReviewAt returns the old "review_last_review_at" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldReviewNextReviewAt

func (m *UserWordMutation) OldReviewNextReviewAt(ctx context.Context) (v *time.Time, err error)

OldReviewNextReviewAt returns the old "review_next_review_at" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldSentences

func (m *UserWordMutation) OldSentences(ctx context.Context) (v []entity.Sentence, err error)

OldSentences returns the old "sentences" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) OldUpdatedAt

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

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

func (m *UserWordMutation) OldUserID(ctx context.Context) (v int64, err error)

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

func (m *UserWordMutation) OldWord(ctx context.Context) (v string, err error)

OldWord returns the old "word" field's value of the UserWord entity. If the UserWord 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 (*UserWordMutation) Op

func (m *UserWordMutation) Op() Op

Op returns the operation name.

func (*UserWordMutation) QueryCount

func (m *UserWordMutation) QueryCount() (r int64, exists bool)

QueryCount returns the value of the "query_count" field in the mutation.

func (*UserWordMutation) Relations

func (m *UserWordMutation) Relations() (r []entity.UserWordRelation, exists bool)

Relations returns the value of the "relations" field in the mutation.

func (*UserWordMutation) RemovedEdges

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

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

func (*UserWordMutation) RemovedIDs

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

func (m *UserWordMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserWordMutation) ResetCreatedBy

func (m *UserWordMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UserWordMutation) ResetEdge

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

func (m *UserWordMutation) 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 (*UserWordMutation) ResetLanguage

func (m *UserWordMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*UserWordMutation) ResetMasteryListen

func (m *UserWordMutation) ResetMasteryListen()

ResetMasteryListen resets all changes to the "mastery_listen" field.

func (*UserWordMutation) ResetMasteryOverall

func (m *UserWordMutation) ResetMasteryOverall()

ResetMasteryOverall resets all changes to the "mastery_overall" field.

func (*UserWordMutation) ResetMasteryPronounce

func (m *UserWordMutation) ResetMasteryPronounce()

ResetMasteryPronounce resets all changes to the "mastery_pronounce" field.

func (*UserWordMutation) ResetMasteryRead

func (m *UserWordMutation) ResetMasteryRead()

ResetMasteryRead resets all changes to the "mastery_read" field.

func (*UserWordMutation) ResetMasterySpell

func (m *UserWordMutation) ResetMasterySpell()

ResetMasterySpell resets all changes to the "mastery_spell" field.

func (*UserWordMutation) ResetMasteryUse

func (m *UserWordMutation) ResetMasteryUse()

ResetMasteryUse resets all changes to the "mastery_use" field.

func (*UserWordMutation) ResetNormalized added in v0.1.5

func (m *UserWordMutation) ResetNormalized()

ResetNormalized resets all changes to the "normalized" field.

func (*UserWordMutation) ResetNotes

func (m *UserWordMutation) ResetNotes()

ResetNotes resets all changes to the "notes" field.

func (*UserWordMutation) ResetQueryCount

func (m *UserWordMutation) ResetQueryCount()

ResetQueryCount resets all changes to the "query_count" field.

func (*UserWordMutation) ResetRelations

func (m *UserWordMutation) ResetRelations()

ResetRelations resets all changes to the "relations" field.

func (*UserWordMutation) ResetReviewFailCount

func (m *UserWordMutation) ResetReviewFailCount()

ResetReviewFailCount resets all changes to the "review_fail_count" field.

func (*UserWordMutation) ResetReviewIntervalDays

func (m *UserWordMutation) ResetReviewIntervalDays()

ResetReviewIntervalDays resets all changes to the "review_interval_days" field.

func (*UserWordMutation) ResetReviewLastReviewAt

func (m *UserWordMutation) ResetReviewLastReviewAt()

ResetReviewLastReviewAt resets all changes to the "review_last_review_at" field.

func (*UserWordMutation) ResetReviewNextReviewAt

func (m *UserWordMutation) ResetReviewNextReviewAt()

ResetReviewNextReviewAt resets all changes to the "review_next_review_at" field.

func (*UserWordMutation) ResetSentences

func (m *UserWordMutation) ResetSentences()

ResetSentences resets all changes to the "sentences" field.

func (*UserWordMutation) ResetUpdatedAt

func (m *UserWordMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserWordMutation) ResetUserID

func (m *UserWordMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserWordMutation) ResetWord

func (m *UserWordMutation) ResetWord()

ResetWord resets all changes to the "word" field.

func (*UserWordMutation) ReviewFailCount

func (m *UserWordMutation) ReviewFailCount() (r int32, exists bool)

ReviewFailCount returns the value of the "review_fail_count" field in the mutation.

func (*UserWordMutation) ReviewIntervalDays

func (m *UserWordMutation) ReviewIntervalDays() (r int32, exists bool)

ReviewIntervalDays returns the value of the "review_interval_days" field in the mutation.

func (*UserWordMutation) ReviewLastReviewAt

func (m *UserWordMutation) ReviewLastReviewAt() (r time.Time, exists bool)

ReviewLastReviewAt returns the value of the "review_last_review_at" field in the mutation.

func (*UserWordMutation) ReviewLastReviewAtCleared

func (m *UserWordMutation) ReviewLastReviewAtCleared() bool

ReviewLastReviewAtCleared returns if the "review_last_review_at" field was cleared in this mutation.

func (*UserWordMutation) ReviewNextReviewAt

func (m *UserWordMutation) ReviewNextReviewAt() (r time.Time, exists bool)

ReviewNextReviewAt returns the value of the "review_next_review_at" field in the mutation.

func (*UserWordMutation) ReviewNextReviewAtCleared

func (m *UserWordMutation) ReviewNextReviewAtCleared() bool

ReviewNextReviewAtCleared returns if the "review_next_review_at" field was cleared in this mutation.

func (*UserWordMutation) Sentences

func (m *UserWordMutation) Sentences() (r []entity.Sentence, exists bool)

Sentences returns the value of the "sentences" field in the mutation.

func (*UserWordMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserWordMutation) SetCreatedBy

func (m *UserWordMutation) SetCreatedBy(s string)

SetCreatedBy sets the "created_by" field.

func (*UserWordMutation) SetField

func (m *UserWordMutation) 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 (*UserWordMutation) SetLanguage

func (m *UserWordMutation) SetLanguage(s string)

SetLanguage sets the "language" field.

func (*UserWordMutation) SetMasteryListen

func (m *UserWordMutation) SetMasteryListen(i int16)

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordMutation) SetMasteryOverall

func (m *UserWordMutation) SetMasteryOverall(i int32)

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordMutation) SetMasteryPronounce

func (m *UserWordMutation) SetMasteryPronounce(i int16)

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordMutation) SetMasteryRead

func (m *UserWordMutation) SetMasteryRead(i int16)

SetMasteryRead sets the "mastery_read" field.

func (*UserWordMutation) SetMasterySpell

func (m *UserWordMutation) SetMasterySpell(i int16)

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordMutation) SetMasteryUse

func (m *UserWordMutation) SetMasteryUse(i int16)

SetMasteryUse sets the "mastery_use" field.

func (*UserWordMutation) SetNormalized added in v0.1.5

func (m *UserWordMutation) SetNormalized(s string)

SetNormalized sets the "normalized" field.

func (*UserWordMutation) SetNotes

func (m *UserWordMutation) SetNotes(s string)

SetNotes sets the "notes" field.

func (*UserWordMutation) SetOp

func (m *UserWordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserWordMutation) SetQueryCount

func (m *UserWordMutation) SetQueryCount(i int64)

SetQueryCount sets the "query_count" field.

func (*UserWordMutation) SetRelations

func (m *UserWordMutation) SetRelations(ewr []entity.UserWordRelation)

SetRelations sets the "relations" field.

func (*UserWordMutation) SetReviewFailCount

func (m *UserWordMutation) SetReviewFailCount(i int32)

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordMutation) SetReviewIntervalDays

func (m *UserWordMutation) SetReviewIntervalDays(i int32)

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordMutation) SetReviewLastReviewAt

func (m *UserWordMutation) SetReviewLastReviewAt(t time.Time)

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordMutation) SetReviewNextReviewAt

func (m *UserWordMutation) SetReviewNextReviewAt(t time.Time)

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordMutation) SetSentences

func (m *UserWordMutation) SetSentences(e []entity.Sentence)

SetSentences sets the "sentences" field.

func (*UserWordMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserWordMutation) SetUserID

func (m *UserWordMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*UserWordMutation) SetWord

func (m *UserWordMutation) SetWord(s string)

SetWord sets the "word" field.

func (UserWordMutation) Tx

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

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

func (*UserWordMutation) Type

func (m *UserWordMutation) Type() string

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

func (*UserWordMutation) UpdatedAt

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

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

func (*UserWordMutation) UserID

func (m *UserWordMutation) UserID() (r int64, exists bool)

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

func (*UserWordMutation) Where

func (m *UserWordMutation) Where(ps ...predicate.UserWord)

Where appends a list predicates to the UserWordMutation builder.

func (*UserWordMutation) WhereP

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

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

func (*UserWordMutation) Word

func (m *UserWordMutation) Word() (r string, exists bool)

Word returns the value of the "word" field in the mutation.

type UserWordQuery

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

UserWordQuery is the builder for querying UserWord entities.

func (*UserWordQuery) Aggregate

func (uwq *UserWordQuery) Aggregate(fns ...AggregateFunc) *UserWordSelect

Aggregate returns a UserWordSelect configured with the given aggregations.

func (*UserWordQuery) All

func (uwq *UserWordQuery) All(ctx context.Context) ([]*UserWord, error)

All executes the query and returns a list of UserWords.

func (*UserWordQuery) AllX

func (uwq *UserWordQuery) AllX(ctx context.Context) []*UserWord

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

func (*UserWordQuery) Clone

func (uwq *UserWordQuery) Clone() *UserWordQuery

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

func (*UserWordQuery) Count

func (uwq *UserWordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserWordQuery) CountX

func (uwq *UserWordQuery) CountX(ctx context.Context) int

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

func (*UserWordQuery) Exist

func (uwq *UserWordQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserWordQuery) ExistX

func (uwq *UserWordQuery) ExistX(ctx context.Context) bool

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

func (*UserWordQuery) First

func (uwq *UserWordQuery) First(ctx context.Context) (*UserWord, error)

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

func (*UserWordQuery) FirstID

func (uwq *UserWordQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserWordQuery) FirstIDX

func (uwq *UserWordQuery) FirstIDX(ctx context.Context) int

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

func (*UserWordQuery) FirstX

func (uwq *UserWordQuery) FirstX(ctx context.Context) *UserWord

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

func (*UserWordQuery) GroupBy

func (uwq *UserWordQuery) GroupBy(field string, fields ...string) *UserWordGroupBy

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 {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserWord.Query().
	GroupBy(userword.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserWordQuery) IDs

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

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

func (*UserWordQuery) IDsX

func (uwq *UserWordQuery) IDsX(ctx context.Context) []int

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

func (*UserWordQuery) Limit

func (uwq *UserWordQuery) Limit(limit int) *UserWordQuery

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

func (*UserWordQuery) Offset

func (uwq *UserWordQuery) Offset(offset int) *UserWordQuery

Offset to start from.

func (*UserWordQuery) Only

func (uwq *UserWordQuery) Only(ctx context.Context) (*UserWord, error)

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

func (*UserWordQuery) OnlyID

func (uwq *UserWordQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserWordQuery) OnlyIDX

func (uwq *UserWordQuery) OnlyIDX(ctx context.Context) int

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

func (*UserWordQuery) OnlyX

func (uwq *UserWordQuery) OnlyX(ctx context.Context) *UserWord

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

func (*UserWordQuery) Order

func (uwq *UserWordQuery) Order(o ...userword.OrderOption) *UserWordQuery

Order specifies how the records should be ordered.

func (*UserWordQuery) Select

func (uwq *UserWordQuery) Select(fields ...string) *UserWordSelect

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 {
	UserID int64 `json:"user_id,omitempty"`
}

client.UserWord.Query().
	Select(userword.FieldUserID).
	Scan(ctx, &v)

func (*UserWordQuery) Unique

func (uwq *UserWordQuery) Unique(unique bool) *UserWordQuery

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

func (uwq *UserWordQuery) Where(ps ...predicate.UserWord) *UserWordQuery

Where adds a new predicate for the UserWordQuery builder.

type UserWordSelect

type UserWordSelect struct {
	*UserWordQuery
	// contains filtered or unexported fields
}

UserWordSelect is the builder for selecting fields of UserWord entities.

func (*UserWordSelect) Aggregate

func (uws *UserWordSelect) Aggregate(fns ...AggregateFunc) *UserWordSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserWordSelect) Bool

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

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

func (*UserWordSelect) BoolX

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

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

func (*UserWordSelect) Bools

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

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

func (*UserWordSelect) BoolsX

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

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

func (*UserWordSelect) Float64

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

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

func (*UserWordSelect) Float64X

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

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

func (*UserWordSelect) Float64s

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

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

func (*UserWordSelect) Float64sX

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

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

func (*UserWordSelect) Int

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

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

func (*UserWordSelect) IntX

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

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

func (*UserWordSelect) Ints

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

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

func (*UserWordSelect) IntsX

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

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

func (*UserWordSelect) Scan

func (uws *UserWordSelect) Scan(ctx context.Context, v any) error

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

func (*UserWordSelect) ScanX

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

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

func (*UserWordSelect) String

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

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

func (*UserWordSelect) StringX

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

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

func (*UserWordSelect) Strings

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

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

func (*UserWordSelect) StringsX

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

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

type UserWordUpdate

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

UserWordUpdate is the builder for updating UserWord entities.

func (*UserWordUpdate) AddMasteryListen

func (uwu *UserWordUpdate) AddMasteryListen(i int16) *UserWordUpdate

AddMasteryListen adds i to the "mastery_listen" field.

func (*UserWordUpdate) AddMasteryOverall

func (uwu *UserWordUpdate) AddMasteryOverall(i int32) *UserWordUpdate

AddMasteryOverall adds i to the "mastery_overall" field.

func (*UserWordUpdate) AddMasteryPronounce

func (uwu *UserWordUpdate) AddMasteryPronounce(i int16) *UserWordUpdate

AddMasteryPronounce adds i to the "mastery_pronounce" field.

func (*UserWordUpdate) AddMasteryRead

func (uwu *UserWordUpdate) AddMasteryRead(i int16) *UserWordUpdate

AddMasteryRead adds i to the "mastery_read" field.

func (*UserWordUpdate) AddMasterySpell

func (uwu *UserWordUpdate) AddMasterySpell(i int16) *UserWordUpdate

AddMasterySpell adds i to the "mastery_spell" field.

func (*UserWordUpdate) AddMasteryUse

func (uwu *UserWordUpdate) AddMasteryUse(i int16) *UserWordUpdate

AddMasteryUse adds i to the "mastery_use" field.

func (*UserWordUpdate) AddQueryCount

func (uwu *UserWordUpdate) AddQueryCount(i int64) *UserWordUpdate

AddQueryCount adds i to the "query_count" field.

func (*UserWordUpdate) AddReviewFailCount

func (uwu *UserWordUpdate) AddReviewFailCount(i int32) *UserWordUpdate

AddReviewFailCount adds i to the "review_fail_count" field.

func (*UserWordUpdate) AddReviewIntervalDays

func (uwu *UserWordUpdate) AddReviewIntervalDays(i int32) *UserWordUpdate

AddReviewIntervalDays adds i to the "review_interval_days" field.

func (*UserWordUpdate) AddUserID

func (uwu *UserWordUpdate) AddUserID(i int64) *UserWordUpdate

AddUserID adds i to the "user_id" field.

func (*UserWordUpdate) AppendRelations

func (uwu *UserWordUpdate) AppendRelations(ewr []entity.UserWordRelation) *UserWordUpdate

AppendRelations appends ewr to the "relations" field.

func (*UserWordUpdate) AppendSentences

func (uwu *UserWordUpdate) AppendSentences(e []entity.Sentence) *UserWordUpdate

AppendSentences appends e to the "sentences" field.

func (*UserWordUpdate) ClearNotes

func (uwu *UserWordUpdate) ClearNotes() *UserWordUpdate

ClearNotes clears the value of the "notes" field.

func (*UserWordUpdate) ClearReviewLastReviewAt

func (uwu *UserWordUpdate) ClearReviewLastReviewAt() *UserWordUpdate

ClearReviewLastReviewAt clears the value of the "review_last_review_at" field.

func (*UserWordUpdate) ClearReviewNextReviewAt

func (uwu *UserWordUpdate) ClearReviewNextReviewAt() *UserWordUpdate

ClearReviewNextReviewAt clears the value of the "review_next_review_at" field.

func (*UserWordUpdate) Exec

func (uwu *UserWordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserWordUpdate) ExecX

func (uwu *UserWordUpdate) ExecX(ctx context.Context)

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

func (*UserWordUpdate) Mutation

func (uwu *UserWordUpdate) Mutation() *UserWordMutation

Mutation returns the UserWordMutation object of the builder.

func (*UserWordUpdate) Save

func (uwu *UserWordUpdate) Save(ctx context.Context) (int, error)

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

func (*UserWordUpdate) SaveX

func (uwu *UserWordUpdate) SaveX(ctx context.Context) int

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

func (*UserWordUpdate) SetCreatedBy

func (uwu *UserWordUpdate) SetCreatedBy(s string) *UserWordUpdate

SetCreatedBy sets the "created_by" field.

func (*UserWordUpdate) SetLanguage

func (uwu *UserWordUpdate) SetLanguage(s string) *UserWordUpdate

SetLanguage sets the "language" field.

func (*UserWordUpdate) SetMasteryListen

func (uwu *UserWordUpdate) SetMasteryListen(i int16) *UserWordUpdate

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordUpdate) SetMasteryOverall

func (uwu *UserWordUpdate) SetMasteryOverall(i int32) *UserWordUpdate

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordUpdate) SetMasteryPronounce

func (uwu *UserWordUpdate) SetMasteryPronounce(i int16) *UserWordUpdate

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordUpdate) SetMasteryRead

func (uwu *UserWordUpdate) SetMasteryRead(i int16) *UserWordUpdate

SetMasteryRead sets the "mastery_read" field.

func (*UserWordUpdate) SetMasterySpell

func (uwu *UserWordUpdate) SetMasterySpell(i int16) *UserWordUpdate

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordUpdate) SetMasteryUse

func (uwu *UserWordUpdate) SetMasteryUse(i int16) *UserWordUpdate

SetMasteryUse sets the "mastery_use" field.

func (*UserWordUpdate) SetNillableCreatedBy

func (uwu *UserWordUpdate) SetNillableCreatedBy(s *string) *UserWordUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserWordUpdate) SetNillableLanguage

func (uwu *UserWordUpdate) SetNillableLanguage(s *string) *UserWordUpdate

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

func (*UserWordUpdate) SetNillableMasteryListen

func (uwu *UserWordUpdate) SetNillableMasteryListen(i *int16) *UserWordUpdate

SetNillableMasteryListen sets the "mastery_listen" field if the given value is not nil.

func (*UserWordUpdate) SetNillableMasteryOverall

func (uwu *UserWordUpdate) SetNillableMasteryOverall(i *int32) *UserWordUpdate

SetNillableMasteryOverall sets the "mastery_overall" field if the given value is not nil.

func (*UserWordUpdate) SetNillableMasteryPronounce

func (uwu *UserWordUpdate) SetNillableMasteryPronounce(i *int16) *UserWordUpdate

SetNillableMasteryPronounce sets the "mastery_pronounce" field if the given value is not nil.

func (*UserWordUpdate) SetNillableMasteryRead

func (uwu *UserWordUpdate) SetNillableMasteryRead(i *int16) *UserWordUpdate

SetNillableMasteryRead sets the "mastery_read" field if the given value is not nil.

func (*UserWordUpdate) SetNillableMasterySpell

func (uwu *UserWordUpdate) SetNillableMasterySpell(i *int16) *UserWordUpdate

SetNillableMasterySpell sets the "mastery_spell" field if the given value is not nil.

func (*UserWordUpdate) SetNillableMasteryUse

func (uwu *UserWordUpdate) SetNillableMasteryUse(i *int16) *UserWordUpdate

SetNillableMasteryUse sets the "mastery_use" field if the given value is not nil.

func (*UserWordUpdate) SetNillableNormalized added in v0.1.5

func (uwu *UserWordUpdate) SetNillableNormalized(s *string) *UserWordUpdate

SetNillableNormalized sets the "normalized" field if the given value is not nil.

func (*UserWordUpdate) SetNillableNotes

func (uwu *UserWordUpdate) SetNillableNotes(s *string) *UserWordUpdate

SetNillableNotes sets the "notes" field if the given value is not nil.

func (*UserWordUpdate) SetNillableQueryCount

func (uwu *UserWordUpdate) SetNillableQueryCount(i *int64) *UserWordUpdate

SetNillableQueryCount sets the "query_count" field if the given value is not nil.

func (*UserWordUpdate) SetNillableReviewFailCount

func (uwu *UserWordUpdate) SetNillableReviewFailCount(i *int32) *UserWordUpdate

SetNillableReviewFailCount sets the "review_fail_count" field if the given value is not nil.

func (*UserWordUpdate) SetNillableReviewIntervalDays

func (uwu *UserWordUpdate) SetNillableReviewIntervalDays(i *int32) *UserWordUpdate

SetNillableReviewIntervalDays sets the "review_interval_days" field if the given value is not nil.

func (*UserWordUpdate) SetNillableReviewLastReviewAt

func (uwu *UserWordUpdate) SetNillableReviewLastReviewAt(t *time.Time) *UserWordUpdate

SetNillableReviewLastReviewAt sets the "review_last_review_at" field if the given value is not nil.

func (*UserWordUpdate) SetNillableReviewNextReviewAt

func (uwu *UserWordUpdate) SetNillableReviewNextReviewAt(t *time.Time) *UserWordUpdate

SetNillableReviewNextReviewAt sets the "review_next_review_at" field if the given value is not nil.

func (*UserWordUpdate) SetNillableUserID

func (uwu *UserWordUpdate) SetNillableUserID(i *int64) *UserWordUpdate

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

func (*UserWordUpdate) SetNillableWord

func (uwu *UserWordUpdate) SetNillableWord(s *string) *UserWordUpdate

SetNillableWord sets the "word" field if the given value is not nil.

func (*UserWordUpdate) SetNormalized added in v0.1.5

func (uwu *UserWordUpdate) SetNormalized(s string) *UserWordUpdate

SetNormalized sets the "normalized" field.

func (*UserWordUpdate) SetNotes

func (uwu *UserWordUpdate) SetNotes(s string) *UserWordUpdate

SetNotes sets the "notes" field.

func (*UserWordUpdate) SetQueryCount

func (uwu *UserWordUpdate) SetQueryCount(i int64) *UserWordUpdate

SetQueryCount sets the "query_count" field.

func (*UserWordUpdate) SetRelations

func (uwu *UserWordUpdate) SetRelations(ewr []entity.UserWordRelation) *UserWordUpdate

SetRelations sets the "relations" field.

func (*UserWordUpdate) SetReviewFailCount

func (uwu *UserWordUpdate) SetReviewFailCount(i int32) *UserWordUpdate

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordUpdate) SetReviewIntervalDays

func (uwu *UserWordUpdate) SetReviewIntervalDays(i int32) *UserWordUpdate

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordUpdate) SetReviewLastReviewAt

func (uwu *UserWordUpdate) SetReviewLastReviewAt(t time.Time) *UserWordUpdate

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordUpdate) SetReviewNextReviewAt

func (uwu *UserWordUpdate) SetReviewNextReviewAt(t time.Time) *UserWordUpdate

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordUpdate) SetSentences

func (uwu *UserWordUpdate) SetSentences(e []entity.Sentence) *UserWordUpdate

SetSentences sets the "sentences" field.

func (*UserWordUpdate) SetUpdatedAt

func (uwu *UserWordUpdate) SetUpdatedAt(t time.Time) *UserWordUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserWordUpdate) SetUserID

func (uwu *UserWordUpdate) SetUserID(i int64) *UserWordUpdate

SetUserID sets the "user_id" field.

func (*UserWordUpdate) SetWord

func (uwu *UserWordUpdate) SetWord(s string) *UserWordUpdate

SetWord sets the "word" field.

func (*UserWordUpdate) Where

func (uwu *UserWordUpdate) Where(ps ...predicate.UserWord) *UserWordUpdate

Where appends a list predicates to the UserWordUpdate builder.

type UserWordUpdateOne

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

UserWordUpdateOne is the builder for updating a single UserWord entity.

func (*UserWordUpdateOne) AddMasteryListen

func (uwuo *UserWordUpdateOne) AddMasteryListen(i int16) *UserWordUpdateOne

AddMasteryListen adds i to the "mastery_listen" field.

func (*UserWordUpdateOne) AddMasteryOverall

func (uwuo *UserWordUpdateOne) AddMasteryOverall(i int32) *UserWordUpdateOne

AddMasteryOverall adds i to the "mastery_overall" field.

func (*UserWordUpdateOne) AddMasteryPronounce

func (uwuo *UserWordUpdateOne) AddMasteryPronounce(i int16) *UserWordUpdateOne

AddMasteryPronounce adds i to the "mastery_pronounce" field.

func (*UserWordUpdateOne) AddMasteryRead

func (uwuo *UserWordUpdateOne) AddMasteryRead(i int16) *UserWordUpdateOne

AddMasteryRead adds i to the "mastery_read" field.

func (*UserWordUpdateOne) AddMasterySpell

func (uwuo *UserWordUpdateOne) AddMasterySpell(i int16) *UserWordUpdateOne

AddMasterySpell adds i to the "mastery_spell" field.

func (*UserWordUpdateOne) AddMasteryUse

func (uwuo *UserWordUpdateOne) AddMasteryUse(i int16) *UserWordUpdateOne

AddMasteryUse adds i to the "mastery_use" field.

func (*UserWordUpdateOne) AddQueryCount

func (uwuo *UserWordUpdateOne) AddQueryCount(i int64) *UserWordUpdateOne

AddQueryCount adds i to the "query_count" field.

func (*UserWordUpdateOne) AddReviewFailCount

func (uwuo *UserWordUpdateOne) AddReviewFailCount(i int32) *UserWordUpdateOne

AddReviewFailCount adds i to the "review_fail_count" field.

func (*UserWordUpdateOne) AddReviewIntervalDays

func (uwuo *UserWordUpdateOne) AddReviewIntervalDays(i int32) *UserWordUpdateOne

AddReviewIntervalDays adds i to the "review_interval_days" field.

func (*UserWordUpdateOne) AddUserID

func (uwuo *UserWordUpdateOne) AddUserID(i int64) *UserWordUpdateOne

AddUserID adds i to the "user_id" field.

func (*UserWordUpdateOne) AppendRelations

func (uwuo *UserWordUpdateOne) AppendRelations(ewr []entity.UserWordRelation) *UserWordUpdateOne

AppendRelations appends ewr to the "relations" field.

func (*UserWordUpdateOne) AppendSentences

func (uwuo *UserWordUpdateOne) AppendSentences(e []entity.Sentence) *UserWordUpdateOne

AppendSentences appends e to the "sentences" field.

func (*UserWordUpdateOne) ClearNotes

func (uwuo *UserWordUpdateOne) ClearNotes() *UserWordUpdateOne

ClearNotes clears the value of the "notes" field.

func (*UserWordUpdateOne) ClearReviewLastReviewAt

func (uwuo *UserWordUpdateOne) ClearReviewLastReviewAt() *UserWordUpdateOne

ClearReviewLastReviewAt clears the value of the "review_last_review_at" field.

func (*UserWordUpdateOne) ClearReviewNextReviewAt

func (uwuo *UserWordUpdateOne) ClearReviewNextReviewAt() *UserWordUpdateOne

ClearReviewNextReviewAt clears the value of the "review_next_review_at" field.

func (*UserWordUpdateOne) Exec

func (uwuo *UserWordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserWordUpdateOne) ExecX

func (uwuo *UserWordUpdateOne) ExecX(ctx context.Context)

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

func (*UserWordUpdateOne) Mutation

func (uwuo *UserWordUpdateOne) Mutation() *UserWordMutation

Mutation returns the UserWordMutation object of the builder.

func (*UserWordUpdateOne) Save

func (uwuo *UserWordUpdateOne) Save(ctx context.Context) (*UserWord, error)

Save executes the query and returns the updated UserWord entity.

func (*UserWordUpdateOne) SaveX

func (uwuo *UserWordUpdateOne) SaveX(ctx context.Context) *UserWord

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

func (*UserWordUpdateOne) Select

func (uwuo *UserWordUpdateOne) Select(field string, fields ...string) *UserWordUpdateOne

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

func (*UserWordUpdateOne) SetCreatedBy

func (uwuo *UserWordUpdateOne) SetCreatedBy(s string) *UserWordUpdateOne

SetCreatedBy sets the "created_by" field.

func (*UserWordUpdateOne) SetLanguage

func (uwuo *UserWordUpdateOne) SetLanguage(s string) *UserWordUpdateOne

SetLanguage sets the "language" field.

func (*UserWordUpdateOne) SetMasteryListen

func (uwuo *UserWordUpdateOne) SetMasteryListen(i int16) *UserWordUpdateOne

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordUpdateOne) SetMasteryOverall

func (uwuo *UserWordUpdateOne) SetMasteryOverall(i int32) *UserWordUpdateOne

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordUpdateOne) SetMasteryPronounce

func (uwuo *UserWordUpdateOne) SetMasteryPronounce(i int16) *UserWordUpdateOne

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordUpdateOne) SetMasteryRead

func (uwuo *UserWordUpdateOne) SetMasteryRead(i int16) *UserWordUpdateOne

SetMasteryRead sets the "mastery_read" field.

func (*UserWordUpdateOne) SetMasterySpell

func (uwuo *UserWordUpdateOne) SetMasterySpell(i int16) *UserWordUpdateOne

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordUpdateOne) SetMasteryUse

func (uwuo *UserWordUpdateOne) SetMasteryUse(i int16) *UserWordUpdateOne

SetMasteryUse sets the "mastery_use" field.

func (*UserWordUpdateOne) SetNillableCreatedBy

func (uwuo *UserWordUpdateOne) SetNillableCreatedBy(s *string) *UserWordUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableLanguage

func (uwuo *UserWordUpdateOne) SetNillableLanguage(s *string) *UserWordUpdateOne

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

func (*UserWordUpdateOne) SetNillableMasteryListen

func (uwuo *UserWordUpdateOne) SetNillableMasteryListen(i *int16) *UserWordUpdateOne

SetNillableMasteryListen sets the "mastery_listen" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableMasteryOverall

func (uwuo *UserWordUpdateOne) SetNillableMasteryOverall(i *int32) *UserWordUpdateOne

SetNillableMasteryOverall sets the "mastery_overall" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableMasteryPronounce

func (uwuo *UserWordUpdateOne) SetNillableMasteryPronounce(i *int16) *UserWordUpdateOne

SetNillableMasteryPronounce sets the "mastery_pronounce" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableMasteryRead

func (uwuo *UserWordUpdateOne) SetNillableMasteryRead(i *int16) *UserWordUpdateOne

SetNillableMasteryRead sets the "mastery_read" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableMasterySpell

func (uwuo *UserWordUpdateOne) SetNillableMasterySpell(i *int16) *UserWordUpdateOne

SetNillableMasterySpell sets the "mastery_spell" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableMasteryUse

func (uwuo *UserWordUpdateOne) SetNillableMasteryUse(i *int16) *UserWordUpdateOne

SetNillableMasteryUse sets the "mastery_use" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableNormalized added in v0.1.5

func (uwuo *UserWordUpdateOne) SetNillableNormalized(s *string) *UserWordUpdateOne

SetNillableNormalized sets the "normalized" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableNotes

func (uwuo *UserWordUpdateOne) SetNillableNotes(s *string) *UserWordUpdateOne

SetNillableNotes sets the "notes" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableQueryCount

func (uwuo *UserWordUpdateOne) SetNillableQueryCount(i *int64) *UserWordUpdateOne

SetNillableQueryCount sets the "query_count" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableReviewFailCount

func (uwuo *UserWordUpdateOne) SetNillableReviewFailCount(i *int32) *UserWordUpdateOne

SetNillableReviewFailCount sets the "review_fail_count" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableReviewIntervalDays

func (uwuo *UserWordUpdateOne) SetNillableReviewIntervalDays(i *int32) *UserWordUpdateOne

SetNillableReviewIntervalDays sets the "review_interval_days" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableReviewLastReviewAt

func (uwuo *UserWordUpdateOne) SetNillableReviewLastReviewAt(t *time.Time) *UserWordUpdateOne

SetNillableReviewLastReviewAt sets the "review_last_review_at" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableReviewNextReviewAt

func (uwuo *UserWordUpdateOne) SetNillableReviewNextReviewAt(t *time.Time) *UserWordUpdateOne

SetNillableReviewNextReviewAt sets the "review_next_review_at" field if the given value is not nil.

func (*UserWordUpdateOne) SetNillableUserID

func (uwuo *UserWordUpdateOne) SetNillableUserID(i *int64) *UserWordUpdateOne

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

func (*UserWordUpdateOne) SetNillableWord

func (uwuo *UserWordUpdateOne) SetNillableWord(s *string) *UserWordUpdateOne

SetNillableWord sets the "word" field if the given value is not nil.

func (*UserWordUpdateOne) SetNormalized added in v0.1.5

func (uwuo *UserWordUpdateOne) SetNormalized(s string) *UserWordUpdateOne

SetNormalized sets the "normalized" field.

func (*UserWordUpdateOne) SetNotes

func (uwuo *UserWordUpdateOne) SetNotes(s string) *UserWordUpdateOne

SetNotes sets the "notes" field.

func (*UserWordUpdateOne) SetQueryCount

func (uwuo *UserWordUpdateOne) SetQueryCount(i int64) *UserWordUpdateOne

SetQueryCount sets the "query_count" field.

func (*UserWordUpdateOne) SetRelations

func (uwuo *UserWordUpdateOne) SetRelations(ewr []entity.UserWordRelation) *UserWordUpdateOne

SetRelations sets the "relations" field.

func (*UserWordUpdateOne) SetReviewFailCount

func (uwuo *UserWordUpdateOne) SetReviewFailCount(i int32) *UserWordUpdateOne

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordUpdateOne) SetReviewIntervalDays

func (uwuo *UserWordUpdateOne) SetReviewIntervalDays(i int32) *UserWordUpdateOne

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordUpdateOne) SetReviewLastReviewAt

func (uwuo *UserWordUpdateOne) SetReviewLastReviewAt(t time.Time) *UserWordUpdateOne

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordUpdateOne) SetReviewNextReviewAt

func (uwuo *UserWordUpdateOne) SetReviewNextReviewAt(t time.Time) *UserWordUpdateOne

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordUpdateOne) SetSentences

func (uwuo *UserWordUpdateOne) SetSentences(e []entity.Sentence) *UserWordUpdateOne

SetSentences sets the "sentences" field.

func (*UserWordUpdateOne) SetUpdatedAt

func (uwuo *UserWordUpdateOne) SetUpdatedAt(t time.Time) *UserWordUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserWordUpdateOne) SetUserID

func (uwuo *UserWordUpdateOne) SetUserID(i int64) *UserWordUpdateOne

SetUserID sets the "user_id" field.

func (*UserWordUpdateOne) SetWord

func (uwuo *UserWordUpdateOne) SetWord(s string) *UserWordUpdateOne

SetWord sets the "word" field.

func (*UserWordUpdateOne) Where

Where appends a list predicates to the UserWordUpdate builder.

type UserWordUpsert added in v0.1.1

type UserWordUpsert struct {
	*sql.UpdateSet
}

UserWordUpsert is the "OnConflict" setter.

func (*UserWordUpsert) AddMasteryListen added in v0.1.1

func (u *UserWordUpsert) AddMasteryListen(v int16) *UserWordUpsert

AddMasteryListen adds v to the "mastery_listen" field.

func (*UserWordUpsert) AddMasteryOverall added in v0.1.1

func (u *UserWordUpsert) AddMasteryOverall(v int32) *UserWordUpsert

AddMasteryOverall adds v to the "mastery_overall" field.

func (*UserWordUpsert) AddMasteryPronounce added in v0.1.1

func (u *UserWordUpsert) AddMasteryPronounce(v int16) *UserWordUpsert

AddMasteryPronounce adds v to the "mastery_pronounce" field.

func (*UserWordUpsert) AddMasteryRead added in v0.1.1

func (u *UserWordUpsert) AddMasteryRead(v int16) *UserWordUpsert

AddMasteryRead adds v to the "mastery_read" field.

func (*UserWordUpsert) AddMasterySpell added in v0.1.1

func (u *UserWordUpsert) AddMasterySpell(v int16) *UserWordUpsert

AddMasterySpell adds v to the "mastery_spell" field.

func (*UserWordUpsert) AddMasteryUse added in v0.1.1

func (u *UserWordUpsert) AddMasteryUse(v int16) *UserWordUpsert

AddMasteryUse adds v to the "mastery_use" field.

func (*UserWordUpsert) AddQueryCount added in v0.1.1

func (u *UserWordUpsert) AddQueryCount(v int64) *UserWordUpsert

AddQueryCount adds v to the "query_count" field.

func (*UserWordUpsert) AddReviewFailCount added in v0.1.1

func (u *UserWordUpsert) AddReviewFailCount(v int32) *UserWordUpsert

AddReviewFailCount adds v to the "review_fail_count" field.

func (*UserWordUpsert) AddReviewIntervalDays added in v0.1.1

func (u *UserWordUpsert) AddReviewIntervalDays(v int32) *UserWordUpsert

AddReviewIntervalDays adds v to the "review_interval_days" field.

func (*UserWordUpsert) AddUserID added in v0.1.1

func (u *UserWordUpsert) AddUserID(v int64) *UserWordUpsert

AddUserID adds v to the "user_id" field.

func (*UserWordUpsert) ClearNotes added in v0.1.1

func (u *UserWordUpsert) ClearNotes() *UserWordUpsert

ClearNotes clears the value of the "notes" field.

func (*UserWordUpsert) ClearReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsert) ClearReviewLastReviewAt() *UserWordUpsert

ClearReviewLastReviewAt clears the value of the "review_last_review_at" field.

func (*UserWordUpsert) ClearReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsert) ClearReviewNextReviewAt() *UserWordUpsert

ClearReviewNextReviewAt clears the value of the "review_next_review_at" field.

func (*UserWordUpsert) SetCreatedBy added in v0.1.1

func (u *UserWordUpsert) SetCreatedBy(v string) *UserWordUpsert

SetCreatedBy sets the "created_by" field.

func (*UserWordUpsert) SetLanguage added in v0.1.1

func (u *UserWordUpsert) SetLanguage(v string) *UserWordUpsert

SetLanguage sets the "language" field.

func (*UserWordUpsert) SetMasteryListen added in v0.1.1

func (u *UserWordUpsert) SetMasteryListen(v int16) *UserWordUpsert

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordUpsert) SetMasteryOverall added in v0.1.1

func (u *UserWordUpsert) SetMasteryOverall(v int32) *UserWordUpsert

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordUpsert) SetMasteryPronounce added in v0.1.1

func (u *UserWordUpsert) SetMasteryPronounce(v int16) *UserWordUpsert

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordUpsert) SetMasteryRead added in v0.1.1

func (u *UserWordUpsert) SetMasteryRead(v int16) *UserWordUpsert

SetMasteryRead sets the "mastery_read" field.

func (*UserWordUpsert) SetMasterySpell added in v0.1.1

func (u *UserWordUpsert) SetMasterySpell(v int16) *UserWordUpsert

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordUpsert) SetMasteryUse added in v0.1.1

func (u *UserWordUpsert) SetMasteryUse(v int16) *UserWordUpsert

SetMasteryUse sets the "mastery_use" field.

func (*UserWordUpsert) SetNormalized added in v0.1.5

func (u *UserWordUpsert) SetNormalized(v string) *UserWordUpsert

SetNormalized sets the "normalized" field.

func (*UserWordUpsert) SetNotes added in v0.1.1

func (u *UserWordUpsert) SetNotes(v string) *UserWordUpsert

SetNotes sets the "notes" field.

func (*UserWordUpsert) SetQueryCount added in v0.1.1

func (u *UserWordUpsert) SetQueryCount(v int64) *UserWordUpsert

SetQueryCount sets the "query_count" field.

func (*UserWordUpsert) SetRelations added in v0.1.1

func (u *UserWordUpsert) SetRelations(v []entity.UserWordRelation) *UserWordUpsert

SetRelations sets the "relations" field.

func (*UserWordUpsert) SetReviewFailCount added in v0.1.1

func (u *UserWordUpsert) SetReviewFailCount(v int32) *UserWordUpsert

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordUpsert) SetReviewIntervalDays added in v0.1.1

func (u *UserWordUpsert) SetReviewIntervalDays(v int32) *UserWordUpsert

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordUpsert) SetReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsert) SetReviewLastReviewAt(v time.Time) *UserWordUpsert

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordUpsert) SetReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsert) SetReviewNextReviewAt(v time.Time) *UserWordUpsert

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordUpsert) SetSentences added in v0.1.1

func (u *UserWordUpsert) SetSentences(v []entity.Sentence) *UserWordUpsert

SetSentences sets the "sentences" field.

func (*UserWordUpsert) SetUpdatedAt added in v0.1.1

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

SetUpdatedAt sets the "updated_at" field.

func (*UserWordUpsert) SetUserID added in v0.1.1

func (u *UserWordUpsert) SetUserID(v int64) *UserWordUpsert

SetUserID sets the "user_id" field.

func (*UserWordUpsert) SetWord added in v0.1.1

func (u *UserWordUpsert) SetWord(v string) *UserWordUpsert

SetWord sets the "word" field.

func (*UserWordUpsert) UpdateCreatedBy added in v0.1.1

func (u *UserWordUpsert) UpdateCreatedBy() *UserWordUpsert

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

func (*UserWordUpsert) UpdateLanguage added in v0.1.1

func (u *UserWordUpsert) UpdateLanguage() *UserWordUpsert

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

func (*UserWordUpsert) UpdateMasteryListen added in v0.1.1

func (u *UserWordUpsert) UpdateMasteryListen() *UserWordUpsert

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

func (*UserWordUpsert) UpdateMasteryOverall added in v0.1.1

func (u *UserWordUpsert) UpdateMasteryOverall() *UserWordUpsert

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

func (*UserWordUpsert) UpdateMasteryPronounce added in v0.1.1

func (u *UserWordUpsert) UpdateMasteryPronounce() *UserWordUpsert

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

func (*UserWordUpsert) UpdateMasteryRead added in v0.1.1

func (u *UserWordUpsert) UpdateMasteryRead() *UserWordUpsert

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

func (*UserWordUpsert) UpdateMasterySpell added in v0.1.1

func (u *UserWordUpsert) UpdateMasterySpell() *UserWordUpsert

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

func (*UserWordUpsert) UpdateMasteryUse added in v0.1.1

func (u *UserWordUpsert) UpdateMasteryUse() *UserWordUpsert

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

func (*UserWordUpsert) UpdateNormalized added in v0.1.5

func (u *UserWordUpsert) UpdateNormalized() *UserWordUpsert

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

func (*UserWordUpsert) UpdateNotes added in v0.1.1

func (u *UserWordUpsert) UpdateNotes() *UserWordUpsert

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

func (*UserWordUpsert) UpdateQueryCount added in v0.1.1

func (u *UserWordUpsert) UpdateQueryCount() *UserWordUpsert

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

func (*UserWordUpsert) UpdateRelations added in v0.1.1

func (u *UserWordUpsert) UpdateRelations() *UserWordUpsert

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

func (*UserWordUpsert) UpdateReviewFailCount added in v0.1.1

func (u *UserWordUpsert) UpdateReviewFailCount() *UserWordUpsert

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

func (*UserWordUpsert) UpdateReviewIntervalDays added in v0.1.1

func (u *UserWordUpsert) UpdateReviewIntervalDays() *UserWordUpsert

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

func (*UserWordUpsert) UpdateReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsert) UpdateReviewLastReviewAt() *UserWordUpsert

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

func (*UserWordUpsert) UpdateReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsert) UpdateReviewNextReviewAt() *UserWordUpsert

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

func (*UserWordUpsert) UpdateSentences added in v0.1.1

func (u *UserWordUpsert) UpdateSentences() *UserWordUpsert

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

func (*UserWordUpsert) UpdateUpdatedAt added in v0.1.1

func (u *UserWordUpsert) UpdateUpdatedAt() *UserWordUpsert

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

func (*UserWordUpsert) UpdateUserID added in v0.1.1

func (u *UserWordUpsert) UpdateUserID() *UserWordUpsert

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

func (*UserWordUpsert) UpdateWord added in v0.1.1

func (u *UserWordUpsert) UpdateWord() *UserWordUpsert

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

type UserWordUpsertBulk added in v0.1.1

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

UserWordUpsertBulk is the builder for "upsert"-ing a bulk of UserWord nodes.

func (*UserWordUpsertBulk) AddMasteryListen added in v0.1.1

func (u *UserWordUpsertBulk) AddMasteryListen(v int16) *UserWordUpsertBulk

AddMasteryListen adds v to the "mastery_listen" field.

func (*UserWordUpsertBulk) AddMasteryOverall added in v0.1.1

func (u *UserWordUpsertBulk) AddMasteryOverall(v int32) *UserWordUpsertBulk

AddMasteryOverall adds v to the "mastery_overall" field.

func (*UserWordUpsertBulk) AddMasteryPronounce added in v0.1.1

func (u *UserWordUpsertBulk) AddMasteryPronounce(v int16) *UserWordUpsertBulk

AddMasteryPronounce adds v to the "mastery_pronounce" field.

func (*UserWordUpsertBulk) AddMasteryRead added in v0.1.1

func (u *UserWordUpsertBulk) AddMasteryRead(v int16) *UserWordUpsertBulk

AddMasteryRead adds v to the "mastery_read" field.

func (*UserWordUpsertBulk) AddMasterySpell added in v0.1.1

func (u *UserWordUpsertBulk) AddMasterySpell(v int16) *UserWordUpsertBulk

AddMasterySpell adds v to the "mastery_spell" field.

func (*UserWordUpsertBulk) AddMasteryUse added in v0.1.1

func (u *UserWordUpsertBulk) AddMasteryUse(v int16) *UserWordUpsertBulk

AddMasteryUse adds v to the "mastery_use" field.

func (*UserWordUpsertBulk) AddQueryCount added in v0.1.1

func (u *UserWordUpsertBulk) AddQueryCount(v int64) *UserWordUpsertBulk

AddQueryCount adds v to the "query_count" field.

func (*UserWordUpsertBulk) AddReviewFailCount added in v0.1.1

func (u *UserWordUpsertBulk) AddReviewFailCount(v int32) *UserWordUpsertBulk

AddReviewFailCount adds v to the "review_fail_count" field.

func (*UserWordUpsertBulk) AddReviewIntervalDays added in v0.1.1

func (u *UserWordUpsertBulk) AddReviewIntervalDays(v int32) *UserWordUpsertBulk

AddReviewIntervalDays adds v to the "review_interval_days" field.

func (*UserWordUpsertBulk) AddUserID added in v0.1.1

func (u *UserWordUpsertBulk) AddUserID(v int64) *UserWordUpsertBulk

AddUserID adds v to the "user_id" field.

func (*UserWordUpsertBulk) ClearNotes added in v0.1.1

func (u *UserWordUpsertBulk) ClearNotes() *UserWordUpsertBulk

ClearNotes clears the value of the "notes" field.

func (*UserWordUpsertBulk) ClearReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsertBulk) ClearReviewLastReviewAt() *UserWordUpsertBulk

ClearReviewLastReviewAt clears the value of the "review_last_review_at" field.

func (*UserWordUpsertBulk) ClearReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsertBulk) ClearReviewNextReviewAt() *UserWordUpsertBulk

ClearReviewNextReviewAt clears the value of the "review_next_review_at" field.

func (*UserWordUpsertBulk) DoNothing added in v0.1.1

func (u *UserWordUpsertBulk) DoNothing() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) Exec added in v0.1.1

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

Exec executes the query.

func (*UserWordUpsertBulk) ExecX added in v0.1.1

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

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

func (*UserWordUpsertBulk) Ignore added in v0.1.1

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

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

func (*UserWordUpsertBulk) SetCreatedBy added in v0.1.1

func (u *UserWordUpsertBulk) SetCreatedBy(v string) *UserWordUpsertBulk

SetCreatedBy sets the "created_by" field.

func (*UserWordUpsertBulk) SetLanguage added in v0.1.1

func (u *UserWordUpsertBulk) SetLanguage(v string) *UserWordUpsertBulk

SetLanguage sets the "language" field.

func (*UserWordUpsertBulk) SetMasteryListen added in v0.1.1

func (u *UserWordUpsertBulk) SetMasteryListen(v int16) *UserWordUpsertBulk

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordUpsertBulk) SetMasteryOverall added in v0.1.1

func (u *UserWordUpsertBulk) SetMasteryOverall(v int32) *UserWordUpsertBulk

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordUpsertBulk) SetMasteryPronounce added in v0.1.1

func (u *UserWordUpsertBulk) SetMasteryPronounce(v int16) *UserWordUpsertBulk

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordUpsertBulk) SetMasteryRead added in v0.1.1

func (u *UserWordUpsertBulk) SetMasteryRead(v int16) *UserWordUpsertBulk

SetMasteryRead sets the "mastery_read" field.

func (*UserWordUpsertBulk) SetMasterySpell added in v0.1.1

func (u *UserWordUpsertBulk) SetMasterySpell(v int16) *UserWordUpsertBulk

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordUpsertBulk) SetMasteryUse added in v0.1.1

func (u *UserWordUpsertBulk) SetMasteryUse(v int16) *UserWordUpsertBulk

SetMasteryUse sets the "mastery_use" field.

func (*UserWordUpsertBulk) SetNormalized added in v0.1.5

func (u *UserWordUpsertBulk) SetNormalized(v string) *UserWordUpsertBulk

SetNormalized sets the "normalized" field.

func (*UserWordUpsertBulk) SetNotes added in v0.1.1

SetNotes sets the "notes" field.

func (*UserWordUpsertBulk) SetQueryCount added in v0.1.1

func (u *UserWordUpsertBulk) SetQueryCount(v int64) *UserWordUpsertBulk

SetQueryCount sets the "query_count" field.

func (*UserWordUpsertBulk) SetRelations added in v0.1.1

SetRelations sets the "relations" field.

func (*UserWordUpsertBulk) SetReviewFailCount added in v0.1.1

func (u *UserWordUpsertBulk) SetReviewFailCount(v int32) *UserWordUpsertBulk

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordUpsertBulk) SetReviewIntervalDays added in v0.1.1

func (u *UserWordUpsertBulk) SetReviewIntervalDays(v int32) *UserWordUpsertBulk

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordUpsertBulk) SetReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsertBulk) SetReviewLastReviewAt(v time.Time) *UserWordUpsertBulk

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordUpsertBulk) SetReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsertBulk) SetReviewNextReviewAt(v time.Time) *UserWordUpsertBulk

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordUpsertBulk) SetSentences added in v0.1.1

func (u *UserWordUpsertBulk) SetSentences(v []entity.Sentence) *UserWordUpsertBulk

SetSentences sets the "sentences" field.

func (*UserWordUpsertBulk) SetUpdatedAt added in v0.1.1

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

SetUpdatedAt sets the "updated_at" field.

func (*UserWordUpsertBulk) SetUserID added in v0.1.1

func (u *UserWordUpsertBulk) SetUserID(v int64) *UserWordUpsertBulk

SetUserID sets the "user_id" field.

func (*UserWordUpsertBulk) SetWord added in v0.1.1

SetWord sets the "word" field.

func (*UserWordUpsertBulk) Update added in v0.1.1

func (u *UserWordUpsertBulk) Update(set func(*UserWordUpsert)) *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateCreatedBy added in v0.1.1

func (u *UserWordUpsertBulk) UpdateCreatedBy() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateLanguage added in v0.1.1

func (u *UserWordUpsertBulk) UpdateLanguage() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateMasteryListen added in v0.1.1

func (u *UserWordUpsertBulk) UpdateMasteryListen() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateMasteryOverall added in v0.1.1

func (u *UserWordUpsertBulk) UpdateMasteryOverall() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateMasteryPronounce added in v0.1.1

func (u *UserWordUpsertBulk) UpdateMasteryPronounce() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateMasteryRead added in v0.1.1

func (u *UserWordUpsertBulk) UpdateMasteryRead() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateMasterySpell added in v0.1.1

func (u *UserWordUpsertBulk) UpdateMasterySpell() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateMasteryUse added in v0.1.1

func (u *UserWordUpsertBulk) UpdateMasteryUse() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateNewValues added in v0.1.1

func (u *UserWordUpsertBulk) UpdateNewValues() *UserWordUpsertBulk

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

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

func (*UserWordUpsertBulk) UpdateNormalized added in v0.1.5

func (u *UserWordUpsertBulk) UpdateNormalized() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateNotes added in v0.1.1

func (u *UserWordUpsertBulk) UpdateNotes() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateQueryCount added in v0.1.1

func (u *UserWordUpsertBulk) UpdateQueryCount() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateRelations added in v0.1.1

func (u *UserWordUpsertBulk) UpdateRelations() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateReviewFailCount added in v0.1.1

func (u *UserWordUpsertBulk) UpdateReviewFailCount() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateReviewIntervalDays added in v0.1.1

func (u *UserWordUpsertBulk) UpdateReviewIntervalDays() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsertBulk) UpdateReviewLastReviewAt() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsertBulk) UpdateReviewNextReviewAt() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateSentences added in v0.1.1

func (u *UserWordUpsertBulk) UpdateSentences() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateUpdatedAt added in v0.1.1

func (u *UserWordUpsertBulk) UpdateUpdatedAt() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateUserID added in v0.1.1

func (u *UserWordUpsertBulk) UpdateUserID() *UserWordUpsertBulk

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

func (*UserWordUpsertBulk) UpdateWord added in v0.1.1

func (u *UserWordUpsertBulk) UpdateWord() *UserWordUpsertBulk

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

type UserWordUpsertOne added in v0.1.1

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

UserWordUpsertOne is the builder for "upsert"-ing

one UserWord node.

func (*UserWordUpsertOne) AddMasteryListen added in v0.1.1

func (u *UserWordUpsertOne) AddMasteryListen(v int16) *UserWordUpsertOne

AddMasteryListen adds v to the "mastery_listen" field.

func (*UserWordUpsertOne) AddMasteryOverall added in v0.1.1

func (u *UserWordUpsertOne) AddMasteryOverall(v int32) *UserWordUpsertOne

AddMasteryOverall adds v to the "mastery_overall" field.

func (*UserWordUpsertOne) AddMasteryPronounce added in v0.1.1

func (u *UserWordUpsertOne) AddMasteryPronounce(v int16) *UserWordUpsertOne

AddMasteryPronounce adds v to the "mastery_pronounce" field.

func (*UserWordUpsertOne) AddMasteryRead added in v0.1.1

func (u *UserWordUpsertOne) AddMasteryRead(v int16) *UserWordUpsertOne

AddMasteryRead adds v to the "mastery_read" field.

func (*UserWordUpsertOne) AddMasterySpell added in v0.1.1

func (u *UserWordUpsertOne) AddMasterySpell(v int16) *UserWordUpsertOne

AddMasterySpell adds v to the "mastery_spell" field.

func (*UserWordUpsertOne) AddMasteryUse added in v0.1.1

func (u *UserWordUpsertOne) AddMasteryUse(v int16) *UserWordUpsertOne

AddMasteryUse adds v to the "mastery_use" field.

func (*UserWordUpsertOne) AddQueryCount added in v0.1.1

func (u *UserWordUpsertOne) AddQueryCount(v int64) *UserWordUpsertOne

AddQueryCount adds v to the "query_count" field.

func (*UserWordUpsertOne) AddReviewFailCount added in v0.1.1

func (u *UserWordUpsertOne) AddReviewFailCount(v int32) *UserWordUpsertOne

AddReviewFailCount adds v to the "review_fail_count" field.

func (*UserWordUpsertOne) AddReviewIntervalDays added in v0.1.1

func (u *UserWordUpsertOne) AddReviewIntervalDays(v int32) *UserWordUpsertOne

AddReviewIntervalDays adds v to the "review_interval_days" field.

func (*UserWordUpsertOne) AddUserID added in v0.1.1

func (u *UserWordUpsertOne) AddUserID(v int64) *UserWordUpsertOne

AddUserID adds v to the "user_id" field.

func (*UserWordUpsertOne) ClearNotes added in v0.1.1

func (u *UserWordUpsertOne) ClearNotes() *UserWordUpsertOne

ClearNotes clears the value of the "notes" field.

func (*UserWordUpsertOne) ClearReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsertOne) ClearReviewLastReviewAt() *UserWordUpsertOne

ClearReviewLastReviewAt clears the value of the "review_last_review_at" field.

func (*UserWordUpsertOne) ClearReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsertOne) ClearReviewNextReviewAt() *UserWordUpsertOne

ClearReviewNextReviewAt clears the value of the "review_next_review_at" field.

func (*UserWordUpsertOne) DoNothing added in v0.1.1

func (u *UserWordUpsertOne) DoNothing() *UserWordUpsertOne

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

func (*UserWordUpsertOne) Exec added in v0.1.1

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

Exec executes the query.

func (*UserWordUpsertOne) ExecX added in v0.1.1

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

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

func (*UserWordUpsertOne) ID added in v0.1.1

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

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

func (*UserWordUpsertOne) IDX added in v0.1.1

func (u *UserWordUpsertOne) IDX(ctx context.Context) int

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

func (*UserWordUpsertOne) Ignore added in v0.1.1

func (u *UserWordUpsertOne) Ignore() *UserWordUpsertOne

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

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

func (*UserWordUpsertOne) SetCreatedBy added in v0.1.1

func (u *UserWordUpsertOne) SetCreatedBy(v string) *UserWordUpsertOne

SetCreatedBy sets the "created_by" field.

func (*UserWordUpsertOne) SetLanguage added in v0.1.1

func (u *UserWordUpsertOne) SetLanguage(v string) *UserWordUpsertOne

SetLanguage sets the "language" field.

func (*UserWordUpsertOne) SetMasteryListen added in v0.1.1

func (u *UserWordUpsertOne) SetMasteryListen(v int16) *UserWordUpsertOne

SetMasteryListen sets the "mastery_listen" field.

func (*UserWordUpsertOne) SetMasteryOverall added in v0.1.1

func (u *UserWordUpsertOne) SetMasteryOverall(v int32) *UserWordUpsertOne

SetMasteryOverall sets the "mastery_overall" field.

func (*UserWordUpsertOne) SetMasteryPronounce added in v0.1.1

func (u *UserWordUpsertOne) SetMasteryPronounce(v int16) *UserWordUpsertOne

SetMasteryPronounce sets the "mastery_pronounce" field.

func (*UserWordUpsertOne) SetMasteryRead added in v0.1.1

func (u *UserWordUpsertOne) SetMasteryRead(v int16) *UserWordUpsertOne

SetMasteryRead sets the "mastery_read" field.

func (*UserWordUpsertOne) SetMasterySpell added in v0.1.1

func (u *UserWordUpsertOne) SetMasterySpell(v int16) *UserWordUpsertOne

SetMasterySpell sets the "mastery_spell" field.

func (*UserWordUpsertOne) SetMasteryUse added in v0.1.1

func (u *UserWordUpsertOne) SetMasteryUse(v int16) *UserWordUpsertOne

SetMasteryUse sets the "mastery_use" field.

func (*UserWordUpsertOne) SetNormalized added in v0.1.5

func (u *UserWordUpsertOne) SetNormalized(v string) *UserWordUpsertOne

SetNormalized sets the "normalized" field.

func (*UserWordUpsertOne) SetNotes added in v0.1.1

func (u *UserWordUpsertOne) SetNotes(v string) *UserWordUpsertOne

SetNotes sets the "notes" field.

func (*UserWordUpsertOne) SetQueryCount added in v0.1.1

func (u *UserWordUpsertOne) SetQueryCount(v int64) *UserWordUpsertOne

SetQueryCount sets the "query_count" field.

func (*UserWordUpsertOne) SetRelations added in v0.1.1

SetRelations sets the "relations" field.

func (*UserWordUpsertOne) SetReviewFailCount added in v0.1.1

func (u *UserWordUpsertOne) SetReviewFailCount(v int32) *UserWordUpsertOne

SetReviewFailCount sets the "review_fail_count" field.

func (*UserWordUpsertOne) SetReviewIntervalDays added in v0.1.1

func (u *UserWordUpsertOne) SetReviewIntervalDays(v int32) *UserWordUpsertOne

SetReviewIntervalDays sets the "review_interval_days" field.

func (*UserWordUpsertOne) SetReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsertOne) SetReviewLastReviewAt(v time.Time) *UserWordUpsertOne

SetReviewLastReviewAt sets the "review_last_review_at" field.

func (*UserWordUpsertOne) SetReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsertOne) SetReviewNextReviewAt(v time.Time) *UserWordUpsertOne

SetReviewNextReviewAt sets the "review_next_review_at" field.

func (*UserWordUpsertOne) SetSentences added in v0.1.1

func (u *UserWordUpsertOne) SetSentences(v []entity.Sentence) *UserWordUpsertOne

SetSentences sets the "sentences" field.

func (*UserWordUpsertOne) SetUpdatedAt added in v0.1.1

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

SetUpdatedAt sets the "updated_at" field.

func (*UserWordUpsertOne) SetUserID added in v0.1.1

func (u *UserWordUpsertOne) SetUserID(v int64) *UserWordUpsertOne

SetUserID sets the "user_id" field.

func (*UserWordUpsertOne) SetWord added in v0.1.1

SetWord sets the "word" field.

func (*UserWordUpsertOne) Update added in v0.1.1

func (u *UserWordUpsertOne) Update(set func(*UserWordUpsert)) *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateCreatedBy added in v0.1.1

func (u *UserWordUpsertOne) UpdateCreatedBy() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateLanguage added in v0.1.1

func (u *UserWordUpsertOne) UpdateLanguage() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateMasteryListen added in v0.1.1

func (u *UserWordUpsertOne) UpdateMasteryListen() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateMasteryOverall added in v0.1.1

func (u *UserWordUpsertOne) UpdateMasteryOverall() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateMasteryPronounce added in v0.1.1

func (u *UserWordUpsertOne) UpdateMasteryPronounce() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateMasteryRead added in v0.1.1

func (u *UserWordUpsertOne) UpdateMasteryRead() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateMasterySpell added in v0.1.1

func (u *UserWordUpsertOne) UpdateMasterySpell() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateMasteryUse added in v0.1.1

func (u *UserWordUpsertOne) UpdateMasteryUse() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateNewValues added in v0.1.1

func (u *UserWordUpsertOne) UpdateNewValues() *UserWordUpsertOne

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

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

func (*UserWordUpsertOne) UpdateNormalized added in v0.1.5

func (u *UserWordUpsertOne) UpdateNormalized() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateNotes added in v0.1.1

func (u *UserWordUpsertOne) UpdateNotes() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateQueryCount added in v0.1.1

func (u *UserWordUpsertOne) UpdateQueryCount() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateRelations added in v0.1.1

func (u *UserWordUpsertOne) UpdateRelations() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateReviewFailCount added in v0.1.1

func (u *UserWordUpsertOne) UpdateReviewFailCount() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateReviewIntervalDays added in v0.1.1

func (u *UserWordUpsertOne) UpdateReviewIntervalDays() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateReviewLastReviewAt added in v0.1.1

func (u *UserWordUpsertOne) UpdateReviewLastReviewAt() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateReviewNextReviewAt added in v0.1.1

func (u *UserWordUpsertOne) UpdateReviewNextReviewAt() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateSentences added in v0.1.1

func (u *UserWordUpsertOne) UpdateSentences() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateUpdatedAt added in v0.1.1

func (u *UserWordUpsertOne) UpdateUpdatedAt() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateUserID added in v0.1.1

func (u *UserWordUpsertOne) UpdateUserID() *UserWordUpsertOne

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

func (*UserWordUpsertOne) UpdateWord added in v0.1.1

func (u *UserWordUpsertOne) UpdateWord() *UserWordUpsertOne

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

type UserWords

type UserWords []*UserWord

UserWords is a parsable slice of UserWord.

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.

type Word

type Word struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Normalized holds the value of the "normalized" field.
	Normalized string `json:"normalized,omitempty"`
	// Language holds the value of the "language" field.
	Language string `json:"language,omitempty"`
	// WordType holds the value of the "word_type" field.
	WordType string `json:"word_type,omitempty"`
	// Lemma holds the value of the "lemma" field.
	Lemma *string `json:"lemma,omitempty"`
	// Phonetics holds the value of the "phonetics" field.
	Phonetics []entity.WordPhonetic `json:"phonetics,omitempty"`
	// Meanings holds the value of the "meanings" field.
	Meanings []entity.WordDefinition `json:"meanings,omitempty"`
	// Tags holds the value of the "tags" field.
	Tags []string `json:"tags,omitempty"`
	// Phrases holds the value of the "phrases" field.
	Phrases []entity.Phrase `json:"phrases,omitempty"`
	// Sentences holds the value of the "sentences" field.
	Sentences []entity.Sentence `json:"sentences,omitempty"`
	// Relations holds the value of the "relations" field.
	Relations []entity.WordRelation `json:"relations,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"`
	// contains filtered or unexported fields
}

Word is the model entity for the Word schema.

func (*Word) String

func (w *Word) String() string

String implements the fmt.Stringer.

func (*Word) Unwrap

func (w *Word) Unwrap() *Word

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

func (w *Word) Update() *WordUpdateOne

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

func (*Word) Value

func (w *Word) Value(name string) (ent.Value, error)

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

type WordClient

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

WordClient is a client for the Word schema.

func NewWordClient

func NewWordClient(c config) *WordClient

NewWordClient returns a client for the Word from the given config.

func (*WordClient) Create

func (c *WordClient) Create() *WordCreate

Create returns a builder for creating a Word entity.

func (*WordClient) CreateBulk

func (c *WordClient) CreateBulk(builders ...*WordCreate) *WordCreateBulk

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

func (*WordClient) Delete

func (c *WordClient) Delete() *WordDelete

Delete returns a delete builder for Word.

func (*WordClient) DeleteOne

func (c *WordClient) DeleteOne(w *Word) *WordDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WordClient) DeleteOneID

func (c *WordClient) DeleteOneID(id int) *WordDeleteOne

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

func (*WordClient) Get

func (c *WordClient) Get(ctx context.Context, id int) (*Word, error)

Get returns a Word entity by its id.

func (*WordClient) GetX

func (c *WordClient) GetX(ctx context.Context, id int) *Word

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

func (*WordClient) Hooks

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

Hooks returns the client hooks.

func (*WordClient) Intercept

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

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

func (*WordClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WordClient) MapCreateBulk

func (c *WordClient) MapCreateBulk(slice any, setFunc func(*WordCreate, int)) *WordCreateBulk

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

func (*WordClient) Query

func (c *WordClient) Query() *WordQuery

Query returns a query builder for Word.

func (*WordClient) Update

func (c *WordClient) Update() *WordUpdate

Update returns an update builder for Word.

func (*WordClient) UpdateOne

func (c *WordClient) UpdateOne(w *Word) *WordUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WordClient) UpdateOneID

func (c *WordClient) UpdateOneID(id int) *WordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WordClient) Use

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

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

type WordCreate

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

WordCreate is the builder for creating a Word entity.

func (*WordCreate) Exec

func (wc *WordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WordCreate) ExecX

func (wc *WordCreate) ExecX(ctx context.Context)

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

func (*WordCreate) Mutation

func (wc *WordCreate) Mutation() *WordMutation

Mutation returns the WordMutation object of the builder.

func (*WordCreate) OnConflict added in v0.1.1

func (wc *WordCreate) OnConflict(opts ...sql.ConflictOption) *WordUpsertOne

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

client.Word.Create().
	SetText(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.WordUpsert) {
		SetText(v+v).
	}).
	Exec(ctx)

func (*WordCreate) OnConflictColumns added in v0.1.1

func (wc *WordCreate) OnConflictColumns(columns ...string) *WordUpsertOne

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

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

func (*WordCreate) Save

func (wc *WordCreate) Save(ctx context.Context) (*Word, error)

Save creates the Word in the database.

func (*WordCreate) SaveX

func (wc *WordCreate) SaveX(ctx context.Context) *Word

SaveX calls Save and panics if Save returns an error.

func (*WordCreate) SetCreatedAt

func (wc *WordCreate) SetCreatedAt(t time.Time) *WordCreate

SetCreatedAt sets the "created_at" field.

func (*WordCreate) SetLanguage

func (wc *WordCreate) SetLanguage(s string) *WordCreate

SetLanguage sets the "language" field.

func (*WordCreate) SetLemma

func (wc *WordCreate) SetLemma(s string) *WordCreate

SetLemma sets the "lemma" field.

func (*WordCreate) SetMeanings

func (wc *WordCreate) SetMeanings(ed []entity.WordDefinition) *WordCreate

SetMeanings sets the "meanings" field.

func (*WordCreate) SetNillableCreatedAt

func (wc *WordCreate) SetNillableCreatedAt(t *time.Time) *WordCreate

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

func (*WordCreate) SetNillableLanguage

func (wc *WordCreate) SetNillableLanguage(s *string) *WordCreate

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

func (*WordCreate) SetNillableLemma

func (wc *WordCreate) SetNillableLemma(s *string) *WordCreate

SetNillableLemma sets the "lemma" field if the given value is not nil.

func (*WordCreate) SetNillableNormalized added in v0.1.5

func (wc *WordCreate) SetNillableNormalized(s *string) *WordCreate

SetNillableNormalized sets the "normalized" field if the given value is not nil.

func (*WordCreate) SetNillableUpdatedAt

func (wc *WordCreate) SetNillableUpdatedAt(t *time.Time) *WordCreate

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

func (*WordCreate) SetNillableWordType

func (wc *WordCreate) SetNillableWordType(s *string) *WordCreate

SetNillableWordType sets the "word_type" field if the given value is not nil.

func (*WordCreate) SetNormalized added in v0.1.5

func (wc *WordCreate) SetNormalized(s string) *WordCreate

SetNormalized sets the "normalized" field.

func (*WordCreate) SetPhonetics

func (wc *WordCreate) SetPhonetics(ep []entity.WordPhonetic) *WordCreate

SetPhonetics sets the "phonetics" field.

func (*WordCreate) SetPhrases

func (wc *WordCreate) SetPhrases(e []entity.Phrase) *WordCreate

SetPhrases sets the "phrases" field.

func (*WordCreate) SetRelations

func (wc *WordCreate) SetRelations(er []entity.WordRelation) *WordCreate

SetRelations sets the "relations" field.

func (*WordCreate) SetSentences

func (wc *WordCreate) SetSentences(e []entity.Sentence) *WordCreate

SetSentences sets the "sentences" field.

func (*WordCreate) SetTags

func (wc *WordCreate) SetTags(s []string) *WordCreate

SetTags sets the "tags" field.

func (*WordCreate) SetText

func (wc *WordCreate) SetText(s string) *WordCreate

SetText sets the "text" field.

func (*WordCreate) SetUpdatedAt

func (wc *WordCreate) SetUpdatedAt(t time.Time) *WordCreate

SetUpdatedAt sets the "updated_at" field.

func (*WordCreate) SetWordType

func (wc *WordCreate) SetWordType(s string) *WordCreate

SetWordType sets the "word_type" field.

type WordCreateBulk

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

WordCreateBulk is the builder for creating many Word entities in bulk.

func (*WordCreateBulk) Exec

func (wcb *WordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WordCreateBulk) ExecX

func (wcb *WordCreateBulk) ExecX(ctx context.Context)

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

func (*WordCreateBulk) OnConflict added in v0.1.1

func (wcb *WordCreateBulk) OnConflict(opts ...sql.ConflictOption) *WordUpsertBulk

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

client.Word.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.WordUpsert) {
		SetText(v+v).
	}).
	Exec(ctx)

func (*WordCreateBulk) OnConflictColumns added in v0.1.1

func (wcb *WordCreateBulk) OnConflictColumns(columns ...string) *WordUpsertBulk

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

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

func (*WordCreateBulk) Save

func (wcb *WordCreateBulk) Save(ctx context.Context) ([]*Word, error)

Save creates the Word entities in the database.

func (*WordCreateBulk) SaveX

func (wcb *WordCreateBulk) SaveX(ctx context.Context) []*Word

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

type WordDelete

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

WordDelete is the builder for deleting a Word entity.

func (*WordDelete) Exec

func (wd *WordDelete) Exec(ctx context.Context) (int, error)

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

func (*WordDelete) ExecX

func (wd *WordDelete) ExecX(ctx context.Context) int

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

func (*WordDelete) Where

func (wd *WordDelete) Where(ps ...predicate.Word) *WordDelete

Where appends a list predicates to the WordDelete builder.

type WordDeleteOne

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

WordDeleteOne is the builder for deleting a single Word entity.

func (*WordDeleteOne) Exec

func (wdo *WordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WordDeleteOne) ExecX

func (wdo *WordDeleteOne) ExecX(ctx context.Context)

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

func (*WordDeleteOne) Where

func (wdo *WordDeleteOne) Where(ps ...predicate.Word) *WordDeleteOne

Where appends a list predicates to the WordDelete builder.

type WordGroupBy

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

WordGroupBy is the group-by builder for Word entities.

func (*WordGroupBy) Aggregate

func (wgb *WordGroupBy) Aggregate(fns ...AggregateFunc) *WordGroupBy

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

func (*WordGroupBy) Bool

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

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

func (*WordGroupBy) BoolX

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

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

func (*WordGroupBy) Bools

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

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

func (*WordGroupBy) BoolsX

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

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

func (*WordGroupBy) Float64

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

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

func (*WordGroupBy) Float64X

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

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

func (*WordGroupBy) Float64s

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

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

func (*WordGroupBy) Float64sX

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

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

func (*WordGroupBy) Int

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

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

func (*WordGroupBy) IntX

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

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

func (*WordGroupBy) Ints

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

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

func (*WordGroupBy) IntsX

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

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

func (*WordGroupBy) Scan

func (wgb *WordGroupBy) Scan(ctx context.Context, v any) error

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

func (*WordGroupBy) ScanX

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

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

func (*WordGroupBy) String

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

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

func (*WordGroupBy) StringX

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

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

func (*WordGroupBy) Strings

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

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

func (*WordGroupBy) StringsX

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

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

type WordMutation

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

WordMutation represents an operation that mutates the Word nodes in the graph.

func (*WordMutation) AddField

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

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

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

func (*WordMutation) AddedField

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

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

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

func (*WordMutation) AddedIDs

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

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

func (*WordMutation) AppendMeanings

func (m *WordMutation) AppendMeanings(ed []entity.WordDefinition)

AppendMeanings adds ed to the "meanings" field.

func (*WordMutation) AppendPhonetics

func (m *WordMutation) AppendPhonetics(ep []entity.WordPhonetic)

AppendPhonetics adds ep to the "phonetics" field.

func (*WordMutation) AppendPhrases

func (m *WordMutation) AppendPhrases(e []entity.Phrase)

AppendPhrases adds e to the "phrases" field.

func (*WordMutation) AppendRelations

func (m *WordMutation) AppendRelations(er []entity.WordRelation)

AppendRelations adds er to the "relations" field.

func (*WordMutation) AppendSentences

func (m *WordMutation) AppendSentences(e []entity.Sentence)

AppendSentences adds e to the "sentences" field.

func (*WordMutation) AppendTags

func (m *WordMutation) AppendTags(s []string)

AppendTags adds s to the "tags" field.

func (*WordMutation) AppendedMeanings

func (m *WordMutation) AppendedMeanings() ([]entity.WordDefinition, bool)

AppendedMeanings returns the list of values that were appended to the "meanings" field in this mutation.

func (*WordMutation) AppendedPhonetics

func (m *WordMutation) AppendedPhonetics() ([]entity.WordPhonetic, bool)

AppendedPhonetics returns the list of values that were appended to the "phonetics" field in this mutation.

func (*WordMutation) AppendedPhrases

func (m *WordMutation) AppendedPhrases() ([]entity.Phrase, bool)

AppendedPhrases returns the list of values that were appended to the "phrases" field in this mutation.

func (*WordMutation) AppendedRelations

func (m *WordMutation) AppendedRelations() ([]entity.WordRelation, bool)

AppendedRelations returns the list of values that were appended to the "relations" field in this mutation.

func (*WordMutation) AppendedSentences

func (m *WordMutation) AppendedSentences() ([]entity.Sentence, bool)

AppendedSentences returns the list of values that were appended to the "sentences" field in this mutation.

func (*WordMutation) AppendedTags

func (m *WordMutation) AppendedTags() ([]string, bool)

AppendedTags returns the list of values that were appended to the "tags" field in this mutation.

func (*WordMutation) ClearEdge

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

func (m *WordMutation) 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 (*WordMutation) ClearLemma

func (m *WordMutation) ClearLemma()

ClearLemma clears the value of the "lemma" field.

func (*WordMutation) ClearedEdges

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

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

func (*WordMutation) ClearedFields

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

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

func (WordMutation) Client

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

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

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

func (*WordMutation) EdgeCleared

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

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

func (*WordMutation) Field

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

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

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

func (*WordMutation) Fields

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

func (m *WordMutation) ID() (id int, exists bool)

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

func (*WordMutation) IDs

func (m *WordMutation) IDs(ctx context.Context) ([]int, error)

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

func (*WordMutation) Language

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

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

func (*WordMutation) Lemma

func (m *WordMutation) Lemma() (r string, exists bool)

Lemma returns the value of the "lemma" field in the mutation.

func (*WordMutation) LemmaCleared

func (m *WordMutation) LemmaCleared() bool

LemmaCleared returns if the "lemma" field was cleared in this mutation.

func (*WordMutation) Meanings

func (m *WordMutation) Meanings() (r []entity.WordDefinition, exists bool)

Meanings returns the value of the "meanings" field in the mutation.

func (*WordMutation) Normalized added in v0.1.5

func (m *WordMutation) Normalized() (r string, exists bool)

Normalized returns the value of the "normalized" field in the mutation.

func (*WordMutation) OldCreatedAt

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

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

func (m *WordMutation) 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 (*WordMutation) OldLanguage

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

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

func (m *WordMutation) OldLemma(ctx context.Context) (v *string, err error)

OldLemma returns the old "lemma" field's value of the Word entity. If the Word 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 (*WordMutation) OldMeanings

func (m *WordMutation) OldMeanings(ctx context.Context) (v []entity.WordDefinition, err error)

OldMeanings returns the old "meanings" field's value of the Word entity. If the Word 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 (*WordMutation) OldNormalized added in v0.1.5

func (m *WordMutation) OldNormalized(ctx context.Context) (v string, err error)

OldNormalized returns the old "normalized" field's value of the Word entity. If the Word 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 (*WordMutation) OldPhonetics

func (m *WordMutation) OldPhonetics(ctx context.Context) (v []entity.WordPhonetic, err error)

OldPhonetics returns the old "phonetics" field's value of the Word entity. If the Word 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 (*WordMutation) OldPhrases

func (m *WordMutation) OldPhrases(ctx context.Context) (v []entity.Phrase, err error)

OldPhrases returns the old "phrases" field's value of the Word entity. If the Word 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 (*WordMutation) OldRelations

func (m *WordMutation) OldRelations(ctx context.Context) (v []entity.WordRelation, err error)

OldRelations returns the old "relations" field's value of the Word entity. If the Word 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 (*WordMutation) OldSentences

func (m *WordMutation) OldSentences(ctx context.Context) (v []entity.Sentence, err error)

OldSentences returns the old "sentences" field's value of the Word entity. If the Word 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 (*WordMutation) OldTags

func (m *WordMutation) OldTags(ctx context.Context) (v []string, err error)

OldTags returns the old "tags" field's value of the Word entity. If the Word 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 (*WordMutation) OldText

func (m *WordMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Word entity. If the Word 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 (*WordMutation) OldUpdatedAt

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

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

func (m *WordMutation) OldWordType(ctx context.Context) (v string, err error)

OldWordType returns the old "word_type" field's value of the Word entity. If the Word 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 (*WordMutation) Op

func (m *WordMutation) Op() Op

Op returns the operation name.

func (*WordMutation) Phonetics

func (m *WordMutation) Phonetics() (r []entity.WordPhonetic, exists bool)

Phonetics returns the value of the "phonetics" field in the mutation.

func (*WordMutation) Phrases

func (m *WordMutation) Phrases() (r []entity.Phrase, exists bool)

Phrases returns the value of the "phrases" field in the mutation.

func (*WordMutation) Relations

func (m *WordMutation) Relations() (r []entity.WordRelation, exists bool)

Relations returns the value of the "relations" field in the mutation.

func (*WordMutation) RemovedEdges

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

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

func (*WordMutation) RemovedIDs

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

func (m *WordMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*WordMutation) ResetEdge

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

func (m *WordMutation) 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 (*WordMutation) ResetLanguage

func (m *WordMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*WordMutation) ResetLemma

func (m *WordMutation) ResetLemma()

ResetLemma resets all changes to the "lemma" field.

func (*WordMutation) ResetMeanings

func (m *WordMutation) ResetMeanings()

ResetMeanings resets all changes to the "meanings" field.

func (*WordMutation) ResetNormalized added in v0.1.5

func (m *WordMutation) ResetNormalized()

ResetNormalized resets all changes to the "normalized" field.

func (*WordMutation) ResetPhonetics

func (m *WordMutation) ResetPhonetics()

ResetPhonetics resets all changes to the "phonetics" field.

func (*WordMutation) ResetPhrases

func (m *WordMutation) ResetPhrases()

ResetPhrases resets all changes to the "phrases" field.

func (*WordMutation) ResetRelations

func (m *WordMutation) ResetRelations()

ResetRelations resets all changes to the "relations" field.

func (*WordMutation) ResetSentences

func (m *WordMutation) ResetSentences()

ResetSentences resets all changes to the "sentences" field.

func (*WordMutation) ResetTags

func (m *WordMutation) ResetTags()

ResetTags resets all changes to the "tags" field.

func (*WordMutation) ResetText

func (m *WordMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*WordMutation) ResetUpdatedAt

func (m *WordMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*WordMutation) ResetWordType

func (m *WordMutation) ResetWordType()

ResetWordType resets all changes to the "word_type" field.

func (*WordMutation) Sentences

func (m *WordMutation) Sentences() (r []entity.Sentence, exists bool)

Sentences returns the value of the "sentences" field in the mutation.

func (*WordMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*WordMutation) SetField

func (m *WordMutation) 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 (*WordMutation) SetLanguage

func (m *WordMutation) SetLanguage(s string)

SetLanguage sets the "language" field.

func (*WordMutation) SetLemma

func (m *WordMutation) SetLemma(s string)

SetLemma sets the "lemma" field.

func (*WordMutation) SetMeanings

func (m *WordMutation) SetMeanings(ed []entity.WordDefinition)

SetMeanings sets the "meanings" field.

func (*WordMutation) SetNormalized added in v0.1.5

func (m *WordMutation) SetNormalized(s string)

SetNormalized sets the "normalized" field.

func (*WordMutation) SetOp

func (m *WordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WordMutation) SetPhonetics

func (m *WordMutation) SetPhonetics(ep []entity.WordPhonetic)

SetPhonetics sets the "phonetics" field.

func (*WordMutation) SetPhrases

func (m *WordMutation) SetPhrases(e []entity.Phrase)

SetPhrases sets the "phrases" field.

func (*WordMutation) SetRelations

func (m *WordMutation) SetRelations(er []entity.WordRelation)

SetRelations sets the "relations" field.

func (*WordMutation) SetSentences

func (m *WordMutation) SetSentences(e []entity.Sentence)

SetSentences sets the "sentences" field.

func (*WordMutation) SetTags

func (m *WordMutation) SetTags(s []string)

SetTags sets the "tags" field.

func (*WordMutation) SetText

func (m *WordMutation) SetText(s string)

SetText sets the "text" field.

func (*WordMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*WordMutation) SetWordType

func (m *WordMutation) SetWordType(s string)

SetWordType sets the "word_type" field.

func (*WordMutation) Tags

func (m *WordMutation) Tags() (r []string, exists bool)

Tags returns the value of the "tags" field in the mutation.

func (*WordMutation) Text

func (m *WordMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (WordMutation) Tx

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

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

func (*WordMutation) Type

func (m *WordMutation) Type() string

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

func (*WordMutation) UpdatedAt

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

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

func (*WordMutation) Where

func (m *WordMutation) Where(ps ...predicate.Word)

Where appends a list predicates to the WordMutation builder.

func (*WordMutation) WhereP

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

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

func (*WordMutation) WordType

func (m *WordMutation) WordType() (r string, exists bool)

WordType returns the value of the "word_type" field in the mutation.

type WordQuery

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

WordQuery is the builder for querying Word entities.

func (*WordQuery) Aggregate

func (wq *WordQuery) Aggregate(fns ...AggregateFunc) *WordSelect

Aggregate returns a WordSelect configured with the given aggregations.

func (*WordQuery) All

func (wq *WordQuery) All(ctx context.Context) ([]*Word, error)

All executes the query and returns a list of Words.

func (*WordQuery) AllX

func (wq *WordQuery) AllX(ctx context.Context) []*Word

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

func (*WordQuery) Clone

func (wq *WordQuery) Clone() *WordQuery

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

func (*WordQuery) Count

func (wq *WordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WordQuery) CountX

func (wq *WordQuery) CountX(ctx context.Context) int

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

func (*WordQuery) Exist

func (wq *WordQuery) Exist(ctx context.Context) (bool, error)

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

func (*WordQuery) ExistX

func (wq *WordQuery) ExistX(ctx context.Context) bool

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

func (*WordQuery) First

func (wq *WordQuery) First(ctx context.Context) (*Word, error)

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

func (*WordQuery) FirstID

func (wq *WordQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*WordQuery) FirstIDX

func (wq *WordQuery) FirstIDX(ctx context.Context) int

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

func (*WordQuery) FirstX

func (wq *WordQuery) FirstX(ctx context.Context) *Word

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

func (*WordQuery) GroupBy

func (wq *WordQuery) GroupBy(field string, fields ...string) *WordGroupBy

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

Example:

var v []struct {
	Text string `json:"text,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Word.Query().
	GroupBy(word.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WordQuery) IDs

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

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

func (*WordQuery) IDsX

func (wq *WordQuery) IDsX(ctx context.Context) []int

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

func (*WordQuery) Limit

func (wq *WordQuery) Limit(limit int) *WordQuery

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

func (*WordQuery) Offset

func (wq *WordQuery) Offset(offset int) *WordQuery

Offset to start from.

func (*WordQuery) Only

func (wq *WordQuery) Only(ctx context.Context) (*Word, error)

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

func (*WordQuery) OnlyID

func (wq *WordQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*WordQuery) OnlyIDX

func (wq *WordQuery) OnlyIDX(ctx context.Context) int

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

func (*WordQuery) OnlyX

func (wq *WordQuery) OnlyX(ctx context.Context) *Word

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

func (*WordQuery) Order

func (wq *WordQuery) Order(o ...word.OrderOption) *WordQuery

Order specifies how the records should be ordered.

func (*WordQuery) Select

func (wq *WordQuery) Select(fields ...string) *WordSelect

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

Example:

var v []struct {
	Text string `json:"text,omitempty"`
}

client.Word.Query().
	Select(word.FieldText).
	Scan(ctx, &v)

func (*WordQuery) Unique

func (wq *WordQuery) Unique(unique bool) *WordQuery

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

func (wq *WordQuery) Where(ps ...predicate.Word) *WordQuery

Where adds a new predicate for the WordQuery builder.

type WordSelect

type WordSelect struct {
	*WordQuery
	// contains filtered or unexported fields
}

WordSelect is the builder for selecting fields of Word entities.

func (*WordSelect) Aggregate

func (ws *WordSelect) Aggregate(fns ...AggregateFunc) *WordSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WordSelect) Bool

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

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

func (*WordSelect) BoolX

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

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

func (*WordSelect) Bools

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

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

func (*WordSelect) BoolsX

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

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

func (*WordSelect) Float64

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

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

func (*WordSelect) Float64X

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

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

func (*WordSelect) Float64s

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

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

func (*WordSelect) Float64sX

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

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

func (*WordSelect) Int

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

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

func (*WordSelect) IntX

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

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

func (*WordSelect) Ints

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

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

func (*WordSelect) IntsX

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

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

func (*WordSelect) Scan

func (ws *WordSelect) Scan(ctx context.Context, v any) error

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

func (*WordSelect) ScanX

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

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

func (*WordSelect) String

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

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

func (*WordSelect) StringX

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

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

func (*WordSelect) Strings

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

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

func (*WordSelect) StringsX

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

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

type WordUpdate

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

WordUpdate is the builder for updating Word entities.

func (*WordUpdate) AppendMeanings

func (wu *WordUpdate) AppendMeanings(ed []entity.WordDefinition) *WordUpdate

AppendMeanings appends ed to the "meanings" field.

func (*WordUpdate) AppendPhonetics

func (wu *WordUpdate) AppendPhonetics(ep []entity.WordPhonetic) *WordUpdate

AppendPhonetics appends ep to the "phonetics" field.

func (*WordUpdate) AppendPhrases

func (wu *WordUpdate) AppendPhrases(e []entity.Phrase) *WordUpdate

AppendPhrases appends e to the "phrases" field.

func (*WordUpdate) AppendRelations

func (wu *WordUpdate) AppendRelations(er []entity.WordRelation) *WordUpdate

AppendRelations appends er to the "relations" field.

func (*WordUpdate) AppendSentences

func (wu *WordUpdate) AppendSentences(e []entity.Sentence) *WordUpdate

AppendSentences appends e to the "sentences" field.

func (*WordUpdate) AppendTags

func (wu *WordUpdate) AppendTags(s []string) *WordUpdate

AppendTags appends s to the "tags" field.

func (*WordUpdate) ClearLemma

func (wu *WordUpdate) ClearLemma() *WordUpdate

ClearLemma clears the value of the "lemma" field.

func (*WordUpdate) Exec

func (wu *WordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WordUpdate) ExecX

func (wu *WordUpdate) ExecX(ctx context.Context)

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

func (*WordUpdate) Mutation

func (wu *WordUpdate) Mutation() *WordMutation

Mutation returns the WordMutation object of the builder.

func (*WordUpdate) Save

func (wu *WordUpdate) Save(ctx context.Context) (int, error)

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

func (*WordUpdate) SaveX

func (wu *WordUpdate) SaveX(ctx context.Context) int

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

func (*WordUpdate) SetLanguage

func (wu *WordUpdate) SetLanguage(s string) *WordUpdate

SetLanguage sets the "language" field.

func (*WordUpdate) SetLemma

func (wu *WordUpdate) SetLemma(s string) *WordUpdate

SetLemma sets the "lemma" field.

func (*WordUpdate) SetMeanings

func (wu *WordUpdate) SetMeanings(ed []entity.WordDefinition) *WordUpdate

SetMeanings sets the "meanings" field.

func (*WordUpdate) SetNillableLanguage

func (wu *WordUpdate) SetNillableLanguage(s *string) *WordUpdate

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

func (*WordUpdate) SetNillableLemma

func (wu *WordUpdate) SetNillableLemma(s *string) *WordUpdate

SetNillableLemma sets the "lemma" field if the given value is not nil.

func (*WordUpdate) SetNillableNormalized added in v0.1.5

func (wu *WordUpdate) SetNillableNormalized(s *string) *WordUpdate

SetNillableNormalized sets the "normalized" field if the given value is not nil.

func (*WordUpdate) SetNillableText

func (wu *WordUpdate) SetNillableText(s *string) *WordUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*WordUpdate) SetNillableWordType

func (wu *WordUpdate) SetNillableWordType(s *string) *WordUpdate

SetNillableWordType sets the "word_type" field if the given value is not nil.

func (*WordUpdate) SetNormalized added in v0.1.5

func (wu *WordUpdate) SetNormalized(s string) *WordUpdate

SetNormalized sets the "normalized" field.

func (*WordUpdate) SetPhonetics

func (wu *WordUpdate) SetPhonetics(ep []entity.WordPhonetic) *WordUpdate

SetPhonetics sets the "phonetics" field.

func (*WordUpdate) SetPhrases

func (wu *WordUpdate) SetPhrases(e []entity.Phrase) *WordUpdate

SetPhrases sets the "phrases" field.

func (*WordUpdate) SetRelations

func (wu *WordUpdate) SetRelations(er []entity.WordRelation) *WordUpdate

SetRelations sets the "relations" field.

func (*WordUpdate) SetSentences

func (wu *WordUpdate) SetSentences(e []entity.Sentence) *WordUpdate

SetSentences sets the "sentences" field.

func (*WordUpdate) SetTags

func (wu *WordUpdate) SetTags(s []string) *WordUpdate

SetTags sets the "tags" field.

func (*WordUpdate) SetText

func (wu *WordUpdate) SetText(s string) *WordUpdate

SetText sets the "text" field.

func (*WordUpdate) SetUpdatedAt

func (wu *WordUpdate) SetUpdatedAt(t time.Time) *WordUpdate

SetUpdatedAt sets the "updated_at" field.

func (*WordUpdate) SetWordType

func (wu *WordUpdate) SetWordType(s string) *WordUpdate

SetWordType sets the "word_type" field.

func (*WordUpdate) Where

func (wu *WordUpdate) Where(ps ...predicate.Word) *WordUpdate

Where appends a list predicates to the WordUpdate builder.

type WordUpdateOne

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

WordUpdateOne is the builder for updating a single Word entity.

func (*WordUpdateOne) AppendMeanings

func (wuo *WordUpdateOne) AppendMeanings(ed []entity.WordDefinition) *WordUpdateOne

AppendMeanings appends ed to the "meanings" field.

func (*WordUpdateOne) AppendPhonetics

func (wuo *WordUpdateOne) AppendPhonetics(ep []entity.WordPhonetic) *WordUpdateOne

AppendPhonetics appends ep to the "phonetics" field.

func (*WordUpdateOne) AppendPhrases

func (wuo *WordUpdateOne) AppendPhrases(e []entity.Phrase) *WordUpdateOne

AppendPhrases appends e to the "phrases" field.

func (*WordUpdateOne) AppendRelations

func (wuo *WordUpdateOne) AppendRelations(er []entity.WordRelation) *WordUpdateOne

AppendRelations appends er to the "relations" field.

func (*WordUpdateOne) AppendSentences

func (wuo *WordUpdateOne) AppendSentences(e []entity.Sentence) *WordUpdateOne

AppendSentences appends e to the "sentences" field.

func (*WordUpdateOne) AppendTags

func (wuo *WordUpdateOne) AppendTags(s []string) *WordUpdateOne

AppendTags appends s to the "tags" field.

func (*WordUpdateOne) ClearLemma

func (wuo *WordUpdateOne) ClearLemma() *WordUpdateOne

ClearLemma clears the value of the "lemma" field.

func (*WordUpdateOne) Exec

func (wuo *WordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WordUpdateOne) ExecX

func (wuo *WordUpdateOne) ExecX(ctx context.Context)

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

func (*WordUpdateOne) Mutation

func (wuo *WordUpdateOne) Mutation() *WordMutation

Mutation returns the WordMutation object of the builder.

func (*WordUpdateOne) Save

func (wuo *WordUpdateOne) Save(ctx context.Context) (*Word, error)

Save executes the query and returns the updated Word entity.

func (*WordUpdateOne) SaveX

func (wuo *WordUpdateOne) SaveX(ctx context.Context) *Word

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

func (*WordUpdateOne) Select

func (wuo *WordUpdateOne) Select(field string, fields ...string) *WordUpdateOne

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

func (*WordUpdateOne) SetLanguage

func (wuo *WordUpdateOne) SetLanguage(s string) *WordUpdateOne

SetLanguage sets the "language" field.

func (*WordUpdateOne) SetLemma

func (wuo *WordUpdateOne) SetLemma(s string) *WordUpdateOne

SetLemma sets the "lemma" field.

func (*WordUpdateOne) SetMeanings

func (wuo *WordUpdateOne) SetMeanings(ed []entity.WordDefinition) *WordUpdateOne

SetMeanings sets the "meanings" field.

func (*WordUpdateOne) SetNillableLanguage

func (wuo *WordUpdateOne) SetNillableLanguage(s *string) *WordUpdateOne

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

func (*WordUpdateOne) SetNillableLemma

func (wuo *WordUpdateOne) SetNillableLemma(s *string) *WordUpdateOne

SetNillableLemma sets the "lemma" field if the given value is not nil.

func (*WordUpdateOne) SetNillableNormalized added in v0.1.5

func (wuo *WordUpdateOne) SetNillableNormalized(s *string) *WordUpdateOne

SetNillableNormalized sets the "normalized" field if the given value is not nil.

func (*WordUpdateOne) SetNillableText

func (wuo *WordUpdateOne) SetNillableText(s *string) *WordUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*WordUpdateOne) SetNillableWordType

func (wuo *WordUpdateOne) SetNillableWordType(s *string) *WordUpdateOne

SetNillableWordType sets the "word_type" field if the given value is not nil.

func (*WordUpdateOne) SetNormalized added in v0.1.5

func (wuo *WordUpdateOne) SetNormalized(s string) *WordUpdateOne

SetNormalized sets the "normalized" field.

func (*WordUpdateOne) SetPhonetics

func (wuo *WordUpdateOne) SetPhonetics(ep []entity.WordPhonetic) *WordUpdateOne

SetPhonetics sets the "phonetics" field.

func (*WordUpdateOne) SetPhrases

func (wuo *WordUpdateOne) SetPhrases(e []entity.Phrase) *WordUpdateOne

SetPhrases sets the "phrases" field.

func (*WordUpdateOne) SetRelations

func (wuo *WordUpdateOne) SetRelations(er []entity.WordRelation) *WordUpdateOne

SetRelations sets the "relations" field.

func (*WordUpdateOne) SetSentences

func (wuo *WordUpdateOne) SetSentences(e []entity.Sentence) *WordUpdateOne

SetSentences sets the "sentences" field.

func (*WordUpdateOne) SetTags

func (wuo *WordUpdateOne) SetTags(s []string) *WordUpdateOne

SetTags sets the "tags" field.

func (*WordUpdateOne) SetText

func (wuo *WordUpdateOne) SetText(s string) *WordUpdateOne

SetText sets the "text" field.

func (*WordUpdateOne) SetUpdatedAt

func (wuo *WordUpdateOne) SetUpdatedAt(t time.Time) *WordUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*WordUpdateOne) SetWordType

func (wuo *WordUpdateOne) SetWordType(s string) *WordUpdateOne

SetWordType sets the "word_type" field.

func (*WordUpdateOne) Where

func (wuo *WordUpdateOne) Where(ps ...predicate.Word) *WordUpdateOne

Where appends a list predicates to the WordUpdate builder.

type WordUpsert added in v0.1.1

type WordUpsert struct {
	*sql.UpdateSet
}

WordUpsert is the "OnConflict" setter.

func (*WordUpsert) ClearLemma added in v0.1.1

func (u *WordUpsert) ClearLemma() *WordUpsert

ClearLemma clears the value of the "lemma" field.

func (*WordUpsert) SetLanguage added in v0.1.1

func (u *WordUpsert) SetLanguage(v string) *WordUpsert

SetLanguage sets the "language" field.

func (*WordUpsert) SetLemma added in v0.1.1

func (u *WordUpsert) SetLemma(v string) *WordUpsert

SetLemma sets the "lemma" field.

func (*WordUpsert) SetMeanings added in v0.1.1

func (u *WordUpsert) SetMeanings(v []entity.WordDefinition) *WordUpsert

SetMeanings sets the "meanings" field.

func (*WordUpsert) SetNormalized added in v0.1.5

func (u *WordUpsert) SetNormalized(v string) *WordUpsert

SetNormalized sets the "normalized" field.

func (*WordUpsert) SetPhonetics added in v0.1.1

func (u *WordUpsert) SetPhonetics(v []entity.WordPhonetic) *WordUpsert

SetPhonetics sets the "phonetics" field.

func (*WordUpsert) SetPhrases added in v0.1.1

func (u *WordUpsert) SetPhrases(v []entity.Phrase) *WordUpsert

SetPhrases sets the "phrases" field.

func (*WordUpsert) SetRelations added in v0.1.1

func (u *WordUpsert) SetRelations(v []entity.WordRelation) *WordUpsert

SetRelations sets the "relations" field.

func (*WordUpsert) SetSentences added in v0.1.1

func (u *WordUpsert) SetSentences(v []entity.Sentence) *WordUpsert

SetSentences sets the "sentences" field.

func (*WordUpsert) SetTags added in v0.1.1

func (u *WordUpsert) SetTags(v []string) *WordUpsert

SetTags sets the "tags" field.

func (*WordUpsert) SetText added in v0.1.1

func (u *WordUpsert) SetText(v string) *WordUpsert

SetText sets the "text" field.

func (*WordUpsert) SetUpdatedAt added in v0.1.1

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

SetUpdatedAt sets the "updated_at" field.

func (*WordUpsert) SetWordType added in v0.1.1

func (u *WordUpsert) SetWordType(v string) *WordUpsert

SetWordType sets the "word_type" field.

func (*WordUpsert) UpdateLanguage added in v0.1.1

func (u *WordUpsert) UpdateLanguage() *WordUpsert

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

func (*WordUpsert) UpdateLemma added in v0.1.1

func (u *WordUpsert) UpdateLemma() *WordUpsert

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

func (*WordUpsert) UpdateMeanings added in v0.1.1

func (u *WordUpsert) UpdateMeanings() *WordUpsert

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

func (*WordUpsert) UpdateNormalized added in v0.1.5

func (u *WordUpsert) UpdateNormalized() *WordUpsert

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

func (*WordUpsert) UpdatePhonetics added in v0.1.1

func (u *WordUpsert) UpdatePhonetics() *WordUpsert

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

func (*WordUpsert) UpdatePhrases added in v0.1.1

func (u *WordUpsert) UpdatePhrases() *WordUpsert

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

func (*WordUpsert) UpdateRelations added in v0.1.1

func (u *WordUpsert) UpdateRelations() *WordUpsert

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

func (*WordUpsert) UpdateSentences added in v0.1.1

func (u *WordUpsert) UpdateSentences() *WordUpsert

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

func (*WordUpsert) UpdateTags added in v0.1.1

func (u *WordUpsert) UpdateTags() *WordUpsert

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

func (*WordUpsert) UpdateText added in v0.1.1

func (u *WordUpsert) UpdateText() *WordUpsert

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

func (*WordUpsert) UpdateUpdatedAt added in v0.1.1

func (u *WordUpsert) UpdateUpdatedAt() *WordUpsert

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

func (*WordUpsert) UpdateWordType added in v0.1.1

func (u *WordUpsert) UpdateWordType() *WordUpsert

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

type WordUpsertBulk added in v0.1.1

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

WordUpsertBulk is the builder for "upsert"-ing a bulk of Word nodes.

func (*WordUpsertBulk) ClearLemma added in v0.1.1

func (u *WordUpsertBulk) ClearLemma() *WordUpsertBulk

ClearLemma clears the value of the "lemma" field.

func (*WordUpsertBulk) DoNothing added in v0.1.1

func (u *WordUpsertBulk) DoNothing() *WordUpsertBulk

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

func (*WordUpsertBulk) Exec added in v0.1.1

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

Exec executes the query.

func (*WordUpsertBulk) ExecX added in v0.1.1

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

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

func (*WordUpsertBulk) Ignore added in v0.1.1

func (u *WordUpsertBulk) Ignore() *WordUpsertBulk

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

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

func (*WordUpsertBulk) SetLanguage added in v0.1.1

func (u *WordUpsertBulk) SetLanguage(v string) *WordUpsertBulk

SetLanguage sets the "language" field.

func (*WordUpsertBulk) SetLemma added in v0.1.1

func (u *WordUpsertBulk) SetLemma(v string) *WordUpsertBulk

SetLemma sets the "lemma" field.

func (*WordUpsertBulk) SetMeanings added in v0.1.1

func (u *WordUpsertBulk) SetMeanings(v []entity.WordDefinition) *WordUpsertBulk

SetMeanings sets the "meanings" field.

func (*WordUpsertBulk) SetNormalized added in v0.1.5

func (u *WordUpsertBulk) SetNormalized(v string) *WordUpsertBulk

SetNormalized sets the "normalized" field.

func (*WordUpsertBulk) SetPhonetics added in v0.1.1

func (u *WordUpsertBulk) SetPhonetics(v []entity.WordPhonetic) *WordUpsertBulk

SetPhonetics sets the "phonetics" field.

func (*WordUpsertBulk) SetPhrases added in v0.1.1

func (u *WordUpsertBulk) SetPhrases(v []entity.Phrase) *WordUpsertBulk

SetPhrases sets the "phrases" field.

func (*WordUpsertBulk) SetRelations added in v0.1.1

func (u *WordUpsertBulk) SetRelations(v []entity.WordRelation) *WordUpsertBulk

SetRelations sets the "relations" field.

func (*WordUpsertBulk) SetSentences added in v0.1.1

func (u *WordUpsertBulk) SetSentences(v []entity.Sentence) *WordUpsertBulk

SetSentences sets the "sentences" field.

func (*WordUpsertBulk) SetTags added in v0.1.1

func (u *WordUpsertBulk) SetTags(v []string) *WordUpsertBulk

SetTags sets the "tags" field.

func (*WordUpsertBulk) SetText added in v0.1.1

func (u *WordUpsertBulk) SetText(v string) *WordUpsertBulk

SetText sets the "text" field.

func (*WordUpsertBulk) SetUpdatedAt added in v0.1.1

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

SetUpdatedAt sets the "updated_at" field.

func (*WordUpsertBulk) SetWordType added in v0.1.1

func (u *WordUpsertBulk) SetWordType(v string) *WordUpsertBulk

SetWordType sets the "word_type" field.

func (*WordUpsertBulk) Update added in v0.1.1

func (u *WordUpsertBulk) Update(set func(*WordUpsert)) *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateLanguage added in v0.1.1

func (u *WordUpsertBulk) UpdateLanguage() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateLemma added in v0.1.1

func (u *WordUpsertBulk) UpdateLemma() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateMeanings added in v0.1.1

func (u *WordUpsertBulk) UpdateMeanings() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateNewValues added in v0.1.1

func (u *WordUpsertBulk) UpdateNewValues() *WordUpsertBulk

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

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

func (*WordUpsertBulk) UpdateNormalized added in v0.1.5

func (u *WordUpsertBulk) UpdateNormalized() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdatePhonetics added in v0.1.1

func (u *WordUpsertBulk) UpdatePhonetics() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdatePhrases added in v0.1.1

func (u *WordUpsertBulk) UpdatePhrases() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateRelations added in v0.1.1

func (u *WordUpsertBulk) UpdateRelations() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateSentences added in v0.1.1

func (u *WordUpsertBulk) UpdateSentences() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateTags added in v0.1.1

func (u *WordUpsertBulk) UpdateTags() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateText added in v0.1.1

func (u *WordUpsertBulk) UpdateText() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateUpdatedAt added in v0.1.1

func (u *WordUpsertBulk) UpdateUpdatedAt() *WordUpsertBulk

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

func (*WordUpsertBulk) UpdateWordType added in v0.1.1

func (u *WordUpsertBulk) UpdateWordType() *WordUpsertBulk

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

type WordUpsertOne added in v0.1.1

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

WordUpsertOne is the builder for "upsert"-ing

one Word node.

func (*WordUpsertOne) ClearLemma added in v0.1.1

func (u *WordUpsertOne) ClearLemma() *WordUpsertOne

ClearLemma clears the value of the "lemma" field.

func (*WordUpsertOne) DoNothing added in v0.1.1

func (u *WordUpsertOne) DoNothing() *WordUpsertOne

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

func (*WordUpsertOne) Exec added in v0.1.1

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

Exec executes the query.

func (*WordUpsertOne) ExecX added in v0.1.1

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

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

func (*WordUpsertOne) ID added in v0.1.1

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

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

func (*WordUpsertOne) IDX added in v0.1.1

func (u *WordUpsertOne) IDX(ctx context.Context) int

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

func (*WordUpsertOne) Ignore added in v0.1.1

func (u *WordUpsertOne) Ignore() *WordUpsertOne

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

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

func (*WordUpsertOne) SetLanguage added in v0.1.1

func (u *WordUpsertOne) SetLanguage(v string) *WordUpsertOne

SetLanguage sets the "language" field.

func (*WordUpsertOne) SetLemma added in v0.1.1

func (u *WordUpsertOne) SetLemma(v string) *WordUpsertOne

SetLemma sets the "lemma" field.

func (*WordUpsertOne) SetMeanings added in v0.1.1

func (u *WordUpsertOne) SetMeanings(v []entity.WordDefinition) *WordUpsertOne

SetMeanings sets the "meanings" field.

func (*WordUpsertOne) SetNormalized added in v0.1.5

func (u *WordUpsertOne) SetNormalized(v string) *WordUpsertOne

SetNormalized sets the "normalized" field.

func (*WordUpsertOne) SetPhonetics added in v0.1.1

func (u *WordUpsertOne) SetPhonetics(v []entity.WordPhonetic) *WordUpsertOne

SetPhonetics sets the "phonetics" field.

func (*WordUpsertOne) SetPhrases added in v0.1.1

func (u *WordUpsertOne) SetPhrases(v []entity.Phrase) *WordUpsertOne

SetPhrases sets the "phrases" field.

func (*WordUpsertOne) SetRelations added in v0.1.1

func (u *WordUpsertOne) SetRelations(v []entity.WordRelation) *WordUpsertOne

SetRelations sets the "relations" field.

func (*WordUpsertOne) SetSentences added in v0.1.1

func (u *WordUpsertOne) SetSentences(v []entity.Sentence) *WordUpsertOne

SetSentences sets the "sentences" field.

func (*WordUpsertOne) SetTags added in v0.1.1

func (u *WordUpsertOne) SetTags(v []string) *WordUpsertOne

SetTags sets the "tags" field.

func (*WordUpsertOne) SetText added in v0.1.1

func (u *WordUpsertOne) SetText(v string) *WordUpsertOne

SetText sets the "text" field.

func (*WordUpsertOne) SetUpdatedAt added in v0.1.1

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

SetUpdatedAt sets the "updated_at" field.

func (*WordUpsertOne) SetWordType added in v0.1.1

func (u *WordUpsertOne) SetWordType(v string) *WordUpsertOne

SetWordType sets the "word_type" field.

func (*WordUpsertOne) Update added in v0.1.1

func (u *WordUpsertOne) Update(set func(*WordUpsert)) *WordUpsertOne

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

func (*WordUpsertOne) UpdateLanguage added in v0.1.1

func (u *WordUpsertOne) UpdateLanguage() *WordUpsertOne

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

func (*WordUpsertOne) UpdateLemma added in v0.1.1

func (u *WordUpsertOne) UpdateLemma() *WordUpsertOne

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

func (*WordUpsertOne) UpdateMeanings added in v0.1.1

func (u *WordUpsertOne) UpdateMeanings() *WordUpsertOne

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

func (*WordUpsertOne) UpdateNewValues added in v0.1.1

func (u *WordUpsertOne) UpdateNewValues() *WordUpsertOne

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

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

func (*WordUpsertOne) UpdateNormalized added in v0.1.5

func (u *WordUpsertOne) UpdateNormalized() *WordUpsertOne

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

func (*WordUpsertOne) UpdatePhonetics added in v0.1.1

func (u *WordUpsertOne) UpdatePhonetics() *WordUpsertOne

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

func (*WordUpsertOne) UpdatePhrases added in v0.1.1

func (u *WordUpsertOne) UpdatePhrases() *WordUpsertOne

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

func (*WordUpsertOne) UpdateRelations added in v0.1.1

func (u *WordUpsertOne) UpdateRelations() *WordUpsertOne

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

func (*WordUpsertOne) UpdateSentences added in v0.1.1

func (u *WordUpsertOne) UpdateSentences() *WordUpsertOne

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

func (*WordUpsertOne) UpdateTags added in v0.1.1

func (u *WordUpsertOne) UpdateTags() *WordUpsertOne

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

func (*WordUpsertOne) UpdateText added in v0.1.1

func (u *WordUpsertOne) UpdateText() *WordUpsertOne

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

func (*WordUpsertOne) UpdateUpdatedAt added in v0.1.1

func (u *WordUpsertOne) UpdateUpdatedAt() *WordUpsertOne

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

func (*WordUpsertOne) UpdateWordType added in v0.1.1

func (u *WordUpsertOne) UpdateWordType() *WordUpsertOne

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

type Words

type Words []*Word

Words is a parsable slice of Word.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL