generated

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 23 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.
	TypeLanguageSettings   = "LanguageSettings"
	TypeLanguageVisibility = "LanguageVisibility"
	TypeNode               = "Node"
	TypeNodeTranslation    = "NodeTranslation"
	TypeTextTranslation    = "TextTranslation"
)

Variables

View Source
var ErrTxStarted = errors.New("generated: 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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
	// LanguageSettings is the client for interacting with the LanguageSettings builders.
	LanguageSettings *LanguageSettingsClient
	// LanguageVisibility is the client for interacting with the LanguageVisibility builders.
	LanguageVisibility *LanguageVisibilityClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// NodeTranslation is the client for interacting with the NodeTranslation builders.
	NodeTranslation *NodeTranslationClient
	// TextTranslation is the client for interacting with the TextTranslation builders.
	TextTranslation *TextTranslationClient
	// 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().
	LanguageSettings.
	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 LanguageSettings

type LanguageSettings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TranslatableTypes holds the value of the "translatable_types" field.
	TranslatableTypes []string `json:"translatable_types,omitempty"`
	// Untranslated holds the value of the "untranslated" field.
	Untranslated string `json:"untranslated,omitempty"`
	// contains filtered or unexported fields
}

LanguageSettings is the model entity for the LanguageSettings schema.

func (*LanguageSettings) String

func (_m *LanguageSettings) String() string

String implements the fmt.Stringer.

func (*LanguageSettings) Unwrap

func (_m *LanguageSettings) Unwrap() *LanguageSettings

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

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

func (*LanguageSettings) Value

func (_m *LanguageSettings) Value(name string) (ent.Value, error)

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

type LanguageSettingsClient

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

LanguageSettingsClient is a client for the LanguageSettings schema.

func NewLanguageSettingsClient

func NewLanguageSettingsClient(c config) *LanguageSettingsClient

NewLanguageSettingsClient returns a client for the LanguageSettings from the given config.

func (*LanguageSettingsClient) Create

Create returns a builder for creating a LanguageSettings entity.

func (*LanguageSettingsClient) CreateBulk

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

func (*LanguageSettingsClient) Delete

Delete returns a delete builder for LanguageSettings.

func (*LanguageSettingsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LanguageSettingsClient) DeleteOneID

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

func (*LanguageSettingsClient) Get

Get returns a LanguageSettings entity by its id.

func (*LanguageSettingsClient) GetX

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

func (*LanguageSettingsClient) Hooks

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

Hooks returns the client hooks.

func (*LanguageSettingsClient) Intercept

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

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

func (*LanguageSettingsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LanguageSettingsClient) MapCreateBulk

func (c *LanguageSettingsClient) MapCreateBulk(slice any, setFunc func(*LanguageSettingsCreate, int)) *LanguageSettingsCreateBulk

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

Query returns a query builder for LanguageSettings.

func (*LanguageSettingsClient) Update

Update returns an update builder for LanguageSettings.

func (*LanguageSettingsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*LanguageSettingsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*LanguageSettingsClient) Use

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

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

type LanguageSettingsCreate

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

LanguageSettingsCreate is the builder for creating a LanguageSettings entity.

func (*LanguageSettingsCreate) Exec

Exec executes the query.

func (*LanguageSettingsCreate) ExecX

func (_c *LanguageSettingsCreate) ExecX(ctx context.Context)

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

func (*LanguageSettingsCreate) Mutation

Mutation returns the LanguageSettingsMutation object of the builder.

func (*LanguageSettingsCreate) Save

Save creates the LanguageSettings in the database.

func (*LanguageSettingsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*LanguageSettingsCreate) SetID

SetID sets the "id" field.

func (*LanguageSettingsCreate) SetNillableUntranslated

func (_c *LanguageSettingsCreate) SetNillableUntranslated(v *string) *LanguageSettingsCreate

SetNillableUntranslated sets the "untranslated" field if the given value is not nil.

func (*LanguageSettingsCreate) SetTranslatableTypes

func (_c *LanguageSettingsCreate) SetTranslatableTypes(v []string) *LanguageSettingsCreate

SetTranslatableTypes sets the "translatable_types" field.

func (*LanguageSettingsCreate) SetUntranslated

func (_c *LanguageSettingsCreate) SetUntranslated(v string) *LanguageSettingsCreate

SetUntranslated sets the "untranslated" field.

type LanguageSettingsCreateBulk

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

LanguageSettingsCreateBulk is the builder for creating many LanguageSettings entities in bulk.

func (*LanguageSettingsCreateBulk) Exec

Exec executes the query.

func (*LanguageSettingsCreateBulk) ExecX

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

func (*LanguageSettingsCreateBulk) Save

Save creates the LanguageSettings entities in the database.

func (*LanguageSettingsCreateBulk) SaveX

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

type LanguageSettingsDelete

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

LanguageSettingsDelete is the builder for deleting a LanguageSettings entity.

func (*LanguageSettingsDelete) Exec

func (_d *LanguageSettingsDelete) Exec(ctx context.Context) (int, error)

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

func (*LanguageSettingsDelete) ExecX

func (_d *LanguageSettingsDelete) ExecX(ctx context.Context) int

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

func (*LanguageSettingsDelete) Where

Where appends a list predicates to the LanguageSettingsDelete builder.

type LanguageSettingsDeleteOne

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

LanguageSettingsDeleteOne is the builder for deleting a single LanguageSettings entity.

func (*LanguageSettingsDeleteOne) Exec

Exec executes the deletion query.

func (*LanguageSettingsDeleteOne) ExecX

func (_d *LanguageSettingsDeleteOne) ExecX(ctx context.Context)

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

func (*LanguageSettingsDeleteOne) Where

Where appends a list predicates to the LanguageSettingsDelete builder.

type LanguageSettingsGroupBy

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

LanguageSettingsGroupBy is the group-by builder for LanguageSettings entities.

func (*LanguageSettingsGroupBy) Aggregate

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

func (*LanguageSettingsGroupBy) Bool

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

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

func (*LanguageSettingsGroupBy) BoolX

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

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

func (*LanguageSettingsGroupBy) Bools

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

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

func (*LanguageSettingsGroupBy) BoolsX

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

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

func (*LanguageSettingsGroupBy) Float64

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

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

func (*LanguageSettingsGroupBy) Float64X

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

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

func (*LanguageSettingsGroupBy) Float64s

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

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

func (*LanguageSettingsGroupBy) Float64sX

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

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

func (*LanguageSettingsGroupBy) Int

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

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

func (*LanguageSettingsGroupBy) IntX

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

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

func (*LanguageSettingsGroupBy) Ints

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

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

func (*LanguageSettingsGroupBy) IntsX

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

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

func (*LanguageSettingsGroupBy) Scan

func (_g *LanguageSettingsGroupBy) Scan(ctx context.Context, v any) error

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

func (*LanguageSettingsGroupBy) ScanX

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

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

func (*LanguageSettingsGroupBy) String

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

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

func (*LanguageSettingsGroupBy) StringX

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

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

func (*LanguageSettingsGroupBy) Strings

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

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

func (*LanguageSettingsGroupBy) StringsX

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

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

type LanguageSettingsMutation

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

LanguageSettingsMutation represents an operation that mutates the LanguageSettings nodes in the graph.

func (*LanguageSettingsMutation) AddField

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

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

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

func (*LanguageSettingsMutation) AddedField

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

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

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

func (*LanguageSettingsMutation) AddedIDs

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

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

func (*LanguageSettingsMutation) AppendTranslatableTypes

func (m *LanguageSettingsMutation) AppendTranslatableTypes(s []string)

AppendTranslatableTypes adds s to the "translatable_types" field.

func (*LanguageSettingsMutation) AppendedTranslatableTypes

func (m *LanguageSettingsMutation) AppendedTranslatableTypes() ([]string, bool)

AppendedTranslatableTypes returns the list of values that were appended to the "translatable_types" field in this mutation.

func (*LanguageSettingsMutation) ClearEdge

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

func (m *LanguageSettingsMutation) 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 (*LanguageSettingsMutation) ClearTranslatableTypes

func (m *LanguageSettingsMutation) ClearTranslatableTypes()

ClearTranslatableTypes clears the value of the "translatable_types" field.

func (*LanguageSettingsMutation) ClearedEdges

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

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

func (*LanguageSettingsMutation) ClearedFields

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

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

func (LanguageSettingsMutation) Client

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

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

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

func (*LanguageSettingsMutation) Field

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

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

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

func (*LanguageSettingsMutation) Fields

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

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

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

func (*LanguageSettingsMutation) OldField

func (m *LanguageSettingsMutation) 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 (*LanguageSettingsMutation) OldTranslatableTypes

func (m *LanguageSettingsMutation) OldTranslatableTypes(ctx context.Context) (v []string, err error)

OldTranslatableTypes returns the old "translatable_types" field's value of the LanguageSettings entity. If the LanguageSettings 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 (*LanguageSettingsMutation) OldUntranslated

func (m *LanguageSettingsMutation) OldUntranslated(ctx context.Context) (v string, err error)

OldUntranslated returns the old "untranslated" field's value of the LanguageSettings entity. If the LanguageSettings 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 (*LanguageSettingsMutation) Op

func (m *LanguageSettingsMutation) Op() Op

Op returns the operation name.

func (*LanguageSettingsMutation) RemovedEdges

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

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

func (*LanguageSettingsMutation) RemovedIDs

func (m *LanguageSettingsMutation) 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 (*LanguageSettingsMutation) ResetEdge

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

func (m *LanguageSettingsMutation) 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 (*LanguageSettingsMutation) ResetTranslatableTypes

func (m *LanguageSettingsMutation) ResetTranslatableTypes()

ResetTranslatableTypes resets all changes to the "translatable_types" field.

func (*LanguageSettingsMutation) ResetUntranslated

func (m *LanguageSettingsMutation) ResetUntranslated()

ResetUntranslated resets all changes to the "untranslated" field.

func (*LanguageSettingsMutation) SetField

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

func (m *LanguageSettingsMutation) SetID(id int)

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

func (*LanguageSettingsMutation) SetOp

func (m *LanguageSettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LanguageSettingsMutation) SetTranslatableTypes

func (m *LanguageSettingsMutation) SetTranslatableTypes(s []string)

SetTranslatableTypes sets the "translatable_types" field.

func (*LanguageSettingsMutation) SetUntranslated

func (m *LanguageSettingsMutation) SetUntranslated(s string)

SetUntranslated sets the "untranslated" field.

func (*LanguageSettingsMutation) TranslatableTypes

func (m *LanguageSettingsMutation) TranslatableTypes() (r []string, exists bool)

TranslatableTypes returns the value of the "translatable_types" field in the mutation.

func (*LanguageSettingsMutation) TranslatableTypesCleared

func (m *LanguageSettingsMutation) TranslatableTypesCleared() bool

TranslatableTypesCleared returns if the "translatable_types" field was cleared in this mutation.

func (LanguageSettingsMutation) Tx

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

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

func (*LanguageSettingsMutation) Type

func (m *LanguageSettingsMutation) Type() string

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

func (*LanguageSettingsMutation) Untranslated

func (m *LanguageSettingsMutation) Untranslated() (r string, exists bool)

Untranslated returns the value of the "untranslated" field in the mutation.

func (*LanguageSettingsMutation) Where

Where appends a list predicates to the LanguageSettingsMutation builder.

func (*LanguageSettingsMutation) WhereP

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

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

type LanguageSettingsQuery

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

LanguageSettingsQuery is the builder for querying LanguageSettings entities.

func (*LanguageSettingsQuery) Aggregate

Aggregate returns a LanguageSettingsSelect configured with the given aggregations.

func (*LanguageSettingsQuery) All

All executes the query and returns a list of LanguageSettingsSlice.

func (*LanguageSettingsQuery) AllX

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

func (*LanguageSettingsQuery) Clone

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

func (*LanguageSettingsQuery) Count

func (_q *LanguageSettingsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LanguageSettingsQuery) CountX

func (_q *LanguageSettingsQuery) CountX(ctx context.Context) int

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

func (*LanguageSettingsQuery) Exist

func (_q *LanguageSettingsQuery) Exist(ctx context.Context) (bool, error)

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

func (*LanguageSettingsQuery) ExistX

func (_q *LanguageSettingsQuery) ExistX(ctx context.Context) bool

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

func (*LanguageSettingsQuery) First

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

func (*LanguageSettingsQuery) FirstID

func (_q *LanguageSettingsQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LanguageSettingsQuery) FirstIDX

func (_q *LanguageSettingsQuery) FirstIDX(ctx context.Context) int

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

func (*LanguageSettingsQuery) FirstX

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

func (*LanguageSettingsQuery) GroupBy

func (_q *LanguageSettingsQuery) GroupBy(field string, fields ...string) *LanguageSettingsGroupBy

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 {
	TranslatableTypes []string `json:"translatable_types,omitempty"`
	Count int `json:"count,omitempty"`
}

client.LanguageSettings.Query().
	GroupBy(languagesettings.FieldTranslatableTypes).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*LanguageSettingsQuery) IDs

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

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

func (*LanguageSettingsQuery) IDsX

func (_q *LanguageSettingsQuery) IDsX(ctx context.Context) []int

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

func (*LanguageSettingsQuery) Limit

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

func (*LanguageSettingsQuery) Offset

func (_q *LanguageSettingsQuery) Offset(offset int) *LanguageSettingsQuery

Offset to start from.

func (*LanguageSettingsQuery) Only

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

func (*LanguageSettingsQuery) OnlyID

func (_q *LanguageSettingsQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LanguageSettingsQuery) OnlyIDX

func (_q *LanguageSettingsQuery) OnlyIDX(ctx context.Context) int

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

func (*LanguageSettingsQuery) OnlyX

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

func (*LanguageSettingsQuery) Order

Order specifies how the records should be ordered.

func (*LanguageSettingsQuery) Select

func (_q *LanguageSettingsQuery) Select(fields ...string) *LanguageSettingsSelect

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 {
	TranslatableTypes []string `json:"translatable_types,omitempty"`
}

client.LanguageSettings.Query().
	Select(languagesettings.FieldTranslatableTypes).
	Scan(ctx, &v)

func (*LanguageSettingsQuery) Unique

func (_q *LanguageSettingsQuery) Unique(unique bool) *LanguageSettingsQuery

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

Where adds a new predicate for the LanguageSettingsQuery builder.

type LanguageSettingsSelect

type LanguageSettingsSelect struct {
	*LanguageSettingsQuery
	// contains filtered or unexported fields
}

LanguageSettingsSelect is the builder for selecting fields of LanguageSettings entities.

func (*LanguageSettingsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*LanguageSettingsSelect) Bool

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

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

func (*LanguageSettingsSelect) BoolX

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

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

func (*LanguageSettingsSelect) Bools

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

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

func (*LanguageSettingsSelect) BoolsX

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

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

func (*LanguageSettingsSelect) Float64

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

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

func (*LanguageSettingsSelect) Float64X

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

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

func (*LanguageSettingsSelect) Float64s

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

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

func (*LanguageSettingsSelect) Float64sX

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

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

func (*LanguageSettingsSelect) Int

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

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

func (*LanguageSettingsSelect) IntX

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

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

func (*LanguageSettingsSelect) Ints

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

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

func (*LanguageSettingsSelect) IntsX

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

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

func (*LanguageSettingsSelect) Scan

func (_s *LanguageSettingsSelect) Scan(ctx context.Context, v any) error

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

func (*LanguageSettingsSelect) ScanX

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

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

func (*LanguageSettingsSelect) String

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

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

func (*LanguageSettingsSelect) StringX

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

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

func (*LanguageSettingsSelect) Strings

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

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

func (*LanguageSettingsSelect) StringsX

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

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

type LanguageSettingsSlice

type LanguageSettingsSlice []*LanguageSettings

LanguageSettingsSlice is a parsable slice of LanguageSettings.

type LanguageSettingsUpdate

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

LanguageSettingsUpdate is the builder for updating LanguageSettings entities.

func (*LanguageSettingsUpdate) AppendTranslatableTypes

func (_u *LanguageSettingsUpdate) AppendTranslatableTypes(v []string) *LanguageSettingsUpdate

AppendTranslatableTypes appends value to the "translatable_types" field.

func (*LanguageSettingsUpdate) ClearTranslatableTypes

func (_u *LanguageSettingsUpdate) ClearTranslatableTypes() *LanguageSettingsUpdate

ClearTranslatableTypes clears the value of the "translatable_types" field.

func (*LanguageSettingsUpdate) Exec

Exec executes the query.

func (*LanguageSettingsUpdate) ExecX

func (_u *LanguageSettingsUpdate) ExecX(ctx context.Context)

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

func (*LanguageSettingsUpdate) Mutation

Mutation returns the LanguageSettingsMutation object of the builder.

func (*LanguageSettingsUpdate) Save

func (_u *LanguageSettingsUpdate) Save(ctx context.Context) (int, error)

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

func (*LanguageSettingsUpdate) SaveX

func (_u *LanguageSettingsUpdate) SaveX(ctx context.Context) int

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

func (*LanguageSettingsUpdate) SetNillableUntranslated

func (_u *LanguageSettingsUpdate) SetNillableUntranslated(v *string) *LanguageSettingsUpdate

SetNillableUntranslated sets the "untranslated" field if the given value is not nil.

func (*LanguageSettingsUpdate) SetTranslatableTypes

func (_u *LanguageSettingsUpdate) SetTranslatableTypes(v []string) *LanguageSettingsUpdate

SetTranslatableTypes sets the "translatable_types" field.

func (*LanguageSettingsUpdate) SetUntranslated

func (_u *LanguageSettingsUpdate) SetUntranslated(v string) *LanguageSettingsUpdate

SetUntranslated sets the "untranslated" field.

func (*LanguageSettingsUpdate) Where

Where appends a list predicates to the LanguageSettingsUpdate builder.

type LanguageSettingsUpdateOne

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

LanguageSettingsUpdateOne is the builder for updating a single LanguageSettings entity.

func (*LanguageSettingsUpdateOne) AppendTranslatableTypes

func (_u *LanguageSettingsUpdateOne) AppendTranslatableTypes(v []string) *LanguageSettingsUpdateOne

AppendTranslatableTypes appends value to the "translatable_types" field.

func (*LanguageSettingsUpdateOne) ClearTranslatableTypes

func (_u *LanguageSettingsUpdateOne) ClearTranslatableTypes() *LanguageSettingsUpdateOne

ClearTranslatableTypes clears the value of the "translatable_types" field.

func (*LanguageSettingsUpdateOne) Exec

Exec executes the query on the entity.

func (*LanguageSettingsUpdateOne) ExecX

func (_u *LanguageSettingsUpdateOne) ExecX(ctx context.Context)

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

func (*LanguageSettingsUpdateOne) Mutation

Mutation returns the LanguageSettingsMutation object of the builder.

func (*LanguageSettingsUpdateOne) Save

Save executes the query and returns the updated LanguageSettings entity.

func (*LanguageSettingsUpdateOne) SaveX

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

func (*LanguageSettingsUpdateOne) Select

func (_u *LanguageSettingsUpdateOne) Select(field string, fields ...string) *LanguageSettingsUpdateOne

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

func (*LanguageSettingsUpdateOne) SetNillableUntranslated

func (_u *LanguageSettingsUpdateOne) SetNillableUntranslated(v *string) *LanguageSettingsUpdateOne

SetNillableUntranslated sets the "untranslated" field if the given value is not nil.

func (*LanguageSettingsUpdateOne) SetTranslatableTypes

func (_u *LanguageSettingsUpdateOne) SetTranslatableTypes(v []string) *LanguageSettingsUpdateOne

SetTranslatableTypes sets the "translatable_types" field.

func (*LanguageSettingsUpdateOne) SetUntranslated

SetUntranslated sets the "untranslated" field.

func (*LanguageSettingsUpdateOne) Where

Where appends a list predicates to the LanguageSettingsUpdate builder.

type LanguageVisibilities

type LanguageVisibilities []*LanguageVisibility

LanguageVisibilities is a parsable slice of LanguageVisibility.

type LanguageVisibility

type LanguageVisibility struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Kind holds the value of the "kind" field.
	Kind string `json:"kind,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref string `json:"ref,omitempty"`
	// Langs holds the value of the "langs" field.
	Langs []string `json:"langs,omitempty"`
	// contains filtered or unexported fields
}

LanguageVisibility is the model entity for the LanguageVisibility schema.

func (*LanguageVisibility) String

func (_m *LanguageVisibility) String() string

String implements the fmt.Stringer.

func (*LanguageVisibility) Unwrap

func (_m *LanguageVisibility) Unwrap() *LanguageVisibility

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

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

func (*LanguageVisibility) Value

func (_m *LanguageVisibility) Value(name string) (ent.Value, error)

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

type LanguageVisibilityClient

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

LanguageVisibilityClient is a client for the LanguageVisibility schema.

func NewLanguageVisibilityClient

func NewLanguageVisibilityClient(c config) *LanguageVisibilityClient

NewLanguageVisibilityClient returns a client for the LanguageVisibility from the given config.

func (*LanguageVisibilityClient) Create

Create returns a builder for creating a LanguageVisibility entity.

func (*LanguageVisibilityClient) CreateBulk

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

func (*LanguageVisibilityClient) Delete

Delete returns a delete builder for LanguageVisibility.

func (*LanguageVisibilityClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LanguageVisibilityClient) DeleteOneID

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

func (*LanguageVisibilityClient) Get

Get returns a LanguageVisibility entity by its id.

func (*LanguageVisibilityClient) GetX

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

func (*LanguageVisibilityClient) Hooks

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

Hooks returns the client hooks.

func (*LanguageVisibilityClient) Intercept

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

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

func (*LanguageVisibilityClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LanguageVisibilityClient) MapCreateBulk

func (c *LanguageVisibilityClient) MapCreateBulk(slice any, setFunc func(*LanguageVisibilityCreate, int)) *LanguageVisibilityCreateBulk

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

Query returns a query builder for LanguageVisibility.

func (*LanguageVisibilityClient) Update

Update returns an update builder for LanguageVisibility.

func (*LanguageVisibilityClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*LanguageVisibilityClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*LanguageVisibilityClient) Use

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

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

type LanguageVisibilityCreate

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

LanguageVisibilityCreate is the builder for creating a LanguageVisibility entity.

func (*LanguageVisibilityCreate) Exec

Exec executes the query.

func (*LanguageVisibilityCreate) ExecX

func (_c *LanguageVisibilityCreate) ExecX(ctx context.Context)

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

func (*LanguageVisibilityCreate) Mutation

Mutation returns the LanguageVisibilityMutation object of the builder.

func (*LanguageVisibilityCreate) Save

Save creates the LanguageVisibility in the database.

func (*LanguageVisibilityCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*LanguageVisibilityCreate) SetID

SetID sets the "id" field.

func (*LanguageVisibilityCreate) SetKind

SetKind sets the "kind" field.

func (*LanguageVisibilityCreate) SetLangs

SetLangs sets the "langs" field.

func (*LanguageVisibilityCreate) SetRef

SetRef sets the "ref" field.

type LanguageVisibilityCreateBulk

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

LanguageVisibilityCreateBulk is the builder for creating many LanguageVisibility entities in bulk.

func (*LanguageVisibilityCreateBulk) Exec

Exec executes the query.

func (*LanguageVisibilityCreateBulk) ExecX

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

func (*LanguageVisibilityCreateBulk) Save

Save creates the LanguageVisibility entities in the database.

func (*LanguageVisibilityCreateBulk) SaveX

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

type LanguageVisibilityDelete

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

LanguageVisibilityDelete is the builder for deleting a LanguageVisibility entity.

func (*LanguageVisibilityDelete) Exec

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

func (*LanguageVisibilityDelete) ExecX

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

func (*LanguageVisibilityDelete) Where

Where appends a list predicates to the LanguageVisibilityDelete builder.

type LanguageVisibilityDeleteOne

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

LanguageVisibilityDeleteOne is the builder for deleting a single LanguageVisibility entity.

func (*LanguageVisibilityDeleteOne) Exec

Exec executes the deletion query.

func (*LanguageVisibilityDeleteOne) ExecX

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

func (*LanguageVisibilityDeleteOne) Where

Where appends a list predicates to the LanguageVisibilityDelete builder.

type LanguageVisibilityGroupBy

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

LanguageVisibilityGroupBy is the group-by builder for LanguageVisibility entities.

func (*LanguageVisibilityGroupBy) Aggregate

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

func (*LanguageVisibilityGroupBy) Bool

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

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

func (*LanguageVisibilityGroupBy) BoolX

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

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

func (*LanguageVisibilityGroupBy) Bools

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

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

func (*LanguageVisibilityGroupBy) BoolsX

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

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

func (*LanguageVisibilityGroupBy) Float64

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

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

func (*LanguageVisibilityGroupBy) Float64X

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

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

func (*LanguageVisibilityGroupBy) Float64s

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

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

func (*LanguageVisibilityGroupBy) Float64sX

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

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

func (*LanguageVisibilityGroupBy) Int

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

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

func (*LanguageVisibilityGroupBy) IntX

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

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

func (*LanguageVisibilityGroupBy) Ints

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

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

func (*LanguageVisibilityGroupBy) IntsX

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

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

func (*LanguageVisibilityGroupBy) Scan

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

func (*LanguageVisibilityGroupBy) ScanX

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

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

func (*LanguageVisibilityGroupBy) String

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

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

func (*LanguageVisibilityGroupBy) StringX

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

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

func (*LanguageVisibilityGroupBy) Strings

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

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

func (*LanguageVisibilityGroupBy) StringsX

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

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

type LanguageVisibilityMutation

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

LanguageVisibilityMutation represents an operation that mutates the LanguageVisibility nodes in the graph.

func (*LanguageVisibilityMutation) AddField

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

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

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

func (*LanguageVisibilityMutation) AddedField

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

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

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

func (*LanguageVisibilityMutation) AddedIDs

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

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

func (*LanguageVisibilityMutation) AppendLangs

func (m *LanguageVisibilityMutation) AppendLangs(s []string)

AppendLangs adds s to the "langs" field.

func (*LanguageVisibilityMutation) AppendedLangs

func (m *LanguageVisibilityMutation) AppendedLangs() ([]string, bool)

AppendedLangs returns the list of values that were appended to the "langs" field in this mutation.

func (*LanguageVisibilityMutation) ClearEdge

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

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

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

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

func (*LanguageVisibilityMutation) ClearedFields

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

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

func (LanguageVisibilityMutation) Client

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

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

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

func (*LanguageVisibilityMutation) Field

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

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

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

func (*LanguageVisibilityMutation) Fields

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

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

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

func (*LanguageVisibilityMutation) Kind

func (m *LanguageVisibilityMutation) Kind() (r string, exists bool)

Kind returns the value of the "kind" field in the mutation.

func (*LanguageVisibilityMutation) Langs

func (m *LanguageVisibilityMutation) Langs() (r []string, exists bool)

Langs returns the value of the "langs" field in the mutation.

func (*LanguageVisibilityMutation) OldField

func (m *LanguageVisibilityMutation) 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 (*LanguageVisibilityMutation) OldKind

func (m *LanguageVisibilityMutation) OldKind(ctx context.Context) (v string, err error)

OldKind returns the old "kind" field's value of the LanguageVisibility entity. If the LanguageVisibility 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 (*LanguageVisibilityMutation) OldLangs

func (m *LanguageVisibilityMutation) OldLangs(ctx context.Context) (v []string, err error)

OldLangs returns the old "langs" field's value of the LanguageVisibility entity. If the LanguageVisibility 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 (*LanguageVisibilityMutation) OldRef

func (m *LanguageVisibilityMutation) OldRef(ctx context.Context) (v string, err error)

OldRef returns the old "ref" field's value of the LanguageVisibility entity. If the LanguageVisibility 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 (*LanguageVisibilityMutation) Op

Op returns the operation name.

func (*LanguageVisibilityMutation) Ref

func (m *LanguageVisibilityMutation) Ref() (r string, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*LanguageVisibilityMutation) RemovedEdges

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

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

func (*LanguageVisibilityMutation) RemovedIDs

func (m *LanguageVisibilityMutation) 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 (*LanguageVisibilityMutation) ResetEdge

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

func (m *LanguageVisibilityMutation) 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 (*LanguageVisibilityMutation) ResetKind

func (m *LanguageVisibilityMutation) ResetKind()

ResetKind resets all changes to the "kind" field.

func (*LanguageVisibilityMutation) ResetLangs

func (m *LanguageVisibilityMutation) ResetLangs()

ResetLangs resets all changes to the "langs" field.

func (*LanguageVisibilityMutation) ResetRef

func (m *LanguageVisibilityMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*LanguageVisibilityMutation) SetField

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

func (m *LanguageVisibilityMutation) SetID(id int)

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

func (*LanguageVisibilityMutation) SetKind

func (m *LanguageVisibilityMutation) SetKind(s string)

SetKind sets the "kind" field.

func (*LanguageVisibilityMutation) SetLangs

func (m *LanguageVisibilityMutation) SetLangs(s []string)

SetLangs sets the "langs" field.

func (*LanguageVisibilityMutation) SetOp

func (m *LanguageVisibilityMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LanguageVisibilityMutation) SetRef

func (m *LanguageVisibilityMutation) SetRef(s string)

SetRef sets the "ref" field.

func (LanguageVisibilityMutation) Tx

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

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

func (*LanguageVisibilityMutation) Type

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

func (*LanguageVisibilityMutation) Where

Where appends a list predicates to the LanguageVisibilityMutation builder.

func (*LanguageVisibilityMutation) WhereP

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

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

type LanguageVisibilityQuery

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

LanguageVisibilityQuery is the builder for querying LanguageVisibility entities.

func (*LanguageVisibilityQuery) Aggregate

Aggregate returns a LanguageVisibilitySelect configured with the given aggregations.

func (*LanguageVisibilityQuery) All

All executes the query and returns a list of LanguageVisibilities.

func (*LanguageVisibilityQuery) AllX

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

func (*LanguageVisibilityQuery) Clone

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

func (*LanguageVisibilityQuery) Count

func (_q *LanguageVisibilityQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LanguageVisibilityQuery) CountX

func (_q *LanguageVisibilityQuery) CountX(ctx context.Context) int

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

func (*LanguageVisibilityQuery) Exist

func (_q *LanguageVisibilityQuery) Exist(ctx context.Context) (bool, error)

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

func (*LanguageVisibilityQuery) ExistX

func (_q *LanguageVisibilityQuery) ExistX(ctx context.Context) bool

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

func (*LanguageVisibilityQuery) First

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

func (*LanguageVisibilityQuery) FirstID

func (_q *LanguageVisibilityQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LanguageVisibilityQuery) FirstIDX

func (_q *LanguageVisibilityQuery) FirstIDX(ctx context.Context) int

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

func (*LanguageVisibilityQuery) FirstX

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

func (*LanguageVisibilityQuery) GroupBy

func (_q *LanguageVisibilityQuery) GroupBy(field string, fields ...string) *LanguageVisibilityGroupBy

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

client.LanguageVisibility.Query().
	GroupBy(languagevisibility.FieldKind).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*LanguageVisibilityQuery) IDs

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

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

func (*LanguageVisibilityQuery) IDsX

func (_q *LanguageVisibilityQuery) IDsX(ctx context.Context) []int

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

func (*LanguageVisibilityQuery) Limit

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

func (*LanguageVisibilityQuery) Offset

Offset to start from.

func (*LanguageVisibilityQuery) Only

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

func (*LanguageVisibilityQuery) OnlyID

func (_q *LanguageVisibilityQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LanguageVisibilityQuery) OnlyIDX

func (_q *LanguageVisibilityQuery) OnlyIDX(ctx context.Context) int

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

func (*LanguageVisibilityQuery) OnlyX

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

func (*LanguageVisibilityQuery) Order

Order specifies how the records should be ordered.

func (*LanguageVisibilityQuery) Select

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

client.LanguageVisibility.Query().
	Select(languagevisibility.FieldKind).
	Scan(ctx, &v)

func (*LanguageVisibilityQuery) Unique

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

Where adds a new predicate for the LanguageVisibilityQuery builder.

type LanguageVisibilitySelect

type LanguageVisibilitySelect struct {
	*LanguageVisibilityQuery
	// contains filtered or unexported fields
}

LanguageVisibilitySelect is the builder for selecting fields of LanguageVisibility entities.

func (*LanguageVisibilitySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*LanguageVisibilitySelect) Bool

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

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

func (*LanguageVisibilitySelect) BoolX

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

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

func (*LanguageVisibilitySelect) Bools

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

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

func (*LanguageVisibilitySelect) BoolsX

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

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

func (*LanguageVisibilitySelect) Float64

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

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

func (*LanguageVisibilitySelect) Float64X

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

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

func (*LanguageVisibilitySelect) Float64s

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

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

func (*LanguageVisibilitySelect) Float64sX

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

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

func (*LanguageVisibilitySelect) Int

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

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

func (*LanguageVisibilitySelect) IntX

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

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

func (*LanguageVisibilitySelect) Ints

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

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

func (*LanguageVisibilitySelect) IntsX

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

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

func (*LanguageVisibilitySelect) Scan

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

func (*LanguageVisibilitySelect) ScanX

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

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

func (*LanguageVisibilitySelect) String

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

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

func (*LanguageVisibilitySelect) StringX

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

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

func (*LanguageVisibilitySelect) Strings

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

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

func (*LanguageVisibilitySelect) StringsX

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

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

type LanguageVisibilityUpdate

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

LanguageVisibilityUpdate is the builder for updating LanguageVisibility entities.

func (*LanguageVisibilityUpdate) AppendLangs

AppendLangs appends value to the "langs" field.

func (*LanguageVisibilityUpdate) Exec

Exec executes the query.

func (*LanguageVisibilityUpdate) ExecX

func (_u *LanguageVisibilityUpdate) ExecX(ctx context.Context)

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

func (*LanguageVisibilityUpdate) Mutation

Mutation returns the LanguageVisibilityMutation object of the builder.

func (*LanguageVisibilityUpdate) Save

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

func (*LanguageVisibilityUpdate) SaveX

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

func (*LanguageVisibilityUpdate) SetKind

SetKind sets the "kind" field.

func (*LanguageVisibilityUpdate) SetLangs

SetLangs sets the "langs" field.

func (*LanguageVisibilityUpdate) SetNillableKind

func (_u *LanguageVisibilityUpdate) SetNillableKind(v *string) *LanguageVisibilityUpdate

SetNillableKind sets the "kind" field if the given value is not nil.

func (*LanguageVisibilityUpdate) SetNillableRef

SetNillableRef sets the "ref" field if the given value is not nil.

func (*LanguageVisibilityUpdate) SetRef

SetRef sets the "ref" field.

func (*LanguageVisibilityUpdate) Where

Where appends a list predicates to the LanguageVisibilityUpdate builder.

type LanguageVisibilityUpdateOne

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

LanguageVisibilityUpdateOne is the builder for updating a single LanguageVisibility entity.

func (*LanguageVisibilityUpdateOne) AppendLangs

AppendLangs appends value to the "langs" field.

func (*LanguageVisibilityUpdateOne) Exec

Exec executes the query on the entity.

func (*LanguageVisibilityUpdateOne) ExecX

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

func (*LanguageVisibilityUpdateOne) Mutation

Mutation returns the LanguageVisibilityMutation object of the builder.

func (*LanguageVisibilityUpdateOne) Save

Save executes the query and returns the updated LanguageVisibility entity.

func (*LanguageVisibilityUpdateOne) SaveX

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

func (*LanguageVisibilityUpdateOne) Select

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

func (*LanguageVisibilityUpdateOne) SetKind

SetKind sets the "kind" field.

func (*LanguageVisibilityUpdateOne) SetLangs

SetLangs sets the "langs" field.

func (*LanguageVisibilityUpdateOne) SetNillableKind

SetNillableKind sets the "kind" field if the given value is not nil.

func (*LanguageVisibilityUpdateOne) SetNillableRef

SetNillableRef sets the "ref" field if the given value is not nil.

func (*LanguageVisibilityUpdateOne) SetRef

SetRef sets the "ref" field.

func (*LanguageVisibilityUpdateOne) Where

Where appends a list predicates to the LanguageVisibilityUpdate builder.

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 Node

type Node struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Node is the model entity for the Node schema.

func (*Node) String

func (_m *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (_m *Node) Unwrap() *Node

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

func (_m *Node) Update() *NodeUpdateOne

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

func (*Node) Value

func (_m *Node) Value(name string) (ent.Value, error)

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

type NodeClient

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

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

NewNodeClient returns a client for the Node from the given config.

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk

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

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

func (c *NodeClient) DeleteOne(_m *Node) *NodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne

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

func (*NodeClient) Get

func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)

Get returns a Node entity by its id.

func (*NodeClient) GetX

func (c *NodeClient) GetX(ctx context.Context, id int) *Node

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

func (*NodeClient) Hooks

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

Hooks returns the client hooks.

func (*NodeClient) Intercept

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

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

func (*NodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk

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

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

func (c *NodeClient) UpdateOne(_m *Node) *NodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

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

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

type NodeCreate

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

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) Exec

func (_c *NodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreate) ExecX

func (_c *NodeCreate) ExecX(ctx context.Context)

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

func (*NodeCreate) Mutation

func (_c *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) Save

func (_c *NodeCreate) Save(ctx context.Context) (*Node, error)

Save creates the Node in the database.

func (*NodeCreate) SaveX

func (_c *NodeCreate) SaveX(ctx context.Context) *Node

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetID

func (_c *NodeCreate) SetID(v int) *NodeCreate

SetID sets the "id" field.

type NodeCreateBulk

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

NodeCreateBulk is the builder for creating many Node entities in bulk.

func (*NodeCreateBulk) Exec

func (_c *NodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreateBulk) ExecX

func (_c *NodeCreateBulk) ExecX(ctx context.Context)

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

func (*NodeCreateBulk) Save

func (_c *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error)

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

func (_c *NodeCreateBulk) SaveX(ctx context.Context) []*Node

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

type NodeDelete

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

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

func (_d *NodeDelete) Exec(ctx context.Context) (int, error)

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

func (*NodeDelete) ExecX

func (_d *NodeDelete) ExecX(ctx context.Context) int

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

func (*NodeDelete) Where

func (_d *NodeDelete) Where(ps ...predicate.Node) *NodeDelete

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

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

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

func (_d *NodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

func (_d *NodeDeleteOne) ExecX(ctx context.Context)

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

func (*NodeDeleteOne) Where

func (_d *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne

Where appends a list predicates to the NodeDelete builder.

type NodeGroupBy

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

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

func (_g *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy

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

func (*NodeGroupBy) Bool

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

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

func (*NodeGroupBy) BoolX

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

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

func (*NodeGroupBy) Bools

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

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

func (*NodeGroupBy) BoolsX

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

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

func (*NodeGroupBy) Float64

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

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

func (*NodeGroupBy) Float64X

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

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

func (*NodeGroupBy) Float64s

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

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

func (*NodeGroupBy) Float64sX

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

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

func (*NodeGroupBy) Int

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

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

func (*NodeGroupBy) IntX

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

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

func (*NodeGroupBy) Ints

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

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

func (*NodeGroupBy) IntsX

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

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

func (*NodeGroupBy) Scan

func (_g *NodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*NodeGroupBy) ScanX

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

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

func (*NodeGroupBy) String

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

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

func (*NodeGroupBy) StringX

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

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

func (*NodeGroupBy) Strings

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

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

func (*NodeGroupBy) StringsX

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

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

type NodeMutation

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

NodeMutation represents an operation that mutates the Node nodes in the graph.

func (*NodeMutation) AddField

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

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

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

func (*NodeMutation) AddedField

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

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

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

func (*NodeMutation) AddedIDs

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

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

func (*NodeMutation) ClearEdge

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

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

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

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

func (*NodeMutation) ClearedFields

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

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

func (NodeMutation) Client

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

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

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

func (*NodeMutation) Field

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

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

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

func (*NodeMutation) Fields

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

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

func (m *NodeMutation) 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 (*NodeMutation) OldField

func (m *NodeMutation) 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 (*NodeMutation) Op

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) RemovedEdges

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

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

func (*NodeMutation) RemovedIDs

func (m *NodeMutation) 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 (*NodeMutation) ResetEdge

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

func (m *NodeMutation) 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 (*NodeMutation) SetField

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

func (m *NodeMutation) SetID(id int)

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

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (NodeMutation) Tx

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

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

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

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

func (*NodeMutation) Where

func (m *NodeMutation) Where(ps ...predicate.Node)

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

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

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

type NodeQuery

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

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

func (_q *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

func (_q *NodeQuery) All(ctx context.Context) ([]*Node, error)

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

func (_q *NodeQuery) AllX(ctx context.Context) []*Node

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

func (*NodeQuery) Clone

func (_q *NodeQuery) Clone() *NodeQuery

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

func (*NodeQuery) Count

func (_q *NodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeQuery) CountX

func (_q *NodeQuery) CountX(ctx context.Context) int

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

func (*NodeQuery) Exist

func (_q *NodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*NodeQuery) ExistX

func (_q *NodeQuery) ExistX(ctx context.Context) bool

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

func (*NodeQuery) First

func (_q *NodeQuery) First(ctx context.Context) (*Node, error)

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

func (*NodeQuery) FirstID

func (_q *NodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) FirstIDX

func (_q *NodeQuery) FirstIDX(ctx context.Context) int

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

func (*NodeQuery) FirstX

func (_q *NodeQuery) FirstX(ctx context.Context) *Node

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

func (*NodeQuery) GroupBy

func (_q *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy

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.

func (*NodeQuery) IDs

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

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

func (*NodeQuery) IDsX

func (_q *NodeQuery) IDsX(ctx context.Context) []int

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

func (*NodeQuery) Limit

func (_q *NodeQuery) Limit(limit int) *NodeQuery

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

func (*NodeQuery) Offset

func (_q *NodeQuery) Offset(offset int) *NodeQuery

Offset to start from.

func (*NodeQuery) Only

func (_q *NodeQuery) Only(ctx context.Context) (*Node, error)

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

func (*NodeQuery) OnlyID

func (_q *NodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) OnlyIDX

func (_q *NodeQuery) OnlyIDX(ctx context.Context) int

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

func (*NodeQuery) OnlyX

func (_q *NodeQuery) OnlyX(ctx context.Context) *Node

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

func (*NodeQuery) Order

func (_q *NodeQuery) Order(o ...node.OrderOption) *NodeQuery

Order specifies how the records should be ordered.

func (*NodeQuery) Select

func (_q *NodeQuery) Select(fields ...string) *NodeSelect

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

func (*NodeQuery) Unique

func (_q *NodeQuery) Unique(unique bool) *NodeQuery

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

func (_q *NodeQuery) Where(ps ...predicate.Node) *NodeQuery

Where adds a new predicate for the NodeQuery builder.

type NodeSelect

type NodeSelect struct {
	*NodeQuery
	// contains filtered or unexported fields
}

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

func (_s *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

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

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

func (*NodeSelect) BoolX

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

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

func (*NodeSelect) Bools

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

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

func (*NodeSelect) BoolsX

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

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

func (*NodeSelect) Float64

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

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

func (*NodeSelect) Float64X

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

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

func (*NodeSelect) Float64s

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

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

func (*NodeSelect) Float64sX

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

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

func (*NodeSelect) Int

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

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

func (*NodeSelect) IntX

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

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

func (*NodeSelect) Ints

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

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

func (*NodeSelect) IntsX

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

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

func (*NodeSelect) Scan

func (_s *NodeSelect) Scan(ctx context.Context, v any) error

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

func (*NodeSelect) ScanX

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

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

func (*NodeSelect) String

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

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

func (*NodeSelect) StringX

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

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

func (*NodeSelect) Strings

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

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

func (*NodeSelect) StringsX

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

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

type NodeTranslation

type NodeTranslation struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Nid holds the value of the "nid" field.
	Nid int `json:"nid,omitempty"`
	// Tnid holds the value of the "tnid" field.
	Tnid int `json:"tnid,omitempty"`
	// Outdated holds the value of the "outdated" field.
	Outdated bool `json:"outdated,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NodeTranslationQuery when eager-loading is set.
	Edges NodeTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

NodeTranslation is the model entity for the NodeTranslation schema.

func (*NodeTranslation) QueryNode

func (_m *NodeTranslation) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the NodeTranslation entity.

func (*NodeTranslation) String

func (_m *NodeTranslation) String() string

String implements the fmt.Stringer.

func (*NodeTranslation) Unwrap

func (_m *NodeTranslation) Unwrap() *NodeTranslation

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

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

func (*NodeTranslation) Value

func (_m *NodeTranslation) Value(name string) (ent.Value, error)

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

type NodeTranslationClient

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

NodeTranslationClient is a client for the NodeTranslation schema.

func NewNodeTranslationClient

func NewNodeTranslationClient(c config) *NodeTranslationClient

NewNodeTranslationClient returns a client for the NodeTranslation from the given config.

func (*NodeTranslationClient) Create

Create returns a builder for creating a NodeTranslation entity.

func (*NodeTranslationClient) CreateBulk

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

func (*NodeTranslationClient) Delete

Delete returns a delete builder for NodeTranslation.

func (*NodeTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeTranslationClient) DeleteOneID

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

func (*NodeTranslationClient) Get

Get returns a NodeTranslation entity by its id.

func (*NodeTranslationClient) GetX

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

func (*NodeTranslationClient) Hooks

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

Hooks returns the client hooks.

func (*NodeTranslationClient) Intercept

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

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

func (*NodeTranslationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeTranslationClient) MapCreateBulk

func (c *NodeTranslationClient) MapCreateBulk(slice any, setFunc func(*NodeTranslationCreate, int)) *NodeTranslationCreateBulk

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

Query returns a query builder for NodeTranslation.

func (*NodeTranslationClient) QueryNode

func (c *NodeTranslationClient) QueryNode(_m *NodeTranslation) *NodeQuery

QueryNode queries the node edge of a NodeTranslation.

func (*NodeTranslationClient) Update

Update returns an update builder for NodeTranslation.

func (*NodeTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NodeTranslationClient) Use

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

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

type NodeTranslationCreate

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

NodeTranslationCreate is the builder for creating a NodeTranslation entity.

func (*NodeTranslationCreate) Exec

Exec executes the query.

func (*NodeTranslationCreate) ExecX

func (_c *NodeTranslationCreate) ExecX(ctx context.Context)

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

func (*NodeTranslationCreate) Mutation

Mutation returns the NodeTranslationMutation object of the builder.

func (*NodeTranslationCreate) Save

Save creates the NodeTranslation in the database.

func (*NodeTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NodeTranslationCreate) SetID

SetID sets the "id" field.

func (*NodeTranslationCreate) SetNid

SetNid sets the "nid" field.

func (*NodeTranslationCreate) SetNillableOutdated

func (_c *NodeTranslationCreate) SetNillableOutdated(v *bool) *NodeTranslationCreate

SetNillableOutdated sets the "outdated" field if the given value is not nil.

func (*NodeTranslationCreate) SetNode

SetNode sets the "node" edge to the Node entity.

func (*NodeTranslationCreate) SetNodeID

func (_c *NodeTranslationCreate) SetNodeID(id int) *NodeTranslationCreate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*NodeTranslationCreate) SetOutdated

func (_c *NodeTranslationCreate) SetOutdated(v bool) *NodeTranslationCreate

SetOutdated sets the "outdated" field.

func (*NodeTranslationCreate) SetTnid

SetTnid sets the "tnid" field.

type NodeTranslationCreateBulk

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

NodeTranslationCreateBulk is the builder for creating many NodeTranslation entities in bulk.

func (*NodeTranslationCreateBulk) Exec

Exec executes the query.

func (*NodeTranslationCreateBulk) ExecX

func (_c *NodeTranslationCreateBulk) ExecX(ctx context.Context)

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

func (*NodeTranslationCreateBulk) Save

Save creates the NodeTranslation entities in the database.

func (*NodeTranslationCreateBulk) SaveX

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

type NodeTranslationDelete

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

NodeTranslationDelete is the builder for deleting a NodeTranslation entity.

func (*NodeTranslationDelete) Exec

func (_d *NodeTranslationDelete) Exec(ctx context.Context) (int, error)

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

func (*NodeTranslationDelete) ExecX

func (_d *NodeTranslationDelete) ExecX(ctx context.Context) int

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

func (*NodeTranslationDelete) Where

Where appends a list predicates to the NodeTranslationDelete builder.

type NodeTranslationDeleteOne

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

NodeTranslationDeleteOne is the builder for deleting a single NodeTranslation entity.

func (*NodeTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*NodeTranslationDeleteOne) ExecX

func (_d *NodeTranslationDeleteOne) ExecX(ctx context.Context)

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

func (*NodeTranslationDeleteOne) Where

Where appends a list predicates to the NodeTranslationDelete builder.

type NodeTranslationEdges

type NodeTranslationEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

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

func (NodeTranslationEdges) NodeOrErr

func (e NodeTranslationEdges) NodeOrErr() (*Node, error)

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

type NodeTranslationGroupBy

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

NodeTranslationGroupBy is the group-by builder for NodeTranslation entities.

func (*NodeTranslationGroupBy) Aggregate

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

func (*NodeTranslationGroupBy) Bool

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

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

func (*NodeTranslationGroupBy) BoolX

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

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

func (*NodeTranslationGroupBy) Bools

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

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

func (*NodeTranslationGroupBy) BoolsX

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

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

func (*NodeTranslationGroupBy) Float64

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

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

func (*NodeTranslationGroupBy) Float64X

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

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

func (*NodeTranslationGroupBy) Float64s

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

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

func (*NodeTranslationGroupBy) Float64sX

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

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

func (*NodeTranslationGroupBy) Int

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

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

func (*NodeTranslationGroupBy) IntX

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

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

func (*NodeTranslationGroupBy) Ints

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

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

func (*NodeTranslationGroupBy) IntsX

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

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

func (*NodeTranslationGroupBy) Scan

func (_g *NodeTranslationGroupBy) Scan(ctx context.Context, v any) error

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

func (*NodeTranslationGroupBy) ScanX

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

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

func (*NodeTranslationGroupBy) String

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

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

func (*NodeTranslationGroupBy) StringX

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

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

func (*NodeTranslationGroupBy) Strings

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

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

func (*NodeTranslationGroupBy) StringsX

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

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

type NodeTranslationMutation

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

NodeTranslationMutation represents an operation that mutates the NodeTranslation nodes in the graph.

func (*NodeTranslationMutation) AddField

func (m *NodeTranslationMutation) 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 (*NodeTranslationMutation) AddTnid

func (m *NodeTranslationMutation) AddTnid(i int)

AddTnid adds i to the "tnid" field.

func (*NodeTranslationMutation) AddedEdges

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

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

func (*NodeTranslationMutation) AddedField

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

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

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

func (*NodeTranslationMutation) AddedIDs

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

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

func (*NodeTranslationMutation) AddedTnid

func (m *NodeTranslationMutation) AddedTnid() (r int, exists bool)

AddedTnid returns the value that was added to the "tnid" field in this mutation.

func (*NodeTranslationMutation) ClearEdge

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

func (m *NodeTranslationMutation) 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 (*NodeTranslationMutation) ClearNode

func (m *NodeTranslationMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*NodeTranslationMutation) ClearedEdges

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

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

func (*NodeTranslationMutation) ClearedFields

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

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

func (NodeTranslationMutation) Client

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

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

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

func (*NodeTranslationMutation) Field

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

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

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

func (*NodeTranslationMutation) Fields

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

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

func (m *NodeTranslationMutation) 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 (*NodeTranslationMutation) Nid

func (m *NodeTranslationMutation) Nid() (r int, exists bool)

Nid returns the value of the "nid" field in the mutation.

func (*NodeTranslationMutation) NodeCleared

func (m *NodeTranslationMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*NodeTranslationMutation) NodeID

func (m *NodeTranslationMutation) NodeID() (id int, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*NodeTranslationMutation) NodeIDs

func (m *NodeTranslationMutation) NodeIDs() (ids []int)

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

func (*NodeTranslationMutation) OldField

func (m *NodeTranslationMutation) 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 (*NodeTranslationMutation) OldNid

func (m *NodeTranslationMutation) OldNid(ctx context.Context) (v int, err error)

OldNid returns the old "nid" field's value of the NodeTranslation entity. If the NodeTranslation 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 (*NodeTranslationMutation) OldOutdated

func (m *NodeTranslationMutation) OldOutdated(ctx context.Context) (v bool, err error)

OldOutdated returns the old "outdated" field's value of the NodeTranslation entity. If the NodeTranslation 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 (*NodeTranslationMutation) OldTnid

func (m *NodeTranslationMutation) OldTnid(ctx context.Context) (v int, err error)

OldTnid returns the old "tnid" field's value of the NodeTranslation entity. If the NodeTranslation 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 (*NodeTranslationMutation) Op

func (m *NodeTranslationMutation) Op() Op

Op returns the operation name.

func (*NodeTranslationMutation) Outdated

func (m *NodeTranslationMutation) Outdated() (r bool, exists bool)

Outdated returns the value of the "outdated" field in the mutation.

func (*NodeTranslationMutation) RemovedEdges

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

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

func (*NodeTranslationMutation) RemovedIDs

func (m *NodeTranslationMutation) 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 (*NodeTranslationMutation) ResetEdge

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

func (m *NodeTranslationMutation) 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 (*NodeTranslationMutation) ResetNid

func (m *NodeTranslationMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*NodeTranslationMutation) ResetNode

func (m *NodeTranslationMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*NodeTranslationMutation) ResetOutdated

func (m *NodeTranslationMutation) ResetOutdated()

ResetOutdated resets all changes to the "outdated" field.

func (*NodeTranslationMutation) ResetTnid

func (m *NodeTranslationMutation) ResetTnid()

ResetTnid resets all changes to the "tnid" field.

func (*NodeTranslationMutation) SetField

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

func (m *NodeTranslationMutation) SetID(id int)

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

func (*NodeTranslationMutation) SetNid

func (m *NodeTranslationMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*NodeTranslationMutation) SetNodeID

func (m *NodeTranslationMutation) SetNodeID(id int)

SetNodeID sets the "node" edge to the Node entity by id.

func (*NodeTranslationMutation) SetOp

func (m *NodeTranslationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NodeTranslationMutation) SetOutdated

func (m *NodeTranslationMutation) SetOutdated(b bool)

SetOutdated sets the "outdated" field.

func (*NodeTranslationMutation) SetTnid

func (m *NodeTranslationMutation) SetTnid(i int)

SetTnid sets the "tnid" field.

func (*NodeTranslationMutation) Tnid

func (m *NodeTranslationMutation) Tnid() (r int, exists bool)

Tnid returns the value of the "tnid" field in the mutation.

func (NodeTranslationMutation) Tx

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

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

func (*NodeTranslationMutation) Type

func (m *NodeTranslationMutation) Type() string

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

func (*NodeTranslationMutation) Where

Where appends a list predicates to the NodeTranslationMutation builder.

func (*NodeTranslationMutation) WhereP

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

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

type NodeTranslationQuery

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

NodeTranslationQuery is the builder for querying NodeTranslation entities.

func (*NodeTranslationQuery) Aggregate

Aggregate returns a NodeTranslationSelect configured with the given aggregations.

func (*NodeTranslationQuery) All

All executes the query and returns a list of NodeTranslations.

func (*NodeTranslationQuery) AllX

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

func (*NodeTranslationQuery) Clone

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

func (*NodeTranslationQuery) Count

func (_q *NodeTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeTranslationQuery) CountX

func (_q *NodeTranslationQuery) CountX(ctx context.Context) int

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

func (*NodeTranslationQuery) Exist

func (_q *NodeTranslationQuery) Exist(ctx context.Context) (bool, error)

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

func (*NodeTranslationQuery) ExistX

func (_q *NodeTranslationQuery) ExistX(ctx context.Context) bool

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

func (*NodeTranslationQuery) First

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

func (*NodeTranslationQuery) FirstID

func (_q *NodeTranslationQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NodeTranslationQuery) FirstIDX

func (_q *NodeTranslationQuery) FirstIDX(ctx context.Context) int

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

func (*NodeTranslationQuery) FirstX

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

func (*NodeTranslationQuery) GroupBy

func (_q *NodeTranslationQuery) GroupBy(field string, fields ...string) *NodeTranslationGroupBy

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 {
	Nid int `json:"nid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NodeTranslation.Query().
	GroupBy(nodetranslation.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*NodeTranslationQuery) IDs

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

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

func (*NodeTranslationQuery) IDsX

func (_q *NodeTranslationQuery) IDsX(ctx context.Context) []int

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

func (*NodeTranslationQuery) Limit

func (_q *NodeTranslationQuery) Limit(limit int) *NodeTranslationQuery

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

func (*NodeTranslationQuery) Offset

func (_q *NodeTranslationQuery) Offset(offset int) *NodeTranslationQuery

Offset to start from.

func (*NodeTranslationQuery) Only

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

func (*NodeTranslationQuery) OnlyID

func (_q *NodeTranslationQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NodeTranslationQuery) OnlyIDX

func (_q *NodeTranslationQuery) OnlyIDX(ctx context.Context) int

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

func (*NodeTranslationQuery) OnlyX

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

func (*NodeTranslationQuery) Order

Order specifies how the records should be ordered.

func (*NodeTranslationQuery) QueryNode

func (_q *NodeTranslationQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*NodeTranslationQuery) Select

func (_q *NodeTranslationQuery) Select(fields ...string) *NodeTranslationSelect

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 {
	Nid int `json:"nid,omitempty"`
}

client.NodeTranslation.Query().
	Select(nodetranslation.FieldNid).
	Scan(ctx, &v)

func (*NodeTranslationQuery) Unique

func (_q *NodeTranslationQuery) Unique(unique bool) *NodeTranslationQuery

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

Where adds a new predicate for the NodeTranslationQuery builder.

func (*NodeTranslationQuery) WithNode

func (_q *NodeTranslationQuery) WithNode(opts ...func(*NodeQuery)) *NodeTranslationQuery

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

type NodeTranslationSelect

type NodeTranslationSelect struct {
	*NodeTranslationQuery
	// contains filtered or unexported fields
}

NodeTranslationSelect is the builder for selecting fields of NodeTranslation entities.

func (*NodeTranslationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NodeTranslationSelect) Bool

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

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

func (*NodeTranslationSelect) BoolX

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

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

func (*NodeTranslationSelect) Bools

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

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

func (*NodeTranslationSelect) BoolsX

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

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

func (*NodeTranslationSelect) Float64

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

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

func (*NodeTranslationSelect) Float64X

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

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

func (*NodeTranslationSelect) Float64s

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

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

func (*NodeTranslationSelect) Float64sX

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

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

func (*NodeTranslationSelect) Int

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

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

func (*NodeTranslationSelect) IntX

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

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

func (*NodeTranslationSelect) Ints

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

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

func (*NodeTranslationSelect) IntsX

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

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

func (*NodeTranslationSelect) Scan

func (_s *NodeTranslationSelect) Scan(ctx context.Context, v any) error

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

func (*NodeTranslationSelect) ScanX

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

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

func (*NodeTranslationSelect) String

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

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

func (*NodeTranslationSelect) StringX

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

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

func (*NodeTranslationSelect) Strings

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

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

func (*NodeTranslationSelect) StringsX

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

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

type NodeTranslationUpdate

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

NodeTranslationUpdate is the builder for updating NodeTranslation entities.

func (*NodeTranslationUpdate) AddTnid

AddTnid adds value to the "tnid" field.

func (*NodeTranslationUpdate) ClearNode

ClearNode clears the "node" edge to the Node entity.

func (*NodeTranslationUpdate) Exec

Exec executes the query.

func (*NodeTranslationUpdate) ExecX

func (_u *NodeTranslationUpdate) ExecX(ctx context.Context)

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

func (*NodeTranslationUpdate) Mutation

Mutation returns the NodeTranslationMutation object of the builder.

func (*NodeTranslationUpdate) Save

func (_u *NodeTranslationUpdate) Save(ctx context.Context) (int, error)

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

func (*NodeTranslationUpdate) SaveX

func (_u *NodeTranslationUpdate) SaveX(ctx context.Context) int

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

func (*NodeTranslationUpdate) SetNid

SetNid sets the "nid" field.

func (*NodeTranslationUpdate) SetNillableNid

func (_u *NodeTranslationUpdate) SetNillableNid(v *int) *NodeTranslationUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*NodeTranslationUpdate) SetNillableOutdated

func (_u *NodeTranslationUpdate) SetNillableOutdated(v *bool) *NodeTranslationUpdate

SetNillableOutdated sets the "outdated" field if the given value is not nil.

func (*NodeTranslationUpdate) SetNillableTnid

func (_u *NodeTranslationUpdate) SetNillableTnid(v *int) *NodeTranslationUpdate

SetNillableTnid sets the "tnid" field if the given value is not nil.

func (*NodeTranslationUpdate) SetNode

SetNode sets the "node" edge to the Node entity.

func (*NodeTranslationUpdate) SetNodeID

func (_u *NodeTranslationUpdate) SetNodeID(id int) *NodeTranslationUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*NodeTranslationUpdate) SetOutdated

func (_u *NodeTranslationUpdate) SetOutdated(v bool) *NodeTranslationUpdate

SetOutdated sets the "outdated" field.

func (*NodeTranslationUpdate) SetTnid

SetTnid sets the "tnid" field.

func (*NodeTranslationUpdate) Where

Where appends a list predicates to the NodeTranslationUpdate builder.

type NodeTranslationUpdateOne

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

NodeTranslationUpdateOne is the builder for updating a single NodeTranslation entity.

func (*NodeTranslationUpdateOne) AddTnid

AddTnid adds value to the "tnid" field.

func (*NodeTranslationUpdateOne) ClearNode

ClearNode clears the "node" edge to the Node entity.

func (*NodeTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*NodeTranslationUpdateOne) ExecX

func (_u *NodeTranslationUpdateOne) ExecX(ctx context.Context)

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

func (*NodeTranslationUpdateOne) Mutation

Mutation returns the NodeTranslationMutation object of the builder.

func (*NodeTranslationUpdateOne) Save

Save executes the query and returns the updated NodeTranslation entity.

func (*NodeTranslationUpdateOne) SaveX

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

func (*NodeTranslationUpdateOne) Select

func (_u *NodeTranslationUpdateOne) Select(field string, fields ...string) *NodeTranslationUpdateOne

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

func (*NodeTranslationUpdateOne) SetNid

SetNid sets the "nid" field.

func (*NodeTranslationUpdateOne) SetNillableNid

func (_u *NodeTranslationUpdateOne) SetNillableNid(v *int) *NodeTranslationUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*NodeTranslationUpdateOne) SetNillableOutdated

func (_u *NodeTranslationUpdateOne) SetNillableOutdated(v *bool) *NodeTranslationUpdateOne

SetNillableOutdated sets the "outdated" field if the given value is not nil.

func (*NodeTranslationUpdateOne) SetNillableTnid

func (_u *NodeTranslationUpdateOne) SetNillableTnid(v *int) *NodeTranslationUpdateOne

SetNillableTnid sets the "tnid" field if the given value is not nil.

func (*NodeTranslationUpdateOne) SetNode

SetNode sets the "node" edge to the Node entity.

func (*NodeTranslationUpdateOne) SetNodeID

SetNodeID sets the "node" edge to the Node entity by ID.

func (*NodeTranslationUpdateOne) SetOutdated

SetOutdated sets the "outdated" field.

func (*NodeTranslationUpdateOne) SetTnid

SetTnid sets the "tnid" field.

func (*NodeTranslationUpdateOne) Where

Where appends a list predicates to the NodeTranslationUpdate builder.

type NodeTranslations

type NodeTranslations []*NodeTranslation

NodeTranslations is a parsable slice of NodeTranslation.

type NodeUpdate

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

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) Exec

func (_u *NodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpdate) ExecX

func (_u *NodeUpdate) ExecX(ctx context.Context)

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

func (*NodeUpdate) Mutation

func (_u *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) Save

func (_u *NodeUpdate) Save(ctx context.Context) (int, error)

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

func (*NodeUpdate) SaveX

func (_u *NodeUpdate) SaveX(ctx context.Context) int

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

func (*NodeUpdate) Where

func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

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

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) Exec

func (_u *NodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

func (_u *NodeUpdateOne) ExecX(ctx context.Context)

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

func (*NodeUpdateOne) Mutation

func (_u *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) Save

func (_u *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (_u *NodeUpdateOne) SaveX(ctx context.Context) *Node

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

func (*NodeUpdateOne) Select

func (_u *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne

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

func (*NodeUpdateOne) Where

func (_u *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

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 TextTranslation

type TextTranslation struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Kind holds the value of the "kind" field.
	Kind string `json:"kind,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref string `json:"ref,omitempty"`
	// Lang holds the value of the "lang" field.
	Lang string `json:"lang,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// contains filtered or unexported fields
}

TextTranslation is the model entity for the TextTranslation schema.

func (*TextTranslation) GetValue

func (_m *TextTranslation) GetValue(name string) (ent.Value, error)

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

func (*TextTranslation) String

func (_m *TextTranslation) String() string

String implements the fmt.Stringer.

func (*TextTranslation) Unwrap

func (_m *TextTranslation) Unwrap() *TextTranslation

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

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

type TextTranslationClient

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

TextTranslationClient is a client for the TextTranslation schema.

func NewTextTranslationClient

func NewTextTranslationClient(c config) *TextTranslationClient

NewTextTranslationClient returns a client for the TextTranslation from the given config.

func (*TextTranslationClient) Create

Create returns a builder for creating a TextTranslation entity.

func (*TextTranslationClient) CreateBulk

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

func (*TextTranslationClient) Delete

Delete returns a delete builder for TextTranslation.

func (*TextTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TextTranslationClient) DeleteOneID

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

func (*TextTranslationClient) Get

Get returns a TextTranslation entity by its id.

func (*TextTranslationClient) GetX

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

func (*TextTranslationClient) Hooks

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

Hooks returns the client hooks.

func (*TextTranslationClient) Intercept

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

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

func (*TextTranslationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TextTranslationClient) MapCreateBulk

func (c *TextTranslationClient) MapCreateBulk(slice any, setFunc func(*TextTranslationCreate, int)) *TextTranslationCreateBulk

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

Query returns a query builder for TextTranslation.

func (*TextTranslationClient) Update

Update returns an update builder for TextTranslation.

func (*TextTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TextTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*TextTranslationClient) Use

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

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

type TextTranslationCreate

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

TextTranslationCreate is the builder for creating a TextTranslation entity.

func (*TextTranslationCreate) Exec

Exec executes the query.

func (*TextTranslationCreate) ExecX

func (_c *TextTranslationCreate) ExecX(ctx context.Context)

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

func (*TextTranslationCreate) Mutation

Mutation returns the TextTranslationMutation object of the builder.

func (*TextTranslationCreate) Save

Save creates the TextTranslation in the database.

func (*TextTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TextTranslationCreate) SetID

SetID sets the "id" field.

func (*TextTranslationCreate) SetKind

SetKind sets the "kind" field.

func (*TextTranslationCreate) SetLang

SetLang sets the "lang" field.

func (*TextTranslationCreate) SetRef

SetRef sets the "ref" field.

func (*TextTranslationCreate) SetValue

SetValue sets the "value" field.

type TextTranslationCreateBulk

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

TextTranslationCreateBulk is the builder for creating many TextTranslation entities in bulk.

func (*TextTranslationCreateBulk) Exec

Exec executes the query.

func (*TextTranslationCreateBulk) ExecX

func (_c *TextTranslationCreateBulk) ExecX(ctx context.Context)

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

func (*TextTranslationCreateBulk) Save

Save creates the TextTranslation entities in the database.

func (*TextTranslationCreateBulk) SaveX

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

type TextTranslationDelete

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

TextTranslationDelete is the builder for deleting a TextTranslation entity.

func (*TextTranslationDelete) Exec

func (_d *TextTranslationDelete) Exec(ctx context.Context) (int, error)

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

func (*TextTranslationDelete) ExecX

func (_d *TextTranslationDelete) ExecX(ctx context.Context) int

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

func (*TextTranslationDelete) Where

Where appends a list predicates to the TextTranslationDelete builder.

type TextTranslationDeleteOne

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

TextTranslationDeleteOne is the builder for deleting a single TextTranslation entity.

func (*TextTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*TextTranslationDeleteOne) ExecX

func (_d *TextTranslationDeleteOne) ExecX(ctx context.Context)

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

func (*TextTranslationDeleteOne) Where

Where appends a list predicates to the TextTranslationDelete builder.

type TextTranslationGroupBy

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

TextTranslationGroupBy is the group-by builder for TextTranslation entities.

func (*TextTranslationGroupBy) Aggregate

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

func (*TextTranslationGroupBy) Bool

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

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

func (*TextTranslationGroupBy) BoolX

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

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

func (*TextTranslationGroupBy) Bools

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

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

func (*TextTranslationGroupBy) BoolsX

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

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

func (*TextTranslationGroupBy) Float64

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

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

func (*TextTranslationGroupBy) Float64X

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

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

func (*TextTranslationGroupBy) Float64s

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

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

func (*TextTranslationGroupBy) Float64sX

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

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

func (*TextTranslationGroupBy) Int

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

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

func (*TextTranslationGroupBy) IntX

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

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

func (*TextTranslationGroupBy) Ints

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

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

func (*TextTranslationGroupBy) IntsX

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

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

func (*TextTranslationGroupBy) Scan

func (_g *TextTranslationGroupBy) Scan(ctx context.Context, v any) error

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

func (*TextTranslationGroupBy) ScanX

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

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

func (*TextTranslationGroupBy) String

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

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

func (*TextTranslationGroupBy) StringX

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

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

func (*TextTranslationGroupBy) Strings

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

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

func (*TextTranslationGroupBy) StringsX

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

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

type TextTranslationMutation

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

TextTranslationMutation represents an operation that mutates the TextTranslation nodes in the graph.

func (*TextTranslationMutation) AddField

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

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

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

func (*TextTranslationMutation) AddedField

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

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

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

func (*TextTranslationMutation) AddedIDs

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

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

func (*TextTranslationMutation) ClearEdge

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

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

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

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

func (*TextTranslationMutation) ClearedFields

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

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

func (TextTranslationMutation) Client

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

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

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

func (*TextTranslationMutation) Field

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

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

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

func (*TextTranslationMutation) Fields

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

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

func (m *TextTranslationMutation) 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 (*TextTranslationMutation) Kind

func (m *TextTranslationMutation) Kind() (r string, exists bool)

Kind returns the value of the "kind" field in the mutation.

func (*TextTranslationMutation) Lang

func (m *TextTranslationMutation) Lang() (r string, exists bool)

Lang returns the value of the "lang" field in the mutation.

func (*TextTranslationMutation) OldField

func (m *TextTranslationMutation) 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 (*TextTranslationMutation) OldKind

func (m *TextTranslationMutation) OldKind(ctx context.Context) (v string, err error)

OldKind returns the old "kind" field's value of the TextTranslation entity. If the TextTranslation 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 (*TextTranslationMutation) OldLang

func (m *TextTranslationMutation) OldLang(ctx context.Context) (v string, err error)

OldLang returns the old "lang" field's value of the TextTranslation entity. If the TextTranslation 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 (*TextTranslationMutation) OldRef

func (m *TextTranslationMutation) OldRef(ctx context.Context) (v string, err error)

OldRef returns the old "ref" field's value of the TextTranslation entity. If the TextTranslation 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 (*TextTranslationMutation) OldValue

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

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

func (m *TextTranslationMutation) Op() Op

Op returns the operation name.

func (*TextTranslationMutation) Ref

func (m *TextTranslationMutation) Ref() (r string, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*TextTranslationMutation) RemovedEdges

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

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

func (*TextTranslationMutation) RemovedIDs

func (m *TextTranslationMutation) 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 (*TextTranslationMutation) ResetEdge

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

func (m *TextTranslationMutation) 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 (*TextTranslationMutation) ResetKind

func (m *TextTranslationMutation) ResetKind()

ResetKind resets all changes to the "kind" field.

func (*TextTranslationMutation) ResetLang

func (m *TextTranslationMutation) ResetLang()

ResetLang resets all changes to the "lang" field.

func (*TextTranslationMutation) ResetRef

func (m *TextTranslationMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*TextTranslationMutation) ResetValue

func (m *TextTranslationMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*TextTranslationMutation) SetField

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

func (m *TextTranslationMutation) SetID(id int)

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

func (*TextTranslationMutation) SetKind

func (m *TextTranslationMutation) SetKind(s string)

SetKind sets the "kind" field.

func (*TextTranslationMutation) SetLang

func (m *TextTranslationMutation) SetLang(s string)

SetLang sets the "lang" field.

func (*TextTranslationMutation) SetOp

func (m *TextTranslationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TextTranslationMutation) SetRef

func (m *TextTranslationMutation) SetRef(s string)

SetRef sets the "ref" field.

func (*TextTranslationMutation) SetValue

func (m *TextTranslationMutation) SetValue(s string)

SetValue sets the "value" field.

func (TextTranslationMutation) Tx

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

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

func (*TextTranslationMutation) Type

func (m *TextTranslationMutation) Type() string

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

func (*TextTranslationMutation) Value

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

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

func (*TextTranslationMutation) Where

Where appends a list predicates to the TextTranslationMutation builder.

func (*TextTranslationMutation) WhereP

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

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

type TextTranslationQuery

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

TextTranslationQuery is the builder for querying TextTranslation entities.

func (*TextTranslationQuery) Aggregate

Aggregate returns a TextTranslationSelect configured with the given aggregations.

func (*TextTranslationQuery) All

All executes the query and returns a list of TextTranslations.

func (*TextTranslationQuery) AllX

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

func (*TextTranslationQuery) Clone

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

func (*TextTranslationQuery) Count

func (_q *TextTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TextTranslationQuery) CountX

func (_q *TextTranslationQuery) CountX(ctx context.Context) int

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

func (*TextTranslationQuery) Exist

func (_q *TextTranslationQuery) Exist(ctx context.Context) (bool, error)

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

func (*TextTranslationQuery) ExistX

func (_q *TextTranslationQuery) ExistX(ctx context.Context) bool

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

func (*TextTranslationQuery) First

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

func (*TextTranslationQuery) FirstID

func (_q *TextTranslationQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TextTranslationQuery) FirstIDX

func (_q *TextTranslationQuery) FirstIDX(ctx context.Context) int

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

func (*TextTranslationQuery) FirstX

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

func (*TextTranslationQuery) GroupBy

func (_q *TextTranslationQuery) GroupBy(field string, fields ...string) *TextTranslationGroupBy

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

client.TextTranslation.Query().
	GroupBy(texttranslation.FieldKind).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*TextTranslationQuery) IDs

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

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

func (*TextTranslationQuery) IDsX

func (_q *TextTranslationQuery) IDsX(ctx context.Context) []int

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

func (*TextTranslationQuery) Limit

func (_q *TextTranslationQuery) Limit(limit int) *TextTranslationQuery

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

func (*TextTranslationQuery) Offset

func (_q *TextTranslationQuery) Offset(offset int) *TextTranslationQuery

Offset to start from.

func (*TextTranslationQuery) Only

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

func (*TextTranslationQuery) OnlyID

func (_q *TextTranslationQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TextTranslationQuery) OnlyIDX

func (_q *TextTranslationQuery) OnlyIDX(ctx context.Context) int

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

func (*TextTranslationQuery) OnlyX

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

func (*TextTranslationQuery) Order

Order specifies how the records should be ordered.

func (*TextTranslationQuery) Select

func (_q *TextTranslationQuery) Select(fields ...string) *TextTranslationSelect

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

client.TextTranslation.Query().
	Select(texttranslation.FieldKind).
	Scan(ctx, &v)

func (*TextTranslationQuery) Unique

func (_q *TextTranslationQuery) Unique(unique bool) *TextTranslationQuery

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

Where adds a new predicate for the TextTranslationQuery builder.

type TextTranslationSelect

type TextTranslationSelect struct {
	*TextTranslationQuery
	// contains filtered or unexported fields
}

TextTranslationSelect is the builder for selecting fields of TextTranslation entities.

func (*TextTranslationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*TextTranslationSelect) Bool

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

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

func (*TextTranslationSelect) BoolX

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

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

func (*TextTranslationSelect) Bools

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

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

func (*TextTranslationSelect) BoolsX

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

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

func (*TextTranslationSelect) Float64

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

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

func (*TextTranslationSelect) Float64X

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

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

func (*TextTranslationSelect) Float64s

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

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

func (*TextTranslationSelect) Float64sX

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

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

func (*TextTranslationSelect) Int

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

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

func (*TextTranslationSelect) IntX

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

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

func (*TextTranslationSelect) Ints

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

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

func (*TextTranslationSelect) IntsX

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

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

func (*TextTranslationSelect) Scan

func (_s *TextTranslationSelect) Scan(ctx context.Context, v any) error

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

func (*TextTranslationSelect) ScanX

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

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

func (*TextTranslationSelect) String

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

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

func (*TextTranslationSelect) StringX

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

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

func (*TextTranslationSelect) Strings

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

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

func (*TextTranslationSelect) StringsX

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

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

type TextTranslationUpdate

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

TextTranslationUpdate is the builder for updating TextTranslation entities.

func (*TextTranslationUpdate) Exec

Exec executes the query.

func (*TextTranslationUpdate) ExecX

func (_u *TextTranslationUpdate) ExecX(ctx context.Context)

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

func (*TextTranslationUpdate) Mutation

Mutation returns the TextTranslationMutation object of the builder.

func (*TextTranslationUpdate) Save

func (_u *TextTranslationUpdate) Save(ctx context.Context) (int, error)

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

func (*TextTranslationUpdate) SaveX

func (_u *TextTranslationUpdate) SaveX(ctx context.Context) int

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

func (*TextTranslationUpdate) SetKind

SetKind sets the "kind" field.

func (*TextTranslationUpdate) SetLang

SetLang sets the "lang" field.

func (*TextTranslationUpdate) SetNillableKind

func (_u *TextTranslationUpdate) SetNillableKind(v *string) *TextTranslationUpdate

SetNillableKind sets the "kind" field if the given value is not nil.

func (*TextTranslationUpdate) SetNillableLang

func (_u *TextTranslationUpdate) SetNillableLang(v *string) *TextTranslationUpdate

SetNillableLang sets the "lang" field if the given value is not nil.

func (*TextTranslationUpdate) SetNillableRef

func (_u *TextTranslationUpdate) SetNillableRef(v *string) *TextTranslationUpdate

SetNillableRef sets the "ref" field if the given value is not nil.

func (*TextTranslationUpdate) SetNillableValue

func (_u *TextTranslationUpdate) SetNillableValue(v *string) *TextTranslationUpdate

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

func (*TextTranslationUpdate) SetRef

SetRef sets the "ref" field.

func (*TextTranslationUpdate) SetValue

SetValue sets the "value" field.

func (*TextTranslationUpdate) Where

Where appends a list predicates to the TextTranslationUpdate builder.

type TextTranslationUpdateOne

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

TextTranslationUpdateOne is the builder for updating a single TextTranslation entity.

func (*TextTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*TextTranslationUpdateOne) ExecX

func (_u *TextTranslationUpdateOne) ExecX(ctx context.Context)

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

func (*TextTranslationUpdateOne) Mutation

Mutation returns the TextTranslationMutation object of the builder.

func (*TextTranslationUpdateOne) Save

Save executes the query and returns the updated TextTranslation entity.

func (*TextTranslationUpdateOne) SaveX

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

func (*TextTranslationUpdateOne) Select

func (_u *TextTranslationUpdateOne) Select(field string, fields ...string) *TextTranslationUpdateOne

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

func (*TextTranslationUpdateOne) SetKind

SetKind sets the "kind" field.

func (*TextTranslationUpdateOne) SetLang

SetLang sets the "lang" field.

func (*TextTranslationUpdateOne) SetNillableKind

func (_u *TextTranslationUpdateOne) SetNillableKind(v *string) *TextTranslationUpdateOne

SetNillableKind sets the "kind" field if the given value is not nil.

func (*TextTranslationUpdateOne) SetNillableLang

func (_u *TextTranslationUpdateOne) SetNillableLang(v *string) *TextTranslationUpdateOne

SetNillableLang sets the "lang" field if the given value is not nil.

func (*TextTranslationUpdateOne) SetNillableRef

SetNillableRef sets the "ref" field if the given value is not nil.

func (*TextTranslationUpdateOne) SetNillableValue

func (_u *TextTranslationUpdateOne) SetNillableValue(v *string) *TextTranslationUpdateOne

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

func (*TextTranslationUpdateOne) SetRef

SetRef sets the "ref" field.

func (*TextTranslationUpdateOne) SetValue

SetValue sets the "value" field.

func (*TextTranslationUpdateOne) Where

Where appends a list predicates to the TextTranslationUpdate builder.

type TextTranslations

type TextTranslations []*TextTranslation

TextTranslations is a parsable slice of TextTranslation.

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 {

	// LanguageSettings is the client for interacting with the LanguageSettings builders.
	LanguageSettings *LanguageSettingsClient
	// LanguageVisibility is the client for interacting with the LanguageVisibility builders.
	LanguageVisibility *LanguageVisibilityClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// NodeTranslation is the client for interacting with the NodeTranslation builders.
	NodeTranslation *NodeTranslationClient
	// TextTranslation is the client for interacting with the TextTranslation builders.
	TextTranslation *TextTranslationClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL