ent

package
v0.0.0-...-192b5dc Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: GPL-3.0 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.
	TypeDefinition     = "Definition"
	TypeLemma          = "Lemma"
	TypeSense          = "Sense"
	TypeSenseRelation  = "SenseRelation"
	TypeSynset         = "Synset"
	TypeSynsetRelation = "SynsetRelation"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Definition is the client for interacting with the Definition builders.
	Definition *DefinitionClient
	// Lemma is the client for interacting with the Lemma builders.
	Lemma *LemmaClient
	// Sense is the client for interacting with the Sense builders.
	Sense *SenseClient
	// SenseRelation is the client for interacting with the SenseRelation builders.
	SenseRelation *SenseRelationClient
	// Synset is the client for interacting with the Synset builders.
	Synset *SynsetClient
	// SynsetRelation is the client for interacting with the SynsetRelation builders.
	SynsetRelation *SynsetRelationClient
	// 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().
	Definition.
	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 Definition

type Definition struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DefinitionQuery when eager-loading is set.
	Edges DefinitionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Definition is the model entity for the Definition schema.

func (*Definition) QuerySynset

func (d *Definition) QuerySynset() *SynsetQuery

QuerySynset queries the "synset" edge of the Definition entity.

func (*Definition) String

func (d *Definition) String() string

String implements the fmt.Stringer.

func (*Definition) Unwrap

func (d *Definition) Unwrap() *Definition

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

func (d *Definition) Update() *DefinitionUpdateOne

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

func (*Definition) Value

func (d *Definition) Value(name string) (ent.Value, error)

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

type DefinitionClient

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

DefinitionClient is a client for the Definition schema.

func NewDefinitionClient

func NewDefinitionClient(c config) *DefinitionClient

NewDefinitionClient returns a client for the Definition from the given config.

func (*DefinitionClient) Create

func (c *DefinitionClient) Create() *DefinitionCreate

Create returns a builder for creating a Definition entity.

func (*DefinitionClient) CreateBulk

func (c *DefinitionClient) CreateBulk(builders ...*DefinitionCreate) *DefinitionCreateBulk

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

func (*DefinitionClient) Delete

func (c *DefinitionClient) Delete() *DefinitionDelete

Delete returns a delete builder for Definition.

func (*DefinitionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DefinitionClient) DeleteOneID

func (c *DefinitionClient) DeleteOneID(id int) *DefinitionDeleteOne

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

func (*DefinitionClient) Get

func (c *DefinitionClient) Get(ctx context.Context, id int) (*Definition, error)

Get returns a Definition entity by its id.

func (*DefinitionClient) GetX

func (c *DefinitionClient) GetX(ctx context.Context, id int) *Definition

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

func (*DefinitionClient) Hooks

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

Hooks returns the client hooks.

func (*DefinitionClient) Intercept

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

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

func (*DefinitionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DefinitionClient) MapCreateBulk

func (c *DefinitionClient) MapCreateBulk(slice any, setFunc func(*DefinitionCreate, int)) *DefinitionCreateBulk

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

func (c *DefinitionClient) Query() *DefinitionQuery

Query returns a query builder for Definition.

func (*DefinitionClient) QuerySynset

func (c *DefinitionClient) QuerySynset(d *Definition) *SynsetQuery

QuerySynset queries the synset edge of a Definition.

func (*DefinitionClient) Update

func (c *DefinitionClient) Update() *DefinitionUpdate

Update returns an update builder for Definition.

func (*DefinitionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DefinitionClient) UpdateOneID

func (c *DefinitionClient) UpdateOneID(id int) *DefinitionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DefinitionClient) Use

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

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

type DefinitionCreate

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

DefinitionCreate is the builder for creating a Definition entity.

func (*DefinitionCreate) Exec

func (dc *DefinitionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DefinitionCreate) ExecX

func (dc *DefinitionCreate) ExecX(ctx context.Context)

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

func (*DefinitionCreate) Mutation

func (dc *DefinitionCreate) Mutation() *DefinitionMutation

Mutation returns the DefinitionMutation object of the builder.

func (*DefinitionCreate) Save

func (dc *DefinitionCreate) Save(ctx context.Context) (*Definition, error)

Save creates the Definition in the database.

func (*DefinitionCreate) SaveX

func (dc *DefinitionCreate) SaveX(ctx context.Context) *Definition

SaveX calls Save and panics if Save returns an error.

func (*DefinitionCreate) SetNillableSynsetID

func (dc *DefinitionCreate) SetNillableSynsetID(id *string) *DefinitionCreate

SetNillableSynsetID sets the "synset" edge to the Synset entity by ID if the given value is not nil.

func (*DefinitionCreate) SetSynset

func (dc *DefinitionCreate) SetSynset(s *Synset) *DefinitionCreate

SetSynset sets the "synset" edge to the Synset entity.

func (*DefinitionCreate) SetSynsetID

func (dc *DefinitionCreate) SetSynsetID(id string) *DefinitionCreate

SetSynsetID sets the "synset" edge to the Synset entity by ID.

func (*DefinitionCreate) SetText

func (dc *DefinitionCreate) SetText(s string) *DefinitionCreate

SetText sets the "text" field.

type DefinitionCreateBulk

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

DefinitionCreateBulk is the builder for creating many Definition entities in bulk.

func (*DefinitionCreateBulk) Exec

func (dcb *DefinitionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DefinitionCreateBulk) ExecX

func (dcb *DefinitionCreateBulk) ExecX(ctx context.Context)

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

func (*DefinitionCreateBulk) Save

func (dcb *DefinitionCreateBulk) Save(ctx context.Context) ([]*Definition, error)

Save creates the Definition entities in the database.

func (*DefinitionCreateBulk) SaveX

func (dcb *DefinitionCreateBulk) SaveX(ctx context.Context) []*Definition

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

type DefinitionDelete

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

DefinitionDelete is the builder for deleting a Definition entity.

func (*DefinitionDelete) Exec

func (dd *DefinitionDelete) Exec(ctx context.Context) (int, error)

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

func (*DefinitionDelete) ExecX

func (dd *DefinitionDelete) ExecX(ctx context.Context) int

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

func (*DefinitionDelete) Where

Where appends a list predicates to the DefinitionDelete builder.

type DefinitionDeleteOne

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

DefinitionDeleteOne is the builder for deleting a single Definition entity.

func (*DefinitionDeleteOne) Exec

func (ddo *DefinitionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DefinitionDeleteOne) ExecX

func (ddo *DefinitionDeleteOne) ExecX(ctx context.Context)

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

func (*DefinitionDeleteOne) Where

Where appends a list predicates to the DefinitionDelete builder.

type DefinitionEdges

type DefinitionEdges struct {
	// Synset holds the value of the synset edge.
	Synset *Synset `json:"synset,omitempty"`
	// contains filtered or unexported fields
}

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

func (DefinitionEdges) SynsetOrErr

func (e DefinitionEdges) SynsetOrErr() (*Synset, error)

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

type DefinitionGroupBy

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

DefinitionGroupBy is the group-by builder for Definition entities.

func (*DefinitionGroupBy) Aggregate

func (dgb *DefinitionGroupBy) Aggregate(fns ...AggregateFunc) *DefinitionGroupBy

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

func (*DefinitionGroupBy) Bool

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

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

func (*DefinitionGroupBy) BoolX

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

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

func (*DefinitionGroupBy) Bools

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

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

func (*DefinitionGroupBy) BoolsX

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

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

func (*DefinitionGroupBy) Float64

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

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

func (*DefinitionGroupBy) Float64X

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

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

func (*DefinitionGroupBy) Float64s

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

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

func (*DefinitionGroupBy) Float64sX

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

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

func (*DefinitionGroupBy) Int

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

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

func (*DefinitionGroupBy) IntX

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

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

func (*DefinitionGroupBy) Ints

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

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

func (*DefinitionGroupBy) IntsX

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

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

func (*DefinitionGroupBy) Scan

func (dgb *DefinitionGroupBy) Scan(ctx context.Context, v any) error

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

func (*DefinitionGroupBy) ScanX

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

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

func (*DefinitionGroupBy) String

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

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

func (*DefinitionGroupBy) StringX

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

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

func (*DefinitionGroupBy) Strings

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

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

func (*DefinitionGroupBy) StringsX

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

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

type DefinitionMutation

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

DefinitionMutation represents an operation that mutates the Definition nodes in the graph.

func (*DefinitionMutation) AddField

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

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

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

func (*DefinitionMutation) AddedField

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

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

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

func (*DefinitionMutation) AddedIDs

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

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

func (*DefinitionMutation) ClearEdge

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

func (m *DefinitionMutation) 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 (*DefinitionMutation) ClearSynset

func (m *DefinitionMutation) ClearSynset()

ClearSynset clears the "synset" edge to the Synset entity.

func (*DefinitionMutation) ClearedEdges

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

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

func (*DefinitionMutation) ClearedFields

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

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

func (DefinitionMutation) Client

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

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

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

func (*DefinitionMutation) Field

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

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

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

func (*DefinitionMutation) Fields

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

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

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

func (m *DefinitionMutation) 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 (*DefinitionMutation) OldText

func (m *DefinitionMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Definition entity. If the Definition 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 (*DefinitionMutation) Op

func (m *DefinitionMutation) Op() Op

Op returns the operation name.

func (*DefinitionMutation) RemovedEdges

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

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

func (*DefinitionMutation) RemovedIDs

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

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

func (m *DefinitionMutation) 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 (*DefinitionMutation) ResetSynset

func (m *DefinitionMutation) ResetSynset()

ResetSynset resets all changes to the "synset" edge.

func (*DefinitionMutation) ResetText

func (m *DefinitionMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*DefinitionMutation) SetField

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

func (m *DefinitionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DefinitionMutation) SetSynsetID

func (m *DefinitionMutation) SetSynsetID(id string)

SetSynsetID sets the "synset" edge to the Synset entity by id.

func (*DefinitionMutation) SetText

func (m *DefinitionMutation) SetText(s string)

SetText sets the "text" field.

func (*DefinitionMutation) SynsetCleared

func (m *DefinitionMutation) SynsetCleared() bool

SynsetCleared reports if the "synset" edge to the Synset entity was cleared.

func (*DefinitionMutation) SynsetID

func (m *DefinitionMutation) SynsetID() (id string, exists bool)

SynsetID returns the "synset" edge ID in the mutation.

func (*DefinitionMutation) SynsetIDs

func (m *DefinitionMutation) SynsetIDs() (ids []string)

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

func (*DefinitionMutation) Text

func (m *DefinitionMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (DefinitionMutation) Tx

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

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

func (*DefinitionMutation) Type

func (m *DefinitionMutation) Type() string

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

func (*DefinitionMutation) Where

func (m *DefinitionMutation) Where(ps ...predicate.Definition)

Where appends a list predicates to the DefinitionMutation builder.

func (*DefinitionMutation) WhereP

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

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

type DefinitionQuery

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

DefinitionQuery is the builder for querying Definition entities.

func (*DefinitionQuery) Aggregate

func (dq *DefinitionQuery) Aggregate(fns ...AggregateFunc) *DefinitionSelect

Aggregate returns a DefinitionSelect configured with the given aggregations.

func (*DefinitionQuery) All

func (dq *DefinitionQuery) All(ctx context.Context) ([]*Definition, error)

All executes the query and returns a list of Definitions.

func (*DefinitionQuery) AllX

func (dq *DefinitionQuery) AllX(ctx context.Context) []*Definition

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

func (*DefinitionQuery) Clone

func (dq *DefinitionQuery) Clone() *DefinitionQuery

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

func (*DefinitionQuery) Count

func (dq *DefinitionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DefinitionQuery) CountX

func (dq *DefinitionQuery) CountX(ctx context.Context) int

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

func (*DefinitionQuery) Exist

func (dq *DefinitionQuery) Exist(ctx context.Context) (bool, error)

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

func (*DefinitionQuery) ExistX

func (dq *DefinitionQuery) ExistX(ctx context.Context) bool

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

func (*DefinitionQuery) First

func (dq *DefinitionQuery) First(ctx context.Context) (*Definition, error)

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

func (*DefinitionQuery) FirstID

func (dq *DefinitionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DefinitionQuery) FirstIDX

func (dq *DefinitionQuery) FirstIDX(ctx context.Context) int

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

func (*DefinitionQuery) FirstX

func (dq *DefinitionQuery) FirstX(ctx context.Context) *Definition

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

func (*DefinitionQuery) GroupBy

func (dq *DefinitionQuery) GroupBy(field string, fields ...string) *DefinitionGroupBy

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

Example:

var v []struct {
	Text string `json:"text,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Definition.Query().
	GroupBy(definition.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DefinitionQuery) IDs

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

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

func (*DefinitionQuery) IDsX

func (dq *DefinitionQuery) IDsX(ctx context.Context) []int

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

func (*DefinitionQuery) Limit

func (dq *DefinitionQuery) Limit(limit int) *DefinitionQuery

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

func (*DefinitionQuery) Offset

func (dq *DefinitionQuery) Offset(offset int) *DefinitionQuery

Offset to start from.

func (*DefinitionQuery) Only

func (dq *DefinitionQuery) Only(ctx context.Context) (*Definition, error)

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

func (*DefinitionQuery) OnlyID

func (dq *DefinitionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DefinitionQuery) OnlyIDX

func (dq *DefinitionQuery) OnlyIDX(ctx context.Context) int

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

func (*DefinitionQuery) OnlyX

func (dq *DefinitionQuery) OnlyX(ctx context.Context) *Definition

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

func (*DefinitionQuery) Order

Order specifies how the records should be ordered.

func (*DefinitionQuery) QuerySynset

func (dq *DefinitionQuery) QuerySynset() *SynsetQuery

QuerySynset chains the current query on the "synset" edge.

func (*DefinitionQuery) Select

func (dq *DefinitionQuery) Select(fields ...string) *DefinitionSelect

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

Example:

var v []struct {
	Text string `json:"text,omitempty"`
}

client.Definition.Query().
	Select(definition.FieldText).
	Scan(ctx, &v)

func (*DefinitionQuery) Unique

func (dq *DefinitionQuery) Unique(unique bool) *DefinitionQuery

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

Where adds a new predicate for the DefinitionQuery builder.

func (*DefinitionQuery) WithSynset

func (dq *DefinitionQuery) WithSynset(opts ...func(*SynsetQuery)) *DefinitionQuery

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

type DefinitionSelect

type DefinitionSelect struct {
	*DefinitionQuery
	// contains filtered or unexported fields
}

DefinitionSelect is the builder for selecting fields of Definition entities.

func (*DefinitionSelect) Aggregate

func (ds *DefinitionSelect) Aggregate(fns ...AggregateFunc) *DefinitionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DefinitionSelect) Bool

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

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

func (*DefinitionSelect) BoolX

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

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

func (*DefinitionSelect) Bools

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

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

func (*DefinitionSelect) BoolsX

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

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

func (*DefinitionSelect) Float64

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

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

func (*DefinitionSelect) Float64X

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

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

func (*DefinitionSelect) Float64s

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

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

func (*DefinitionSelect) Float64sX

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

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

func (*DefinitionSelect) Int

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

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

func (*DefinitionSelect) IntX

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

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

func (*DefinitionSelect) Ints

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

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

func (*DefinitionSelect) IntsX

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

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

func (*DefinitionSelect) Scan

func (ds *DefinitionSelect) Scan(ctx context.Context, v any) error

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

func (*DefinitionSelect) ScanX

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

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

func (*DefinitionSelect) String

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

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

func (*DefinitionSelect) StringX

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

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

func (*DefinitionSelect) Strings

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

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

func (*DefinitionSelect) StringsX

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

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

type DefinitionUpdate

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

DefinitionUpdate is the builder for updating Definition entities.

func (*DefinitionUpdate) ClearSynset

func (du *DefinitionUpdate) ClearSynset() *DefinitionUpdate

ClearSynset clears the "synset" edge to the Synset entity.

func (*DefinitionUpdate) Exec

func (du *DefinitionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DefinitionUpdate) ExecX

func (du *DefinitionUpdate) ExecX(ctx context.Context)

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

func (*DefinitionUpdate) Mutation

func (du *DefinitionUpdate) Mutation() *DefinitionMutation

Mutation returns the DefinitionMutation object of the builder.

func (*DefinitionUpdate) Save

func (du *DefinitionUpdate) Save(ctx context.Context) (int, error)

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

func (*DefinitionUpdate) SaveX

func (du *DefinitionUpdate) SaveX(ctx context.Context) int

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

func (*DefinitionUpdate) SetNillableSynsetID

func (du *DefinitionUpdate) SetNillableSynsetID(id *string) *DefinitionUpdate

SetNillableSynsetID sets the "synset" edge to the Synset entity by ID if the given value is not nil.

func (*DefinitionUpdate) SetNillableText

func (du *DefinitionUpdate) SetNillableText(s *string) *DefinitionUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*DefinitionUpdate) SetSynset

func (du *DefinitionUpdate) SetSynset(s *Synset) *DefinitionUpdate

SetSynset sets the "synset" edge to the Synset entity.

func (*DefinitionUpdate) SetSynsetID

func (du *DefinitionUpdate) SetSynsetID(id string) *DefinitionUpdate

SetSynsetID sets the "synset" edge to the Synset entity by ID.

func (*DefinitionUpdate) SetText

func (du *DefinitionUpdate) SetText(s string) *DefinitionUpdate

SetText sets the "text" field.

func (*DefinitionUpdate) Where

Where appends a list predicates to the DefinitionUpdate builder.

type DefinitionUpdateOne

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

DefinitionUpdateOne is the builder for updating a single Definition entity.

func (*DefinitionUpdateOne) ClearSynset

func (duo *DefinitionUpdateOne) ClearSynset() *DefinitionUpdateOne

ClearSynset clears the "synset" edge to the Synset entity.

func (*DefinitionUpdateOne) Exec

func (duo *DefinitionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DefinitionUpdateOne) ExecX

func (duo *DefinitionUpdateOne) ExecX(ctx context.Context)

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

func (*DefinitionUpdateOne) Mutation

func (duo *DefinitionUpdateOne) Mutation() *DefinitionMutation

Mutation returns the DefinitionMutation object of the builder.

func (*DefinitionUpdateOne) Save

func (duo *DefinitionUpdateOne) Save(ctx context.Context) (*Definition, error)

Save executes the query and returns the updated Definition entity.

func (*DefinitionUpdateOne) SaveX

func (duo *DefinitionUpdateOne) SaveX(ctx context.Context) *Definition

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

func (*DefinitionUpdateOne) Select

func (duo *DefinitionUpdateOne) Select(field string, fields ...string) *DefinitionUpdateOne

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

func (*DefinitionUpdateOne) SetNillableSynsetID

func (duo *DefinitionUpdateOne) SetNillableSynsetID(id *string) *DefinitionUpdateOne

SetNillableSynsetID sets the "synset" edge to the Synset entity by ID if the given value is not nil.

func (*DefinitionUpdateOne) SetNillableText

func (duo *DefinitionUpdateOne) SetNillableText(s *string) *DefinitionUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*DefinitionUpdateOne) SetSynset

func (duo *DefinitionUpdateOne) SetSynset(s *Synset) *DefinitionUpdateOne

SetSynset sets the "synset" edge to the Synset entity.

func (*DefinitionUpdateOne) SetSynsetID

func (duo *DefinitionUpdateOne) SetSynsetID(id string) *DefinitionUpdateOne

SetSynsetID sets the "synset" edge to the Synset entity by ID.

func (*DefinitionUpdateOne) SetText

SetText sets the "text" field.

func (*DefinitionUpdateOne) Where

Where appends a list predicates to the DefinitionUpdate builder.

type Definitions

type Definitions []*Definition

Definitions is a parsable slice of Definition.

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 Lemma

type Lemma struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// WrittenForm holds the value of the "writtenForm" field.
	WrittenForm string `json:"writtenForm,omitempty"`
	// PartOfSpeech holds the value of the "partOfSpeech" field.
	PartOfSpeech string `json:"partOfSpeech,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LemmaQuery when eager-loading is set.
	Edges LemmaEdges `json:"edges"`
	// contains filtered or unexported fields
}

Lemma is the model entity for the Lemma schema.

func (*Lemma) QuerySenses

func (l *Lemma) QuerySenses() *SenseQuery

QuerySenses queries the "senses" edge of the Lemma entity.

func (*Lemma) String

func (l *Lemma) String() string

String implements the fmt.Stringer.

func (*Lemma) Unwrap

func (l *Lemma) Unwrap() *Lemma

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

func (l *Lemma) Update() *LemmaUpdateOne

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

func (*Lemma) Value

func (l *Lemma) Value(name string) (ent.Value, error)

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

type LemmaClient

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

LemmaClient is a client for the Lemma schema.

func NewLemmaClient

func NewLemmaClient(c config) *LemmaClient

NewLemmaClient returns a client for the Lemma from the given config.

func (*LemmaClient) Create

func (c *LemmaClient) Create() *LemmaCreate

Create returns a builder for creating a Lemma entity.

func (*LemmaClient) CreateBulk

func (c *LemmaClient) CreateBulk(builders ...*LemmaCreate) *LemmaCreateBulk

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

func (*LemmaClient) Delete

func (c *LemmaClient) Delete() *LemmaDelete

Delete returns a delete builder for Lemma.

func (*LemmaClient) DeleteOne

func (c *LemmaClient) DeleteOne(l *Lemma) *LemmaDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LemmaClient) DeleteOneID

func (c *LemmaClient) DeleteOneID(id string) *LemmaDeleteOne

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

func (*LemmaClient) Get

func (c *LemmaClient) Get(ctx context.Context, id string) (*Lemma, error)

Get returns a Lemma entity by its id.

func (*LemmaClient) GetX

func (c *LemmaClient) GetX(ctx context.Context, id string) *Lemma

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

func (*LemmaClient) Hooks

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

Hooks returns the client hooks.

func (*LemmaClient) Intercept

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

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

func (*LemmaClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LemmaClient) MapCreateBulk

func (c *LemmaClient) MapCreateBulk(slice any, setFunc func(*LemmaCreate, int)) *LemmaCreateBulk

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

func (c *LemmaClient) Query() *LemmaQuery

Query returns a query builder for Lemma.

func (*LemmaClient) QuerySenses

func (c *LemmaClient) QuerySenses(l *Lemma) *SenseQuery

QuerySenses queries the senses edge of a Lemma.

func (*LemmaClient) Update

func (c *LemmaClient) Update() *LemmaUpdate

Update returns an update builder for Lemma.

func (*LemmaClient) UpdateOne

func (c *LemmaClient) UpdateOne(l *Lemma) *LemmaUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LemmaClient) UpdateOneID

func (c *LemmaClient) UpdateOneID(id string) *LemmaUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LemmaClient) Use

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

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

type LemmaCreate

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

LemmaCreate is the builder for creating a Lemma entity.

func (*LemmaCreate) AddSenseIDs

func (lc *LemmaCreate) AddSenseIDs(ids ...string) *LemmaCreate

AddSenseIDs adds the "senses" edge to the Sense entity by IDs.

func (*LemmaCreate) AddSenses

func (lc *LemmaCreate) AddSenses(s ...*Sense) *LemmaCreate

AddSenses adds the "senses" edges to the Sense entity.

func (*LemmaCreate) Exec

func (lc *LemmaCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LemmaCreate) ExecX

func (lc *LemmaCreate) ExecX(ctx context.Context)

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

func (*LemmaCreate) Mutation

func (lc *LemmaCreate) Mutation() *LemmaMutation

Mutation returns the LemmaMutation object of the builder.

func (*LemmaCreate) Save

func (lc *LemmaCreate) Save(ctx context.Context) (*Lemma, error)

Save creates the Lemma in the database.

func (*LemmaCreate) SaveX

func (lc *LemmaCreate) SaveX(ctx context.Context) *Lemma

SaveX calls Save and panics if Save returns an error.

func (*LemmaCreate) SetID

func (lc *LemmaCreate) SetID(s string) *LemmaCreate

SetID sets the "id" field.

func (*LemmaCreate) SetPartOfSpeech

func (lc *LemmaCreate) SetPartOfSpeech(s string) *LemmaCreate

SetPartOfSpeech sets the "partOfSpeech" field.

func (*LemmaCreate) SetWrittenForm

func (lc *LemmaCreate) SetWrittenForm(s string) *LemmaCreate

SetWrittenForm sets the "writtenForm" field.

type LemmaCreateBulk

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

LemmaCreateBulk is the builder for creating many Lemma entities in bulk.

func (*LemmaCreateBulk) Exec

func (lcb *LemmaCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LemmaCreateBulk) ExecX

func (lcb *LemmaCreateBulk) ExecX(ctx context.Context)

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

func (*LemmaCreateBulk) Save

func (lcb *LemmaCreateBulk) Save(ctx context.Context) ([]*Lemma, error)

Save creates the Lemma entities in the database.

func (*LemmaCreateBulk) SaveX

func (lcb *LemmaCreateBulk) SaveX(ctx context.Context) []*Lemma

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

type LemmaDelete

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

LemmaDelete is the builder for deleting a Lemma entity.

func (*LemmaDelete) Exec

func (ld *LemmaDelete) Exec(ctx context.Context) (int, error)

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

func (*LemmaDelete) ExecX

func (ld *LemmaDelete) ExecX(ctx context.Context) int

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

func (*LemmaDelete) Where

func (ld *LemmaDelete) Where(ps ...predicate.Lemma) *LemmaDelete

Where appends a list predicates to the LemmaDelete builder.

type LemmaDeleteOne

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

LemmaDeleteOne is the builder for deleting a single Lemma entity.

func (*LemmaDeleteOne) Exec

func (ldo *LemmaDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LemmaDeleteOne) ExecX

func (ldo *LemmaDeleteOne) ExecX(ctx context.Context)

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

func (*LemmaDeleteOne) Where

func (ldo *LemmaDeleteOne) Where(ps ...predicate.Lemma) *LemmaDeleteOne

Where appends a list predicates to the LemmaDelete builder.

type LemmaEdges

type LemmaEdges struct {
	// Senses holds the value of the senses edge.
	Senses []*Sense `json:"senses,omitempty"`
	// contains filtered or unexported fields
}

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

func (LemmaEdges) SensesOrErr

func (e LemmaEdges) SensesOrErr() ([]*Sense, error)

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

type LemmaGroupBy

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

LemmaGroupBy is the group-by builder for Lemma entities.

func (*LemmaGroupBy) Aggregate

func (lgb *LemmaGroupBy) Aggregate(fns ...AggregateFunc) *LemmaGroupBy

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

func (*LemmaGroupBy) Bool

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

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

func (*LemmaGroupBy) BoolX

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

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

func (*LemmaGroupBy) Bools

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

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

func (*LemmaGroupBy) BoolsX

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

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

func (*LemmaGroupBy) Float64

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

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

func (*LemmaGroupBy) Float64X

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

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

func (*LemmaGroupBy) Float64s

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

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

func (*LemmaGroupBy) Float64sX

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

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

func (*LemmaGroupBy) Int

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

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

func (*LemmaGroupBy) IntX

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

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

func (*LemmaGroupBy) Ints

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

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

func (*LemmaGroupBy) IntsX

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

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

func (*LemmaGroupBy) Scan

func (lgb *LemmaGroupBy) Scan(ctx context.Context, v any) error

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

func (*LemmaGroupBy) ScanX

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

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

func (*LemmaGroupBy) String

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

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

func (*LemmaGroupBy) StringX

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

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

func (*LemmaGroupBy) Strings

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

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

func (*LemmaGroupBy) StringsX

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

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

type LemmaMutation

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

LemmaMutation represents an operation that mutates the Lemma nodes in the graph.

func (*LemmaMutation) AddField

func (m *LemmaMutation) 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 (*LemmaMutation) AddSenseIDs

func (m *LemmaMutation) AddSenseIDs(ids ...string)

AddSenseIDs adds the "senses" edge to the Sense entity by ids.

func (*LemmaMutation) AddedEdges

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

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

func (*LemmaMutation) AddedField

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

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

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

func (*LemmaMutation) AddedIDs

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

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

func (*LemmaMutation) ClearEdge

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

func (m *LemmaMutation) 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 (*LemmaMutation) ClearSenses

func (m *LemmaMutation) ClearSenses()

ClearSenses clears the "senses" edge to the Sense entity.

func (*LemmaMutation) ClearedEdges

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

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

func (*LemmaMutation) ClearedFields

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

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

func (LemmaMutation) Client

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

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

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

func (*LemmaMutation) Field

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

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

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

func (*LemmaMutation) Fields

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

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

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

func (*LemmaMutation) IDs

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

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

func (*LemmaMutation) OldField

func (m *LemmaMutation) 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 (*LemmaMutation) OldPartOfSpeech

func (m *LemmaMutation) OldPartOfSpeech(ctx context.Context) (v string, err error)

OldPartOfSpeech returns the old "partOfSpeech" field's value of the Lemma entity. If the Lemma 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 (*LemmaMutation) OldWrittenForm

func (m *LemmaMutation) OldWrittenForm(ctx context.Context) (v string, err error)

OldWrittenForm returns the old "writtenForm" field's value of the Lemma entity. If the Lemma 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 (*LemmaMutation) Op

func (m *LemmaMutation) Op() Op

Op returns the operation name.

func (*LemmaMutation) PartOfSpeech

func (m *LemmaMutation) PartOfSpeech() (r string, exists bool)

PartOfSpeech returns the value of the "partOfSpeech" field in the mutation.

func (*LemmaMutation) RemoveSenseIDs

func (m *LemmaMutation) RemoveSenseIDs(ids ...string)

RemoveSenseIDs removes the "senses" edge to the Sense entity by IDs.

func (*LemmaMutation) RemovedEdges

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

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

func (*LemmaMutation) RemovedIDs

func (m *LemmaMutation) 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 (*LemmaMutation) RemovedSensesIDs

func (m *LemmaMutation) RemovedSensesIDs() (ids []string)

RemovedSenses returns the removed IDs of the "senses" edge to the Sense entity.

func (*LemmaMutation) ResetEdge

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

func (m *LemmaMutation) 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 (*LemmaMutation) ResetPartOfSpeech

func (m *LemmaMutation) ResetPartOfSpeech()

ResetPartOfSpeech resets all changes to the "partOfSpeech" field.

func (*LemmaMutation) ResetSenses

func (m *LemmaMutation) ResetSenses()

ResetSenses resets all changes to the "senses" edge.

func (*LemmaMutation) ResetWrittenForm

func (m *LemmaMutation) ResetWrittenForm()

ResetWrittenForm resets all changes to the "writtenForm" field.

func (*LemmaMutation) SensesCleared

func (m *LemmaMutation) SensesCleared() bool

SensesCleared reports if the "senses" edge to the Sense entity was cleared.

func (*LemmaMutation) SensesIDs

func (m *LemmaMutation) SensesIDs() (ids []string)

SensesIDs returns the "senses" edge IDs in the mutation.

func (*LemmaMutation) SetField

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

func (m *LemmaMutation) SetID(id string)

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

func (*LemmaMutation) SetOp

func (m *LemmaMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LemmaMutation) SetPartOfSpeech

func (m *LemmaMutation) SetPartOfSpeech(s string)

SetPartOfSpeech sets the "partOfSpeech" field.

func (*LemmaMutation) SetWrittenForm

func (m *LemmaMutation) SetWrittenForm(s string)

SetWrittenForm sets the "writtenForm" field.

func (LemmaMutation) Tx

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

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

func (*LemmaMutation) Type

func (m *LemmaMutation) Type() string

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

func (*LemmaMutation) Where

func (m *LemmaMutation) Where(ps ...predicate.Lemma)

Where appends a list predicates to the LemmaMutation builder.

func (*LemmaMutation) WhereP

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

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

func (*LemmaMutation) WrittenForm

func (m *LemmaMutation) WrittenForm() (r string, exists bool)

WrittenForm returns the value of the "writtenForm" field in the mutation.

type LemmaQuery

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

LemmaQuery is the builder for querying Lemma entities.

func (*LemmaQuery) Aggregate

func (lq *LemmaQuery) Aggregate(fns ...AggregateFunc) *LemmaSelect

Aggregate returns a LemmaSelect configured with the given aggregations.

func (*LemmaQuery) All

func (lq *LemmaQuery) All(ctx context.Context) ([]*Lemma, error)

All executes the query and returns a list of Lemmas.

func (*LemmaQuery) AllX

func (lq *LemmaQuery) AllX(ctx context.Context) []*Lemma

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

func (*LemmaQuery) Clone

func (lq *LemmaQuery) Clone() *LemmaQuery

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

func (*LemmaQuery) Count

func (lq *LemmaQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LemmaQuery) CountX

func (lq *LemmaQuery) CountX(ctx context.Context) int

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

func (*LemmaQuery) Exist

func (lq *LemmaQuery) Exist(ctx context.Context) (bool, error)

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

func (*LemmaQuery) ExistX

func (lq *LemmaQuery) ExistX(ctx context.Context) bool

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

func (*LemmaQuery) First

func (lq *LemmaQuery) First(ctx context.Context) (*Lemma, error)

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

func (*LemmaQuery) FirstID

func (lq *LemmaQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*LemmaQuery) FirstIDX

func (lq *LemmaQuery) FirstIDX(ctx context.Context) string

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

func (*LemmaQuery) FirstX

func (lq *LemmaQuery) FirstX(ctx context.Context) *Lemma

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

func (*LemmaQuery) GroupBy

func (lq *LemmaQuery) GroupBy(field string, fields ...string) *LemmaGroupBy

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

client.Lemma.Query().
	GroupBy(lemma.FieldWrittenForm).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LemmaQuery) IDs

func (lq *LemmaQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*LemmaQuery) IDsX

func (lq *LemmaQuery) IDsX(ctx context.Context) []string

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

func (*LemmaQuery) Limit

func (lq *LemmaQuery) Limit(limit int) *LemmaQuery

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

func (*LemmaQuery) Offset

func (lq *LemmaQuery) Offset(offset int) *LemmaQuery

Offset to start from.

func (*LemmaQuery) Only

func (lq *LemmaQuery) Only(ctx context.Context) (*Lemma, error)

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

func (*LemmaQuery) OnlyID

func (lq *LemmaQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*LemmaQuery) OnlyIDX

func (lq *LemmaQuery) OnlyIDX(ctx context.Context) string

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

func (*LemmaQuery) OnlyX

func (lq *LemmaQuery) OnlyX(ctx context.Context) *Lemma

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

func (*LemmaQuery) Order

func (lq *LemmaQuery) Order(o ...lemma.OrderOption) *LemmaQuery

Order specifies how the records should be ordered.

func (*LemmaQuery) QuerySenses

func (lq *LemmaQuery) QuerySenses() *SenseQuery

QuerySenses chains the current query on the "senses" edge.

func (*LemmaQuery) Select

func (lq *LemmaQuery) Select(fields ...string) *LemmaSelect

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

client.Lemma.Query().
	Select(lemma.FieldWrittenForm).
	Scan(ctx, &v)

func (*LemmaQuery) Unique

func (lq *LemmaQuery) Unique(unique bool) *LemmaQuery

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

func (lq *LemmaQuery) Where(ps ...predicate.Lemma) *LemmaQuery

Where adds a new predicate for the LemmaQuery builder.

func (*LemmaQuery) WithSenses

func (lq *LemmaQuery) WithSenses(opts ...func(*SenseQuery)) *LemmaQuery

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

type LemmaSelect

type LemmaSelect struct {
	*LemmaQuery
	// contains filtered or unexported fields
}

LemmaSelect is the builder for selecting fields of Lemma entities.

func (*LemmaSelect) Aggregate

func (ls *LemmaSelect) Aggregate(fns ...AggregateFunc) *LemmaSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LemmaSelect) Bool

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

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

func (*LemmaSelect) BoolX

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

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

func (*LemmaSelect) Bools

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

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

func (*LemmaSelect) BoolsX

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

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

func (*LemmaSelect) Float64

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

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

func (*LemmaSelect) Float64X

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

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

func (*LemmaSelect) Float64s

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

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

func (*LemmaSelect) Float64sX

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

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

func (*LemmaSelect) Int

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

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

func (*LemmaSelect) IntX

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

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

func (*LemmaSelect) Ints

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

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

func (*LemmaSelect) IntsX

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

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

func (*LemmaSelect) Scan

func (ls *LemmaSelect) Scan(ctx context.Context, v any) error

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

func (*LemmaSelect) ScanX

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

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

func (*LemmaSelect) String

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

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

func (*LemmaSelect) StringX

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

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

func (*LemmaSelect) Strings

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

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

func (*LemmaSelect) StringsX

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

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

type LemmaUpdate

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

LemmaUpdate is the builder for updating Lemma entities.

func (*LemmaUpdate) AddSenseIDs

func (lu *LemmaUpdate) AddSenseIDs(ids ...string) *LemmaUpdate

AddSenseIDs adds the "senses" edge to the Sense entity by IDs.

func (*LemmaUpdate) AddSenses

func (lu *LemmaUpdate) AddSenses(s ...*Sense) *LemmaUpdate

AddSenses adds the "senses" edges to the Sense entity.

func (*LemmaUpdate) ClearSenses

func (lu *LemmaUpdate) ClearSenses() *LemmaUpdate

ClearSenses clears all "senses" edges to the Sense entity.

func (*LemmaUpdate) Exec

func (lu *LemmaUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LemmaUpdate) ExecX

func (lu *LemmaUpdate) ExecX(ctx context.Context)

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

func (*LemmaUpdate) Mutation

func (lu *LemmaUpdate) Mutation() *LemmaMutation

Mutation returns the LemmaMutation object of the builder.

func (*LemmaUpdate) RemoveSenseIDs

func (lu *LemmaUpdate) RemoveSenseIDs(ids ...string) *LemmaUpdate

RemoveSenseIDs removes the "senses" edge to Sense entities by IDs.

func (*LemmaUpdate) RemoveSenses

func (lu *LemmaUpdate) RemoveSenses(s ...*Sense) *LemmaUpdate

RemoveSenses removes "senses" edges to Sense entities.

func (*LemmaUpdate) Save

func (lu *LemmaUpdate) Save(ctx context.Context) (int, error)

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

func (*LemmaUpdate) SaveX

func (lu *LemmaUpdate) SaveX(ctx context.Context) int

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

func (*LemmaUpdate) SetNillablePartOfSpeech

func (lu *LemmaUpdate) SetNillablePartOfSpeech(s *string) *LemmaUpdate

SetNillablePartOfSpeech sets the "partOfSpeech" field if the given value is not nil.

func (*LemmaUpdate) SetNillableWrittenForm

func (lu *LemmaUpdate) SetNillableWrittenForm(s *string) *LemmaUpdate

SetNillableWrittenForm sets the "writtenForm" field if the given value is not nil.

func (*LemmaUpdate) SetPartOfSpeech

func (lu *LemmaUpdate) SetPartOfSpeech(s string) *LemmaUpdate

SetPartOfSpeech sets the "partOfSpeech" field.

func (*LemmaUpdate) SetWrittenForm

func (lu *LemmaUpdate) SetWrittenForm(s string) *LemmaUpdate

SetWrittenForm sets the "writtenForm" field.

func (*LemmaUpdate) Where

func (lu *LemmaUpdate) Where(ps ...predicate.Lemma) *LemmaUpdate

Where appends a list predicates to the LemmaUpdate builder.

type LemmaUpdateOne

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

LemmaUpdateOne is the builder for updating a single Lemma entity.

func (*LemmaUpdateOne) AddSenseIDs

func (luo *LemmaUpdateOne) AddSenseIDs(ids ...string) *LemmaUpdateOne

AddSenseIDs adds the "senses" edge to the Sense entity by IDs.

func (*LemmaUpdateOne) AddSenses

func (luo *LemmaUpdateOne) AddSenses(s ...*Sense) *LemmaUpdateOne

AddSenses adds the "senses" edges to the Sense entity.

func (*LemmaUpdateOne) ClearSenses

func (luo *LemmaUpdateOne) ClearSenses() *LemmaUpdateOne

ClearSenses clears all "senses" edges to the Sense entity.

func (*LemmaUpdateOne) Exec

func (luo *LemmaUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LemmaUpdateOne) ExecX

func (luo *LemmaUpdateOne) ExecX(ctx context.Context)

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

func (*LemmaUpdateOne) Mutation

func (luo *LemmaUpdateOne) Mutation() *LemmaMutation

Mutation returns the LemmaMutation object of the builder.

func (*LemmaUpdateOne) RemoveSenseIDs

func (luo *LemmaUpdateOne) RemoveSenseIDs(ids ...string) *LemmaUpdateOne

RemoveSenseIDs removes the "senses" edge to Sense entities by IDs.

func (*LemmaUpdateOne) RemoveSenses

func (luo *LemmaUpdateOne) RemoveSenses(s ...*Sense) *LemmaUpdateOne

RemoveSenses removes "senses" edges to Sense entities.

func (*LemmaUpdateOne) Save

func (luo *LemmaUpdateOne) Save(ctx context.Context) (*Lemma, error)

Save executes the query and returns the updated Lemma entity.

func (*LemmaUpdateOne) SaveX

func (luo *LemmaUpdateOne) SaveX(ctx context.Context) *Lemma

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

func (*LemmaUpdateOne) Select

func (luo *LemmaUpdateOne) Select(field string, fields ...string) *LemmaUpdateOne

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

func (*LemmaUpdateOne) SetNillablePartOfSpeech

func (luo *LemmaUpdateOne) SetNillablePartOfSpeech(s *string) *LemmaUpdateOne

SetNillablePartOfSpeech sets the "partOfSpeech" field if the given value is not nil.

func (*LemmaUpdateOne) SetNillableWrittenForm

func (luo *LemmaUpdateOne) SetNillableWrittenForm(s *string) *LemmaUpdateOne

SetNillableWrittenForm sets the "writtenForm" field if the given value is not nil.

func (*LemmaUpdateOne) SetPartOfSpeech

func (luo *LemmaUpdateOne) SetPartOfSpeech(s string) *LemmaUpdateOne

SetPartOfSpeech sets the "partOfSpeech" field.

func (*LemmaUpdateOne) SetWrittenForm

func (luo *LemmaUpdateOne) SetWrittenForm(s string) *LemmaUpdateOne

SetWrittenForm sets the "writtenForm" field.

func (*LemmaUpdateOne) Where

func (luo *LemmaUpdateOne) Where(ps ...predicate.Lemma) *LemmaUpdateOne

Where appends a list predicates to the LemmaUpdate builder.

type Lemmas

type Lemmas []*Lemma

Lemmas is a parsable slice of Lemma.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Sense

type Sense struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SenseQuery when eager-loading is set.
	Edges SenseEdges `json:"edges"`
	// contains filtered or unexported fields
}

Sense is the model entity for the Sense schema.

func (*Sense) QueryLemma

func (s *Sense) QueryLemma() *LemmaQuery

QueryLemma queries the "lemma" edge of the Sense entity.

func (*Sense) QueryRelFrom

func (s *Sense) QueryRelFrom() *SenseRelationQuery

QueryRelFrom queries the "relFrom" edge of the Sense entity.

func (*Sense) QueryRelTo

func (s *Sense) QueryRelTo() *SenseRelationQuery

QueryRelTo queries the "relTo" edge of the Sense entity.

func (*Sense) QuerySynset

func (s *Sense) QuerySynset() *SynsetQuery

QuerySynset queries the "synset" edge of the Sense entity.

func (*Sense) String

func (s *Sense) String() string

String implements the fmt.Stringer.

func (*Sense) Unwrap

func (s *Sense) Unwrap() *Sense

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

func (s *Sense) Update() *SenseUpdateOne

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

func (*Sense) Value

func (s *Sense) Value(name string) (ent.Value, error)

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

type SenseClient

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

SenseClient is a client for the Sense schema.

func NewSenseClient

func NewSenseClient(c config) *SenseClient

NewSenseClient returns a client for the Sense from the given config.

func (*SenseClient) Create

func (c *SenseClient) Create() *SenseCreate

Create returns a builder for creating a Sense entity.

func (*SenseClient) CreateBulk

func (c *SenseClient) CreateBulk(builders ...*SenseCreate) *SenseCreateBulk

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

func (*SenseClient) Delete

func (c *SenseClient) Delete() *SenseDelete

Delete returns a delete builder for Sense.

func (*SenseClient) DeleteOne

func (c *SenseClient) DeleteOne(s *Sense) *SenseDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SenseClient) DeleteOneID

func (c *SenseClient) DeleteOneID(id string) *SenseDeleteOne

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

func (*SenseClient) Get

func (c *SenseClient) Get(ctx context.Context, id string) (*Sense, error)

Get returns a Sense entity by its id.

func (*SenseClient) GetX

func (c *SenseClient) GetX(ctx context.Context, id string) *Sense

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

func (*SenseClient) Hooks

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

Hooks returns the client hooks.

func (*SenseClient) Intercept

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

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

func (*SenseClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SenseClient) MapCreateBulk

func (c *SenseClient) MapCreateBulk(slice any, setFunc func(*SenseCreate, int)) *SenseCreateBulk

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

func (c *SenseClient) Query() *SenseQuery

Query returns a query builder for Sense.

func (*SenseClient) QueryLemma

func (c *SenseClient) QueryLemma(s *Sense) *LemmaQuery

QueryLemma queries the lemma edge of a Sense.

func (*SenseClient) QueryRelFrom

func (c *SenseClient) QueryRelFrom(s *Sense) *SenseRelationQuery

QueryRelFrom queries the relFrom edge of a Sense.

func (*SenseClient) QueryRelTo

func (c *SenseClient) QueryRelTo(s *Sense) *SenseRelationQuery

QueryRelTo queries the relTo edge of a Sense.

func (*SenseClient) QuerySynset

func (c *SenseClient) QuerySynset(s *Sense) *SynsetQuery

QuerySynset queries the synset edge of a Sense.

func (*SenseClient) Update

func (c *SenseClient) Update() *SenseUpdate

Update returns an update builder for Sense.

func (*SenseClient) UpdateOne

func (c *SenseClient) UpdateOne(s *Sense) *SenseUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SenseClient) UpdateOneID

func (c *SenseClient) UpdateOneID(id string) *SenseUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SenseClient) Use

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

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

type SenseCreate

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

SenseCreate is the builder for creating a Sense entity.

func (*SenseCreate) AddRelFrom

func (sc *SenseCreate) AddRelFrom(s ...*SenseRelation) *SenseCreate

AddRelFrom adds the "relFrom" edges to the SenseRelation entity.

func (*SenseCreate) AddRelFromIDs

func (sc *SenseCreate) AddRelFromIDs(ids ...int) *SenseCreate

AddRelFromIDs adds the "relFrom" edge to the SenseRelation entity by IDs.

func (*SenseCreate) AddRelTo

func (sc *SenseCreate) AddRelTo(s ...*SenseRelation) *SenseCreate

AddRelTo adds the "relTo" edges to the SenseRelation entity.

func (*SenseCreate) AddRelToIDs

func (sc *SenseCreate) AddRelToIDs(ids ...int) *SenseCreate

AddRelToIDs adds the "relTo" edge to the SenseRelation entity by IDs.

func (*SenseCreate) Exec

func (sc *SenseCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SenseCreate) ExecX

func (sc *SenseCreate) ExecX(ctx context.Context)

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

func (*SenseCreate) Mutation

func (sc *SenseCreate) Mutation() *SenseMutation

Mutation returns the SenseMutation object of the builder.

func (*SenseCreate) Save

func (sc *SenseCreate) Save(ctx context.Context) (*Sense, error)

Save creates the Sense in the database.

func (*SenseCreate) SaveX

func (sc *SenseCreate) SaveX(ctx context.Context) *Sense

SaveX calls Save and panics if Save returns an error.

func (*SenseCreate) SetID

func (sc *SenseCreate) SetID(s string) *SenseCreate

SetID sets the "id" field.

func (*SenseCreate) SetLemma

func (sc *SenseCreate) SetLemma(l *Lemma) *SenseCreate

SetLemma sets the "lemma" edge to the Lemma entity.

func (*SenseCreate) SetLemmaID

func (sc *SenseCreate) SetLemmaID(id string) *SenseCreate

SetLemmaID sets the "lemma" edge to the Lemma entity by ID.

func (*SenseCreate) SetNillableLemmaID

func (sc *SenseCreate) SetNillableLemmaID(id *string) *SenseCreate

SetNillableLemmaID sets the "lemma" edge to the Lemma entity by ID if the given value is not nil.

func (*SenseCreate) SetNillableSynsetID

func (sc *SenseCreate) SetNillableSynsetID(id *string) *SenseCreate

SetNillableSynsetID sets the "synset" edge to the Synset entity by ID if the given value is not nil.

func (*SenseCreate) SetSynset

func (sc *SenseCreate) SetSynset(s *Synset) *SenseCreate

SetSynset sets the "synset" edge to the Synset entity.

func (*SenseCreate) SetSynsetID

func (sc *SenseCreate) SetSynsetID(id string) *SenseCreate

SetSynsetID sets the "synset" edge to the Synset entity by ID.

type SenseCreateBulk

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

SenseCreateBulk is the builder for creating many Sense entities in bulk.

func (*SenseCreateBulk) Exec

func (scb *SenseCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SenseCreateBulk) ExecX

func (scb *SenseCreateBulk) ExecX(ctx context.Context)

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

func (*SenseCreateBulk) Save

func (scb *SenseCreateBulk) Save(ctx context.Context) ([]*Sense, error)

Save creates the Sense entities in the database.

func (*SenseCreateBulk) SaveX

func (scb *SenseCreateBulk) SaveX(ctx context.Context) []*Sense

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

type SenseDelete

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

SenseDelete is the builder for deleting a Sense entity.

func (*SenseDelete) Exec

func (sd *SenseDelete) Exec(ctx context.Context) (int, error)

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

func (*SenseDelete) ExecX

func (sd *SenseDelete) ExecX(ctx context.Context) int

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

func (*SenseDelete) Where

func (sd *SenseDelete) Where(ps ...predicate.Sense) *SenseDelete

Where appends a list predicates to the SenseDelete builder.

type SenseDeleteOne

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

SenseDeleteOne is the builder for deleting a single Sense entity.

func (*SenseDeleteOne) Exec

func (sdo *SenseDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SenseDeleteOne) ExecX

func (sdo *SenseDeleteOne) ExecX(ctx context.Context)

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

func (*SenseDeleteOne) Where

func (sdo *SenseDeleteOne) Where(ps ...predicate.Sense) *SenseDeleteOne

Where appends a list predicates to the SenseDelete builder.

type SenseEdges

type SenseEdges struct {
	// Synset holds the value of the synset edge.
	Synset *Synset `json:"synset,omitempty"`
	// Lemma holds the value of the lemma edge.
	Lemma *Lemma `json:"lemma,omitempty"`
	// RelFrom holds the value of the relFrom edge.
	RelFrom []*SenseRelation `json:"relFrom,omitempty"`
	// RelTo holds the value of the relTo edge.
	RelTo []*SenseRelation `json:"relTo,omitempty"`
	// contains filtered or unexported fields
}

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

func (SenseEdges) LemmaOrErr

func (e SenseEdges) LemmaOrErr() (*Lemma, error)

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

func (SenseEdges) RelFromOrErr

func (e SenseEdges) RelFromOrErr() ([]*SenseRelation, error)

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

func (SenseEdges) RelToOrErr

func (e SenseEdges) RelToOrErr() ([]*SenseRelation, error)

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

func (SenseEdges) SynsetOrErr

func (e SenseEdges) SynsetOrErr() (*Synset, error)

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

type SenseGroupBy

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

SenseGroupBy is the group-by builder for Sense entities.

func (*SenseGroupBy) Aggregate

func (sgb *SenseGroupBy) Aggregate(fns ...AggregateFunc) *SenseGroupBy

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

func (*SenseGroupBy) Bool

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

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

func (*SenseGroupBy) BoolX

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

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

func (*SenseGroupBy) Bools

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

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

func (*SenseGroupBy) BoolsX

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

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

func (*SenseGroupBy) Float64

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

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

func (*SenseGroupBy) Float64X

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

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

func (*SenseGroupBy) Float64s

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

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

func (*SenseGroupBy) Float64sX

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

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

func (*SenseGroupBy) Int

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

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

func (*SenseGroupBy) IntX

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

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

func (*SenseGroupBy) Ints

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

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

func (*SenseGroupBy) IntsX

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

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

func (*SenseGroupBy) Scan

func (sgb *SenseGroupBy) Scan(ctx context.Context, v any) error

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

func (*SenseGroupBy) ScanX

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

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

func (*SenseGroupBy) String

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

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

func (*SenseGroupBy) StringX

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

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

func (*SenseGroupBy) Strings

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

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

func (*SenseGroupBy) StringsX

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

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

type SenseMutation

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

SenseMutation represents an operation that mutates the Sense nodes in the graph.

func (*SenseMutation) AddField

func (m *SenseMutation) 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 (*SenseMutation) AddRelFromIDs

func (m *SenseMutation) AddRelFromIDs(ids ...int)

AddRelFromIDs adds the "relFrom" edge to the SenseRelation entity by ids.

func (*SenseMutation) AddRelToIDs

func (m *SenseMutation) AddRelToIDs(ids ...int)

AddRelToIDs adds the "relTo" edge to the SenseRelation entity by ids.

func (*SenseMutation) AddedEdges

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

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

func (*SenseMutation) AddedField

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

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

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

func (*SenseMutation) AddedIDs

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

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

func (*SenseMutation) ClearEdge

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

func (m *SenseMutation) 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 (*SenseMutation) ClearLemma

func (m *SenseMutation) ClearLemma()

ClearLemma clears the "lemma" edge to the Lemma entity.

func (*SenseMutation) ClearRelFrom

func (m *SenseMutation) ClearRelFrom()

ClearRelFrom clears the "relFrom" edge to the SenseRelation entity.

func (*SenseMutation) ClearRelTo

func (m *SenseMutation) ClearRelTo()

ClearRelTo clears the "relTo" edge to the SenseRelation entity.

func (*SenseMutation) ClearSynset

func (m *SenseMutation) ClearSynset()

ClearSynset clears the "synset" edge to the Synset entity.

func (*SenseMutation) ClearedEdges

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

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

func (*SenseMutation) ClearedFields

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

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

func (SenseMutation) Client

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

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

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

func (*SenseMutation) Field

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

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

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

func (*SenseMutation) Fields

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

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

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

func (*SenseMutation) IDs

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

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

func (*SenseMutation) LemmaCleared

func (m *SenseMutation) LemmaCleared() bool

LemmaCleared reports if the "lemma" edge to the Lemma entity was cleared.

func (*SenseMutation) LemmaID

func (m *SenseMutation) LemmaID() (id string, exists bool)

LemmaID returns the "lemma" edge ID in the mutation.

func (*SenseMutation) LemmaIDs

func (m *SenseMutation) LemmaIDs() (ids []string)

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

func (*SenseMutation) OldField

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

func (m *SenseMutation) Op() Op

Op returns the operation name.

func (*SenseMutation) RelFromCleared

func (m *SenseMutation) RelFromCleared() bool

RelFromCleared reports if the "relFrom" edge to the SenseRelation entity was cleared.

func (*SenseMutation) RelFromIDs

func (m *SenseMutation) RelFromIDs() (ids []int)

RelFromIDs returns the "relFrom" edge IDs in the mutation.

func (*SenseMutation) RelToCleared

func (m *SenseMutation) RelToCleared() bool

RelToCleared reports if the "relTo" edge to the SenseRelation entity was cleared.

func (*SenseMutation) RelToIDs

func (m *SenseMutation) RelToIDs() (ids []int)

RelToIDs returns the "relTo" edge IDs in the mutation.

func (*SenseMutation) RemoveRelFromIDs

func (m *SenseMutation) RemoveRelFromIDs(ids ...int)

RemoveRelFromIDs removes the "relFrom" edge to the SenseRelation entity by IDs.

func (*SenseMutation) RemoveRelToIDs

func (m *SenseMutation) RemoveRelToIDs(ids ...int)

RemoveRelToIDs removes the "relTo" edge to the SenseRelation entity by IDs.

func (*SenseMutation) RemovedEdges

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

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

func (*SenseMutation) RemovedIDs

func (m *SenseMutation) 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 (*SenseMutation) RemovedRelFromIDs

func (m *SenseMutation) RemovedRelFromIDs() (ids []int)

RemovedRelFrom returns the removed IDs of the "relFrom" edge to the SenseRelation entity.

func (*SenseMutation) RemovedRelToIDs

func (m *SenseMutation) RemovedRelToIDs() (ids []int)

RemovedRelTo returns the removed IDs of the "relTo" edge to the SenseRelation entity.

func (*SenseMutation) ResetEdge

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

func (m *SenseMutation) 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 (*SenseMutation) ResetLemma

func (m *SenseMutation) ResetLemma()

ResetLemma resets all changes to the "lemma" edge.

func (*SenseMutation) ResetRelFrom

func (m *SenseMutation) ResetRelFrom()

ResetRelFrom resets all changes to the "relFrom" edge.

func (*SenseMutation) ResetRelTo

func (m *SenseMutation) ResetRelTo()

ResetRelTo resets all changes to the "relTo" edge.

func (*SenseMutation) ResetSynset

func (m *SenseMutation) ResetSynset()

ResetSynset resets all changes to the "synset" edge.

func (*SenseMutation) SetField

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

func (m *SenseMutation) SetID(id string)

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

func (*SenseMutation) SetLemmaID

func (m *SenseMutation) SetLemmaID(id string)

SetLemmaID sets the "lemma" edge to the Lemma entity by id.

func (*SenseMutation) SetOp

func (m *SenseMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SenseMutation) SetSynsetID

func (m *SenseMutation) SetSynsetID(id string)

SetSynsetID sets the "synset" edge to the Synset entity by id.

func (*SenseMutation) SynsetCleared

func (m *SenseMutation) SynsetCleared() bool

SynsetCleared reports if the "synset" edge to the Synset entity was cleared.

func (*SenseMutation) SynsetID

func (m *SenseMutation) SynsetID() (id string, exists bool)

SynsetID returns the "synset" edge ID in the mutation.

func (*SenseMutation) SynsetIDs

func (m *SenseMutation) SynsetIDs() (ids []string)

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

func (SenseMutation) Tx

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

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

func (*SenseMutation) Type

func (m *SenseMutation) Type() string

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

func (*SenseMutation) Where

func (m *SenseMutation) Where(ps ...predicate.Sense)

Where appends a list predicates to the SenseMutation builder.

func (*SenseMutation) WhereP

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

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

type SenseQuery

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

SenseQuery is the builder for querying Sense entities.

func (*SenseQuery) Aggregate

func (sq *SenseQuery) Aggregate(fns ...AggregateFunc) *SenseSelect

Aggregate returns a SenseSelect configured with the given aggregations.

func (*SenseQuery) All

func (sq *SenseQuery) All(ctx context.Context) ([]*Sense, error)

All executes the query and returns a list of Senses.

func (*SenseQuery) AllX

func (sq *SenseQuery) AllX(ctx context.Context) []*Sense

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

func (*SenseQuery) Clone

func (sq *SenseQuery) Clone() *SenseQuery

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

func (*SenseQuery) Count

func (sq *SenseQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SenseQuery) CountX

func (sq *SenseQuery) CountX(ctx context.Context) int

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

func (*SenseQuery) Exist

func (sq *SenseQuery) Exist(ctx context.Context) (bool, error)

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

func (*SenseQuery) ExistX

func (sq *SenseQuery) ExistX(ctx context.Context) bool

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

func (*SenseQuery) First

func (sq *SenseQuery) First(ctx context.Context) (*Sense, error)

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

func (*SenseQuery) FirstID

func (sq *SenseQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*SenseQuery) FirstIDX

func (sq *SenseQuery) FirstIDX(ctx context.Context) string

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

func (*SenseQuery) FirstX

func (sq *SenseQuery) FirstX(ctx context.Context) *Sense

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

func (*SenseQuery) GroupBy

func (sq *SenseQuery) GroupBy(field string, fields ...string) *SenseGroupBy

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 (*SenseQuery) IDs

func (sq *SenseQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*SenseQuery) IDsX

func (sq *SenseQuery) IDsX(ctx context.Context) []string

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

func (*SenseQuery) Limit

func (sq *SenseQuery) Limit(limit int) *SenseQuery

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

func (*SenseQuery) Offset

func (sq *SenseQuery) Offset(offset int) *SenseQuery

Offset to start from.

func (*SenseQuery) Only

func (sq *SenseQuery) Only(ctx context.Context) (*Sense, error)

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

func (*SenseQuery) OnlyID

func (sq *SenseQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*SenseQuery) OnlyIDX

func (sq *SenseQuery) OnlyIDX(ctx context.Context) string

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

func (*SenseQuery) OnlyX

func (sq *SenseQuery) OnlyX(ctx context.Context) *Sense

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

func (*SenseQuery) Order

func (sq *SenseQuery) Order(o ...sense.OrderOption) *SenseQuery

Order specifies how the records should be ordered.

func (*SenseQuery) QueryLemma

func (sq *SenseQuery) QueryLemma() *LemmaQuery

QueryLemma chains the current query on the "lemma" edge.

func (*SenseQuery) QueryRelFrom

func (sq *SenseQuery) QueryRelFrom() *SenseRelationQuery

QueryRelFrom chains the current query on the "relFrom" edge.

func (*SenseQuery) QueryRelTo

func (sq *SenseQuery) QueryRelTo() *SenseRelationQuery

QueryRelTo chains the current query on the "relTo" edge.

func (*SenseQuery) QuerySynset

func (sq *SenseQuery) QuerySynset() *SynsetQuery

QuerySynset chains the current query on the "synset" edge.

func (*SenseQuery) Select

func (sq *SenseQuery) Select(fields ...string) *SenseSelect

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

func (*SenseQuery) Unique

func (sq *SenseQuery) Unique(unique bool) *SenseQuery

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

func (sq *SenseQuery) Where(ps ...predicate.Sense) *SenseQuery

Where adds a new predicate for the SenseQuery builder.

func (*SenseQuery) WithLemma

func (sq *SenseQuery) WithLemma(opts ...func(*LemmaQuery)) *SenseQuery

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

func (*SenseQuery) WithRelFrom

func (sq *SenseQuery) WithRelFrom(opts ...func(*SenseRelationQuery)) *SenseQuery

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

func (*SenseQuery) WithRelTo

func (sq *SenseQuery) WithRelTo(opts ...func(*SenseRelationQuery)) *SenseQuery

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

func (*SenseQuery) WithSynset

func (sq *SenseQuery) WithSynset(opts ...func(*SynsetQuery)) *SenseQuery

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

type SenseRelation

type SenseRelation struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// RelType holds the value of the "relType" field.
	RelType string `json:"relType,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SenseRelationQuery when eager-loading is set.
	Edges SenseRelationEdges `json:"edges"`
	// contains filtered or unexported fields
}

SenseRelation is the model entity for the SenseRelation schema.

func (*SenseRelation) QueryFrom

func (sr *SenseRelation) QueryFrom() *SenseQuery

QueryFrom queries the "from" edge of the SenseRelation entity.

func (*SenseRelation) QueryTo

func (sr *SenseRelation) QueryTo() *SenseQuery

QueryTo queries the "to" edge of the SenseRelation entity.

func (*SenseRelation) String

func (sr *SenseRelation) String() string

String implements the fmt.Stringer.

func (*SenseRelation) Unwrap

func (sr *SenseRelation) Unwrap() *SenseRelation

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

func (sr *SenseRelation) Update() *SenseRelationUpdateOne

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

func (*SenseRelation) Value

func (sr *SenseRelation) Value(name string) (ent.Value, error)

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

type SenseRelationClient

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

SenseRelationClient is a client for the SenseRelation schema.

func NewSenseRelationClient

func NewSenseRelationClient(c config) *SenseRelationClient

NewSenseRelationClient returns a client for the SenseRelation from the given config.

func (*SenseRelationClient) Create

Create returns a builder for creating a SenseRelation entity.

func (*SenseRelationClient) CreateBulk

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

func (*SenseRelationClient) Delete

Delete returns a delete builder for SenseRelation.

func (*SenseRelationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SenseRelationClient) DeleteOneID

func (c *SenseRelationClient) DeleteOneID(id int) *SenseRelationDeleteOne

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

func (*SenseRelationClient) Get

Get returns a SenseRelation entity by its id.

func (*SenseRelationClient) GetX

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

func (*SenseRelationClient) Hooks

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

Hooks returns the client hooks.

func (*SenseRelationClient) Intercept

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

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

func (*SenseRelationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SenseRelationClient) MapCreateBulk

func (c *SenseRelationClient) MapCreateBulk(slice any, setFunc func(*SenseRelationCreate, int)) *SenseRelationCreateBulk

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

Query returns a query builder for SenseRelation.

func (*SenseRelationClient) QueryFrom

func (c *SenseRelationClient) QueryFrom(sr *SenseRelation) *SenseQuery

QueryFrom queries the from edge of a SenseRelation.

func (*SenseRelationClient) QueryTo

func (c *SenseRelationClient) QueryTo(sr *SenseRelation) *SenseQuery

QueryTo queries the to edge of a SenseRelation.

func (*SenseRelationClient) Update

Update returns an update builder for SenseRelation.

func (*SenseRelationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SenseRelationClient) UpdateOneID

func (c *SenseRelationClient) UpdateOneID(id int) *SenseRelationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SenseRelationClient) Use

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

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

type SenseRelationCreate

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

SenseRelationCreate is the builder for creating a SenseRelation entity.

func (*SenseRelationCreate) Exec

func (src *SenseRelationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SenseRelationCreate) ExecX

func (src *SenseRelationCreate) ExecX(ctx context.Context)

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

func (*SenseRelationCreate) Mutation

func (src *SenseRelationCreate) Mutation() *SenseRelationMutation

Mutation returns the SenseRelationMutation object of the builder.

func (*SenseRelationCreate) Save

Save creates the SenseRelation in the database.

func (*SenseRelationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SenseRelationCreate) SetFrom

func (src *SenseRelationCreate) SetFrom(s *Sense) *SenseRelationCreate

SetFrom sets the "from" edge to the Sense entity.

func (*SenseRelationCreate) SetFromID

func (src *SenseRelationCreate) SetFromID(id string) *SenseRelationCreate

SetFromID sets the "from" edge to the Sense entity by ID.

func (*SenseRelationCreate) SetRelType

func (src *SenseRelationCreate) SetRelType(s string) *SenseRelationCreate

SetRelType sets the "relType" field.

func (*SenseRelationCreate) SetTo

SetTo sets the "to" edge to the Sense entity.

func (*SenseRelationCreate) SetToID

SetToID sets the "to" edge to the Sense entity by ID.

type SenseRelationCreateBulk

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

SenseRelationCreateBulk is the builder for creating many SenseRelation entities in bulk.

func (*SenseRelationCreateBulk) Exec

func (srcb *SenseRelationCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SenseRelationCreateBulk) ExecX

func (srcb *SenseRelationCreateBulk) ExecX(ctx context.Context)

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

func (*SenseRelationCreateBulk) Save

Save creates the SenseRelation entities in the database.

func (*SenseRelationCreateBulk) SaveX

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

type SenseRelationDelete

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

SenseRelationDelete is the builder for deleting a SenseRelation entity.

func (*SenseRelationDelete) Exec

func (srd *SenseRelationDelete) Exec(ctx context.Context) (int, error)

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

func (*SenseRelationDelete) ExecX

func (srd *SenseRelationDelete) ExecX(ctx context.Context) int

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

func (*SenseRelationDelete) Where

Where appends a list predicates to the SenseRelationDelete builder.

type SenseRelationDeleteOne

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

SenseRelationDeleteOne is the builder for deleting a single SenseRelation entity.

func (*SenseRelationDeleteOne) Exec

func (srdo *SenseRelationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SenseRelationDeleteOne) ExecX

func (srdo *SenseRelationDeleteOne) ExecX(ctx context.Context)

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

func (*SenseRelationDeleteOne) Where

Where appends a list predicates to the SenseRelationDelete builder.

type SenseRelationEdges

type SenseRelationEdges struct {
	// From holds the value of the from edge.
	From *Sense `json:"from,omitempty"`
	// To holds the value of the to edge.
	To *Sense `json:"to,omitempty"`
	// contains filtered or unexported fields
}

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

func (SenseRelationEdges) FromOrErr

func (e SenseRelationEdges) FromOrErr() (*Sense, error)

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

func (SenseRelationEdges) ToOrErr

func (e SenseRelationEdges) ToOrErr() (*Sense, error)

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

type SenseRelationGroupBy

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

SenseRelationGroupBy is the group-by builder for SenseRelation entities.

func (*SenseRelationGroupBy) Aggregate

func (srgb *SenseRelationGroupBy) Aggregate(fns ...AggregateFunc) *SenseRelationGroupBy

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

func (*SenseRelationGroupBy) Bool

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

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

func (*SenseRelationGroupBy) BoolX

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

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

func (*SenseRelationGroupBy) Bools

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

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

func (*SenseRelationGroupBy) BoolsX

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

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

func (*SenseRelationGroupBy) Float64

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

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

func (*SenseRelationGroupBy) Float64X

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

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

func (*SenseRelationGroupBy) Float64s

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

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

func (*SenseRelationGroupBy) Float64sX

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

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

func (*SenseRelationGroupBy) Int

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

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

func (*SenseRelationGroupBy) IntX

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

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

func (*SenseRelationGroupBy) Ints

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

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

func (*SenseRelationGroupBy) IntsX

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

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

func (*SenseRelationGroupBy) Scan

func (srgb *SenseRelationGroupBy) Scan(ctx context.Context, v any) error

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

func (*SenseRelationGroupBy) ScanX

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

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

func (*SenseRelationGroupBy) String

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

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

func (*SenseRelationGroupBy) StringX

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

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

func (*SenseRelationGroupBy) Strings

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

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

func (*SenseRelationGroupBy) StringsX

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

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

type SenseRelationMutation

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

SenseRelationMutation represents an operation that mutates the SenseRelation nodes in the graph.

func (*SenseRelationMutation) AddField

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

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

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

func (*SenseRelationMutation) AddedField

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

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

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

func (*SenseRelationMutation) AddedIDs

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

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

func (*SenseRelationMutation) ClearEdge

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

func (m *SenseRelationMutation) 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 (*SenseRelationMutation) ClearFrom

func (m *SenseRelationMutation) ClearFrom()

ClearFrom clears the "from" edge to the Sense entity.

func (*SenseRelationMutation) ClearTo

func (m *SenseRelationMutation) ClearTo()

ClearTo clears the "to" edge to the Sense entity.

func (*SenseRelationMutation) ClearedEdges

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

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

func (*SenseRelationMutation) ClearedFields

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

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

func (SenseRelationMutation) Client

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

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

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

func (*SenseRelationMutation) Field

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

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

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

func (*SenseRelationMutation) Fields

func (m *SenseRelationMutation) 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 (*SenseRelationMutation) FromCleared

func (m *SenseRelationMutation) FromCleared() bool

FromCleared reports if the "from" edge to the Sense entity was cleared.

func (*SenseRelationMutation) FromID

func (m *SenseRelationMutation) FromID() (id string, exists bool)

FromID returns the "from" edge ID in the mutation.

func (*SenseRelationMutation) FromIDs

func (m *SenseRelationMutation) FromIDs() (ids []string)

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

func (*SenseRelationMutation) ID

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

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

func (m *SenseRelationMutation) 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 (*SenseRelationMutation) OldRelType

func (m *SenseRelationMutation) OldRelType(ctx context.Context) (v string, err error)

OldRelType returns the old "relType" field's value of the SenseRelation entity. If the SenseRelation 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 (*SenseRelationMutation) Op

func (m *SenseRelationMutation) Op() Op

Op returns the operation name.

func (*SenseRelationMutation) RelType

func (m *SenseRelationMutation) RelType() (r string, exists bool)

RelType returns the value of the "relType" field in the mutation.

func (*SenseRelationMutation) RemovedEdges

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

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

func (*SenseRelationMutation) RemovedIDs

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

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

func (m *SenseRelationMutation) 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 (*SenseRelationMutation) ResetFrom

func (m *SenseRelationMutation) ResetFrom()

ResetFrom resets all changes to the "from" edge.

func (*SenseRelationMutation) ResetRelType

func (m *SenseRelationMutation) ResetRelType()

ResetRelType resets all changes to the "relType" field.

func (*SenseRelationMutation) ResetTo

func (m *SenseRelationMutation) ResetTo()

ResetTo resets all changes to the "to" edge.

func (*SenseRelationMutation) SetField

func (m *SenseRelationMutation) 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 (*SenseRelationMutation) SetFromID

func (m *SenseRelationMutation) SetFromID(id string)

SetFromID sets the "from" edge to the Sense entity by id.

func (*SenseRelationMutation) SetOp

func (m *SenseRelationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SenseRelationMutation) SetRelType

func (m *SenseRelationMutation) SetRelType(s string)

SetRelType sets the "relType" field.

func (*SenseRelationMutation) SetToID

func (m *SenseRelationMutation) SetToID(id string)

SetToID sets the "to" edge to the Sense entity by id.

func (*SenseRelationMutation) ToCleared

func (m *SenseRelationMutation) ToCleared() bool

ToCleared reports if the "to" edge to the Sense entity was cleared.

func (*SenseRelationMutation) ToID

func (m *SenseRelationMutation) ToID() (id string, exists bool)

ToID returns the "to" edge ID in the mutation.

func (*SenseRelationMutation) ToIDs

func (m *SenseRelationMutation) ToIDs() (ids []string)

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

func (SenseRelationMutation) Tx

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

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

func (*SenseRelationMutation) Type

func (m *SenseRelationMutation) Type() string

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

func (*SenseRelationMutation) Where

Where appends a list predicates to the SenseRelationMutation builder.

func (*SenseRelationMutation) WhereP

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

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

type SenseRelationQuery

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

SenseRelationQuery is the builder for querying SenseRelation entities.

func (*SenseRelationQuery) Aggregate

func (srq *SenseRelationQuery) Aggregate(fns ...AggregateFunc) *SenseRelationSelect

Aggregate returns a SenseRelationSelect configured with the given aggregations.

func (*SenseRelationQuery) All

All executes the query and returns a list of SenseRelations.

func (*SenseRelationQuery) AllX

func (srq *SenseRelationQuery) AllX(ctx context.Context) []*SenseRelation

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

func (*SenseRelationQuery) Clone

func (srq *SenseRelationQuery) Clone() *SenseRelationQuery

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

func (*SenseRelationQuery) Count

func (srq *SenseRelationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SenseRelationQuery) CountX

func (srq *SenseRelationQuery) CountX(ctx context.Context) int

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

func (*SenseRelationQuery) Exist

func (srq *SenseRelationQuery) Exist(ctx context.Context) (bool, error)

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

func (*SenseRelationQuery) ExistX

func (srq *SenseRelationQuery) ExistX(ctx context.Context) bool

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

func (*SenseRelationQuery) First

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

func (*SenseRelationQuery) FirstID

func (srq *SenseRelationQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SenseRelationQuery) FirstIDX

func (srq *SenseRelationQuery) FirstIDX(ctx context.Context) int

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

func (*SenseRelationQuery) FirstX

func (srq *SenseRelationQuery) FirstX(ctx context.Context) *SenseRelation

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

func (*SenseRelationQuery) GroupBy

func (srq *SenseRelationQuery) GroupBy(field string, fields ...string) *SenseRelationGroupBy

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

client.SenseRelation.Query().
	GroupBy(senserelation.FieldRelType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SenseRelationQuery) IDs

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

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

func (*SenseRelationQuery) IDsX

func (srq *SenseRelationQuery) IDsX(ctx context.Context) []int

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

func (*SenseRelationQuery) Limit

func (srq *SenseRelationQuery) Limit(limit int) *SenseRelationQuery

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

func (*SenseRelationQuery) Offset

func (srq *SenseRelationQuery) Offset(offset int) *SenseRelationQuery

Offset to start from.

func (*SenseRelationQuery) Only

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

func (*SenseRelationQuery) OnlyID

func (srq *SenseRelationQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SenseRelationQuery) OnlyIDX

func (srq *SenseRelationQuery) OnlyIDX(ctx context.Context) int

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

func (*SenseRelationQuery) OnlyX

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

func (*SenseRelationQuery) Order

Order specifies how the records should be ordered.

func (*SenseRelationQuery) QueryFrom

func (srq *SenseRelationQuery) QueryFrom() *SenseQuery

QueryFrom chains the current query on the "from" edge.

func (*SenseRelationQuery) QueryTo

func (srq *SenseRelationQuery) QueryTo() *SenseQuery

QueryTo chains the current query on the "to" edge.

func (*SenseRelationQuery) Select

func (srq *SenseRelationQuery) Select(fields ...string) *SenseRelationSelect

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

client.SenseRelation.Query().
	Select(senserelation.FieldRelType).
	Scan(ctx, &v)

func (*SenseRelationQuery) Unique

func (srq *SenseRelationQuery) Unique(unique bool) *SenseRelationQuery

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

Where adds a new predicate for the SenseRelationQuery builder.

func (*SenseRelationQuery) WithFrom

func (srq *SenseRelationQuery) WithFrom(opts ...func(*SenseQuery)) *SenseRelationQuery

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

func (*SenseRelationQuery) WithTo

func (srq *SenseRelationQuery) WithTo(opts ...func(*SenseQuery)) *SenseRelationQuery

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

type SenseRelationSelect

type SenseRelationSelect struct {
	*SenseRelationQuery
	// contains filtered or unexported fields
}

SenseRelationSelect is the builder for selecting fields of SenseRelation entities.

func (*SenseRelationSelect) Aggregate

func (srs *SenseRelationSelect) Aggregate(fns ...AggregateFunc) *SenseRelationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SenseRelationSelect) Bool

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

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

func (*SenseRelationSelect) BoolX

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

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

func (*SenseRelationSelect) Bools

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

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

func (*SenseRelationSelect) BoolsX

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

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

func (*SenseRelationSelect) Float64

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

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

func (*SenseRelationSelect) Float64X

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

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

func (*SenseRelationSelect) Float64s

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

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

func (*SenseRelationSelect) Float64sX

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

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

func (*SenseRelationSelect) Int

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

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

func (*SenseRelationSelect) IntX

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

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

func (*SenseRelationSelect) Ints

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

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

func (*SenseRelationSelect) IntsX

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

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

func (*SenseRelationSelect) Scan

func (srs *SenseRelationSelect) Scan(ctx context.Context, v any) error

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

func (*SenseRelationSelect) ScanX

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

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

func (*SenseRelationSelect) String

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

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

func (*SenseRelationSelect) StringX

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

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

func (*SenseRelationSelect) Strings

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

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

func (*SenseRelationSelect) StringsX

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

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

type SenseRelationUpdate

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

SenseRelationUpdate is the builder for updating SenseRelation entities.

func (*SenseRelationUpdate) ClearFrom

func (sru *SenseRelationUpdate) ClearFrom() *SenseRelationUpdate

ClearFrom clears the "from" edge to the Sense entity.

func (*SenseRelationUpdate) ClearTo

func (sru *SenseRelationUpdate) ClearTo() *SenseRelationUpdate

ClearTo clears the "to" edge to the Sense entity.

func (*SenseRelationUpdate) Exec

func (sru *SenseRelationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SenseRelationUpdate) ExecX

func (sru *SenseRelationUpdate) ExecX(ctx context.Context)

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

func (*SenseRelationUpdate) Mutation

func (sru *SenseRelationUpdate) Mutation() *SenseRelationMutation

Mutation returns the SenseRelationMutation object of the builder.

func (*SenseRelationUpdate) Save

func (sru *SenseRelationUpdate) Save(ctx context.Context) (int, error)

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

func (*SenseRelationUpdate) SaveX

func (sru *SenseRelationUpdate) SaveX(ctx context.Context) int

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

func (*SenseRelationUpdate) SetFrom

func (sru *SenseRelationUpdate) SetFrom(s *Sense) *SenseRelationUpdate

SetFrom sets the "from" edge to the Sense entity.

func (*SenseRelationUpdate) SetFromID

func (sru *SenseRelationUpdate) SetFromID(id string) *SenseRelationUpdate

SetFromID sets the "from" edge to the Sense entity by ID.

func (*SenseRelationUpdate) SetNillableRelType

func (sru *SenseRelationUpdate) SetNillableRelType(s *string) *SenseRelationUpdate

SetNillableRelType sets the "relType" field if the given value is not nil.

func (*SenseRelationUpdate) SetRelType

func (sru *SenseRelationUpdate) SetRelType(s string) *SenseRelationUpdate

SetRelType sets the "relType" field.

func (*SenseRelationUpdate) SetTo

SetTo sets the "to" edge to the Sense entity.

func (*SenseRelationUpdate) SetToID

SetToID sets the "to" edge to the Sense entity by ID.

func (*SenseRelationUpdate) Where

Where appends a list predicates to the SenseRelationUpdate builder.

type SenseRelationUpdateOne

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

SenseRelationUpdateOne is the builder for updating a single SenseRelation entity.

func (*SenseRelationUpdateOne) ClearFrom

ClearFrom clears the "from" edge to the Sense entity.

func (*SenseRelationUpdateOne) ClearTo

ClearTo clears the "to" edge to the Sense entity.

func (*SenseRelationUpdateOne) Exec

func (sruo *SenseRelationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SenseRelationUpdateOne) ExecX

func (sruo *SenseRelationUpdateOne) ExecX(ctx context.Context)

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

func (*SenseRelationUpdateOne) Mutation

Mutation returns the SenseRelationMutation object of the builder.

func (*SenseRelationUpdateOne) Save

Save executes the query and returns the updated SenseRelation entity.

func (*SenseRelationUpdateOne) SaveX

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

func (*SenseRelationUpdateOne) Select

func (sruo *SenseRelationUpdateOne) Select(field string, fields ...string) *SenseRelationUpdateOne

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

func (*SenseRelationUpdateOne) SetFrom

SetFrom sets the "from" edge to the Sense entity.

func (*SenseRelationUpdateOne) SetFromID

SetFromID sets the "from" edge to the Sense entity by ID.

func (*SenseRelationUpdateOne) SetNillableRelType

func (sruo *SenseRelationUpdateOne) SetNillableRelType(s *string) *SenseRelationUpdateOne

SetNillableRelType sets the "relType" field if the given value is not nil.

func (*SenseRelationUpdateOne) SetRelType

SetRelType sets the "relType" field.

func (*SenseRelationUpdateOne) SetTo

SetTo sets the "to" edge to the Sense entity.

func (*SenseRelationUpdateOne) SetToID

SetToID sets the "to" edge to the Sense entity by ID.

func (*SenseRelationUpdateOne) Where

Where appends a list predicates to the SenseRelationUpdate builder.

type SenseRelations

type SenseRelations []*SenseRelation

SenseRelations is a parsable slice of SenseRelation.

type SenseSelect

type SenseSelect struct {
	*SenseQuery
	// contains filtered or unexported fields
}

SenseSelect is the builder for selecting fields of Sense entities.

func (*SenseSelect) Aggregate

func (ss *SenseSelect) Aggregate(fns ...AggregateFunc) *SenseSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SenseSelect) Bool

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

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

func (*SenseSelect) BoolX

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

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

func (*SenseSelect) Bools

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

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

func (*SenseSelect) BoolsX

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

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

func (*SenseSelect) Float64

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

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

func (*SenseSelect) Float64X

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

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

func (*SenseSelect) Float64s

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

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

func (*SenseSelect) Float64sX

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

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

func (*SenseSelect) Int

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

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

func (*SenseSelect) IntX

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

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

func (*SenseSelect) Ints

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

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

func (*SenseSelect) IntsX

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

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

func (*SenseSelect) Scan

func (ss *SenseSelect) Scan(ctx context.Context, v any) error

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

func (*SenseSelect) ScanX

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

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

func (*SenseSelect) String

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

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

func (*SenseSelect) StringX

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

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

func (*SenseSelect) Strings

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

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

func (*SenseSelect) StringsX

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

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

type SenseUpdate

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

SenseUpdate is the builder for updating Sense entities.

func (*SenseUpdate) AddRelFrom

func (su *SenseUpdate) AddRelFrom(s ...*SenseRelation) *SenseUpdate

AddRelFrom adds the "relFrom" edges to the SenseRelation entity.

func (*SenseUpdate) AddRelFromIDs

func (su *SenseUpdate) AddRelFromIDs(ids ...int) *SenseUpdate

AddRelFromIDs adds the "relFrom" edge to the SenseRelation entity by IDs.

func (*SenseUpdate) AddRelTo

func (su *SenseUpdate) AddRelTo(s ...*SenseRelation) *SenseUpdate

AddRelTo adds the "relTo" edges to the SenseRelation entity.

func (*SenseUpdate) AddRelToIDs

func (su *SenseUpdate) AddRelToIDs(ids ...int) *SenseUpdate

AddRelToIDs adds the "relTo" edge to the SenseRelation entity by IDs.

func (*SenseUpdate) ClearLemma

func (su *SenseUpdate) ClearLemma() *SenseUpdate

ClearLemma clears the "lemma" edge to the Lemma entity.

func (*SenseUpdate) ClearRelFrom

func (su *SenseUpdate) ClearRelFrom() *SenseUpdate

ClearRelFrom clears all "relFrom" edges to the SenseRelation entity.

func (*SenseUpdate) ClearRelTo

func (su *SenseUpdate) ClearRelTo() *SenseUpdate

ClearRelTo clears all "relTo" edges to the SenseRelation entity.

func (*SenseUpdate) ClearSynset

func (su *SenseUpdate) ClearSynset() *SenseUpdate

ClearSynset clears the "synset" edge to the Synset entity.

func (*SenseUpdate) Exec

func (su *SenseUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SenseUpdate) ExecX

func (su *SenseUpdate) ExecX(ctx context.Context)

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

func (*SenseUpdate) Mutation

func (su *SenseUpdate) Mutation() *SenseMutation

Mutation returns the SenseMutation object of the builder.

func (*SenseUpdate) RemoveRelFrom

func (su *SenseUpdate) RemoveRelFrom(s ...*SenseRelation) *SenseUpdate

RemoveRelFrom removes "relFrom" edges to SenseRelation entities.

func (*SenseUpdate) RemoveRelFromIDs

func (su *SenseUpdate) RemoveRelFromIDs(ids ...int) *SenseUpdate

RemoveRelFromIDs removes the "relFrom" edge to SenseRelation entities by IDs.

func (*SenseUpdate) RemoveRelTo

func (su *SenseUpdate) RemoveRelTo(s ...*SenseRelation) *SenseUpdate

RemoveRelTo removes "relTo" edges to SenseRelation entities.

func (*SenseUpdate) RemoveRelToIDs

func (su *SenseUpdate) RemoveRelToIDs(ids ...int) *SenseUpdate

RemoveRelToIDs removes the "relTo" edge to SenseRelation entities by IDs.

func (*SenseUpdate) Save

func (su *SenseUpdate) Save(ctx context.Context) (int, error)

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

func (*SenseUpdate) SaveX

func (su *SenseUpdate) SaveX(ctx context.Context) int

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

func (*SenseUpdate) SetLemma

func (su *SenseUpdate) SetLemma(l *Lemma) *SenseUpdate

SetLemma sets the "lemma" edge to the Lemma entity.

func (*SenseUpdate) SetLemmaID

func (su *SenseUpdate) SetLemmaID(id string) *SenseUpdate

SetLemmaID sets the "lemma" edge to the Lemma entity by ID.

func (*SenseUpdate) SetNillableLemmaID

func (su *SenseUpdate) SetNillableLemmaID(id *string) *SenseUpdate

SetNillableLemmaID sets the "lemma" edge to the Lemma entity by ID if the given value is not nil.

func (*SenseUpdate) SetNillableSynsetID

func (su *SenseUpdate) SetNillableSynsetID(id *string) *SenseUpdate

SetNillableSynsetID sets the "synset" edge to the Synset entity by ID if the given value is not nil.

func (*SenseUpdate) SetSynset

func (su *SenseUpdate) SetSynset(s *Synset) *SenseUpdate

SetSynset sets the "synset" edge to the Synset entity.

func (*SenseUpdate) SetSynsetID

func (su *SenseUpdate) SetSynsetID(id string) *SenseUpdate

SetSynsetID sets the "synset" edge to the Synset entity by ID.

func (*SenseUpdate) Where

func (su *SenseUpdate) Where(ps ...predicate.Sense) *SenseUpdate

Where appends a list predicates to the SenseUpdate builder.

type SenseUpdateOne

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

SenseUpdateOne is the builder for updating a single Sense entity.

func (*SenseUpdateOne) AddRelFrom

func (suo *SenseUpdateOne) AddRelFrom(s ...*SenseRelation) *SenseUpdateOne

AddRelFrom adds the "relFrom" edges to the SenseRelation entity.

func (*SenseUpdateOne) AddRelFromIDs

func (suo *SenseUpdateOne) AddRelFromIDs(ids ...int) *SenseUpdateOne

AddRelFromIDs adds the "relFrom" edge to the SenseRelation entity by IDs.

func (*SenseUpdateOne) AddRelTo

func (suo *SenseUpdateOne) AddRelTo(s ...*SenseRelation) *SenseUpdateOne

AddRelTo adds the "relTo" edges to the SenseRelation entity.

func (*SenseUpdateOne) AddRelToIDs

func (suo *SenseUpdateOne) AddRelToIDs(ids ...int) *SenseUpdateOne

AddRelToIDs adds the "relTo" edge to the SenseRelation entity by IDs.

func (*SenseUpdateOne) ClearLemma

func (suo *SenseUpdateOne) ClearLemma() *SenseUpdateOne

ClearLemma clears the "lemma" edge to the Lemma entity.

func (*SenseUpdateOne) ClearRelFrom

func (suo *SenseUpdateOne) ClearRelFrom() *SenseUpdateOne

ClearRelFrom clears all "relFrom" edges to the SenseRelation entity.

func (*SenseUpdateOne) ClearRelTo

func (suo *SenseUpdateOne) ClearRelTo() *SenseUpdateOne

ClearRelTo clears all "relTo" edges to the SenseRelation entity.

func (*SenseUpdateOne) ClearSynset

func (suo *SenseUpdateOne) ClearSynset() *SenseUpdateOne

ClearSynset clears the "synset" edge to the Synset entity.

func (*SenseUpdateOne) Exec

func (suo *SenseUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SenseUpdateOne) ExecX

func (suo *SenseUpdateOne) ExecX(ctx context.Context)

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

func (*SenseUpdateOne) Mutation

func (suo *SenseUpdateOne) Mutation() *SenseMutation

Mutation returns the SenseMutation object of the builder.

func (*SenseUpdateOne) RemoveRelFrom

func (suo *SenseUpdateOne) RemoveRelFrom(s ...*SenseRelation) *SenseUpdateOne

RemoveRelFrom removes "relFrom" edges to SenseRelation entities.

func (*SenseUpdateOne) RemoveRelFromIDs

func (suo *SenseUpdateOne) RemoveRelFromIDs(ids ...int) *SenseUpdateOne

RemoveRelFromIDs removes the "relFrom" edge to SenseRelation entities by IDs.

func (*SenseUpdateOne) RemoveRelTo

func (suo *SenseUpdateOne) RemoveRelTo(s ...*SenseRelation) *SenseUpdateOne

RemoveRelTo removes "relTo" edges to SenseRelation entities.

func (*SenseUpdateOne) RemoveRelToIDs

func (suo *SenseUpdateOne) RemoveRelToIDs(ids ...int) *SenseUpdateOne

RemoveRelToIDs removes the "relTo" edge to SenseRelation entities by IDs.

func (*SenseUpdateOne) Save

func (suo *SenseUpdateOne) Save(ctx context.Context) (*Sense, error)

Save executes the query and returns the updated Sense entity.

func (*SenseUpdateOne) SaveX

func (suo *SenseUpdateOne) SaveX(ctx context.Context) *Sense

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

func (*SenseUpdateOne) Select

func (suo *SenseUpdateOne) Select(field string, fields ...string) *SenseUpdateOne

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

func (*SenseUpdateOne) SetLemma

func (suo *SenseUpdateOne) SetLemma(l *Lemma) *SenseUpdateOne

SetLemma sets the "lemma" edge to the Lemma entity.

func (*SenseUpdateOne) SetLemmaID

func (suo *SenseUpdateOne) SetLemmaID(id string) *SenseUpdateOne

SetLemmaID sets the "lemma" edge to the Lemma entity by ID.

func (*SenseUpdateOne) SetNillableLemmaID

func (suo *SenseUpdateOne) SetNillableLemmaID(id *string) *SenseUpdateOne

SetNillableLemmaID sets the "lemma" edge to the Lemma entity by ID if the given value is not nil.

func (*SenseUpdateOne) SetNillableSynsetID

func (suo *SenseUpdateOne) SetNillableSynsetID(id *string) *SenseUpdateOne

SetNillableSynsetID sets the "synset" edge to the Synset entity by ID if the given value is not nil.

func (*SenseUpdateOne) SetSynset

func (suo *SenseUpdateOne) SetSynset(s *Synset) *SenseUpdateOne

SetSynset sets the "synset" edge to the Synset entity.

func (*SenseUpdateOne) SetSynsetID

func (suo *SenseUpdateOne) SetSynsetID(id string) *SenseUpdateOne

SetSynsetID sets the "synset" edge to the Synset entity by ID.

func (*SenseUpdateOne) Where

func (suo *SenseUpdateOne) Where(ps ...predicate.Sense) *SenseUpdateOne

Where appends a list predicates to the SenseUpdate builder.

type Senses

type Senses []*Sense

Senses is a parsable slice of Sense.

type Synset

type Synset struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// PartOfSpeech holds the value of the "partOfSpeech" field.
	PartOfSpeech string `json:"partOfSpeech,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SynsetQuery when eager-loading is set.
	Edges SynsetEdges `json:"edges"`
	// contains filtered or unexported fields
}

Synset is the model entity for the Synset schema.

func (*Synset) QueryDefinitions

func (s *Synset) QueryDefinitions() *DefinitionQuery

QueryDefinitions queries the "definitions" edge of the Synset entity.

func (*Synset) QueryRelFrom

func (s *Synset) QueryRelFrom() *SynsetRelationQuery

QueryRelFrom queries the "relFrom" edge of the Synset entity.

func (*Synset) QueryRelTo

func (s *Synset) QueryRelTo() *SynsetRelationQuery

QueryRelTo queries the "relTo" edge of the Synset entity.

func (*Synset) QuerySense

func (s *Synset) QuerySense() *SenseQuery

QuerySense queries the "sense" edge of the Synset entity.

func (*Synset) String

func (s *Synset) String() string

String implements the fmt.Stringer.

func (*Synset) Unwrap

func (s *Synset) Unwrap() *Synset

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

func (s *Synset) Update() *SynsetUpdateOne

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

func (*Synset) Value

func (s *Synset) Value(name string) (ent.Value, error)

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

type SynsetClient

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

SynsetClient is a client for the Synset schema.

func NewSynsetClient

func NewSynsetClient(c config) *SynsetClient

NewSynsetClient returns a client for the Synset from the given config.

func (*SynsetClient) Create

func (c *SynsetClient) Create() *SynsetCreate

Create returns a builder for creating a Synset entity.

func (*SynsetClient) CreateBulk

func (c *SynsetClient) CreateBulk(builders ...*SynsetCreate) *SynsetCreateBulk

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

func (*SynsetClient) Delete

func (c *SynsetClient) Delete() *SynsetDelete

Delete returns a delete builder for Synset.

func (*SynsetClient) DeleteOne

func (c *SynsetClient) DeleteOne(s *Synset) *SynsetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SynsetClient) DeleteOneID

func (c *SynsetClient) DeleteOneID(id string) *SynsetDeleteOne

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

func (*SynsetClient) Get

func (c *SynsetClient) Get(ctx context.Context, id string) (*Synset, error)

Get returns a Synset entity by its id.

func (*SynsetClient) GetX

func (c *SynsetClient) GetX(ctx context.Context, id string) *Synset

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

func (*SynsetClient) Hooks

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

Hooks returns the client hooks.

func (*SynsetClient) Intercept

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

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

func (*SynsetClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SynsetClient) MapCreateBulk

func (c *SynsetClient) MapCreateBulk(slice any, setFunc func(*SynsetCreate, int)) *SynsetCreateBulk

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

func (c *SynsetClient) Query() *SynsetQuery

Query returns a query builder for Synset.

func (*SynsetClient) QueryDefinitions

func (c *SynsetClient) QueryDefinitions(s *Synset) *DefinitionQuery

QueryDefinitions queries the definitions edge of a Synset.

func (*SynsetClient) QueryRelFrom

func (c *SynsetClient) QueryRelFrom(s *Synset) *SynsetRelationQuery

QueryRelFrom queries the relFrom edge of a Synset.

func (*SynsetClient) QueryRelTo

func (c *SynsetClient) QueryRelTo(s *Synset) *SynsetRelationQuery

QueryRelTo queries the relTo edge of a Synset.

func (*SynsetClient) QuerySense

func (c *SynsetClient) QuerySense(s *Synset) *SenseQuery

QuerySense queries the sense edge of a Synset.

func (*SynsetClient) Update

func (c *SynsetClient) Update() *SynsetUpdate

Update returns an update builder for Synset.

func (*SynsetClient) UpdateOne

func (c *SynsetClient) UpdateOne(s *Synset) *SynsetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SynsetClient) UpdateOneID

func (c *SynsetClient) UpdateOneID(id string) *SynsetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SynsetClient) Use

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

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

type SynsetCreate

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

SynsetCreate is the builder for creating a Synset entity.

func (*SynsetCreate) AddDefinitionIDs

func (sc *SynsetCreate) AddDefinitionIDs(ids ...int) *SynsetCreate

AddDefinitionIDs adds the "definitions" edge to the Definition entity by IDs.

func (*SynsetCreate) AddDefinitions

func (sc *SynsetCreate) AddDefinitions(d ...*Definition) *SynsetCreate

AddDefinitions adds the "definitions" edges to the Definition entity.

func (*SynsetCreate) AddRelFrom

func (sc *SynsetCreate) AddRelFrom(s ...*SynsetRelation) *SynsetCreate

AddRelFrom adds the "relFrom" edges to the SynsetRelation entity.

func (*SynsetCreate) AddRelFromIDs

func (sc *SynsetCreate) AddRelFromIDs(ids ...int) *SynsetCreate

AddRelFromIDs adds the "relFrom" edge to the SynsetRelation entity by IDs.

func (*SynsetCreate) AddRelTo

func (sc *SynsetCreate) AddRelTo(s ...*SynsetRelation) *SynsetCreate

AddRelTo adds the "relTo" edges to the SynsetRelation entity.

func (*SynsetCreate) AddRelToIDs

func (sc *SynsetCreate) AddRelToIDs(ids ...int) *SynsetCreate

AddRelToIDs adds the "relTo" edge to the SynsetRelation entity by IDs.

func (*SynsetCreate) AddSense

func (sc *SynsetCreate) AddSense(s ...*Sense) *SynsetCreate

AddSense adds the "sense" edges to the Sense entity.

func (*SynsetCreate) AddSenseIDs

func (sc *SynsetCreate) AddSenseIDs(ids ...string) *SynsetCreate

AddSenseIDs adds the "sense" edge to the Sense entity by IDs.

func (*SynsetCreate) Exec

func (sc *SynsetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SynsetCreate) ExecX

func (sc *SynsetCreate) ExecX(ctx context.Context)

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

func (*SynsetCreate) Mutation

func (sc *SynsetCreate) Mutation() *SynsetMutation

Mutation returns the SynsetMutation object of the builder.

func (*SynsetCreate) Save

func (sc *SynsetCreate) Save(ctx context.Context) (*Synset, error)

Save creates the Synset in the database.

func (*SynsetCreate) SaveX

func (sc *SynsetCreate) SaveX(ctx context.Context) *Synset

SaveX calls Save and panics if Save returns an error.

func (*SynsetCreate) SetID

func (sc *SynsetCreate) SetID(s string) *SynsetCreate

SetID sets the "id" field.

func (*SynsetCreate) SetPartOfSpeech

func (sc *SynsetCreate) SetPartOfSpeech(s string) *SynsetCreate

SetPartOfSpeech sets the "partOfSpeech" field.

type SynsetCreateBulk

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

SynsetCreateBulk is the builder for creating many Synset entities in bulk.

func (*SynsetCreateBulk) Exec

func (scb *SynsetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SynsetCreateBulk) ExecX

func (scb *SynsetCreateBulk) ExecX(ctx context.Context)

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

func (*SynsetCreateBulk) Save

func (scb *SynsetCreateBulk) Save(ctx context.Context) ([]*Synset, error)

Save creates the Synset entities in the database.

func (*SynsetCreateBulk) SaveX

func (scb *SynsetCreateBulk) SaveX(ctx context.Context) []*Synset

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

type SynsetDelete

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

SynsetDelete is the builder for deleting a Synset entity.

func (*SynsetDelete) Exec

func (sd *SynsetDelete) Exec(ctx context.Context) (int, error)

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

func (*SynsetDelete) ExecX

func (sd *SynsetDelete) ExecX(ctx context.Context) int

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

func (*SynsetDelete) Where

func (sd *SynsetDelete) Where(ps ...predicate.Synset) *SynsetDelete

Where appends a list predicates to the SynsetDelete builder.

type SynsetDeleteOne

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

SynsetDeleteOne is the builder for deleting a single Synset entity.

func (*SynsetDeleteOne) Exec

func (sdo *SynsetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SynsetDeleteOne) ExecX

func (sdo *SynsetDeleteOne) ExecX(ctx context.Context)

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

func (*SynsetDeleteOne) Where

func (sdo *SynsetDeleteOne) Where(ps ...predicate.Synset) *SynsetDeleteOne

Where appends a list predicates to the SynsetDelete builder.

type SynsetEdges

type SynsetEdges struct {
	// Definitions holds the value of the definitions edge.
	Definitions []*Definition `json:"definitions,omitempty"`
	// Sense holds the value of the sense edge.
	Sense []*Sense `json:"sense,omitempty"`
	// RelFrom holds the value of the relFrom edge.
	RelFrom []*SynsetRelation `json:"relFrom,omitempty"`
	// RelTo holds the value of the relTo edge.
	RelTo []*SynsetRelation `json:"relTo,omitempty"`
	// contains filtered or unexported fields
}

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

func (SynsetEdges) DefinitionsOrErr

func (e SynsetEdges) DefinitionsOrErr() ([]*Definition, error)

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

func (SynsetEdges) RelFromOrErr

func (e SynsetEdges) RelFromOrErr() ([]*SynsetRelation, error)

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

func (SynsetEdges) RelToOrErr

func (e SynsetEdges) RelToOrErr() ([]*SynsetRelation, error)

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

func (SynsetEdges) SenseOrErr

func (e SynsetEdges) SenseOrErr() ([]*Sense, error)

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

type SynsetGroupBy

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

SynsetGroupBy is the group-by builder for Synset entities.

func (*SynsetGroupBy) Aggregate

func (sgb *SynsetGroupBy) Aggregate(fns ...AggregateFunc) *SynsetGroupBy

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

func (*SynsetGroupBy) Bool

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

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

func (*SynsetGroupBy) BoolX

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

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

func (*SynsetGroupBy) Bools

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

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

func (*SynsetGroupBy) BoolsX

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

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

func (*SynsetGroupBy) Float64

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

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

func (*SynsetGroupBy) Float64X

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

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

func (*SynsetGroupBy) Float64s

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

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

func (*SynsetGroupBy) Float64sX

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

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

func (*SynsetGroupBy) Int

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

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

func (*SynsetGroupBy) IntX

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

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

func (*SynsetGroupBy) Ints

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

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

func (*SynsetGroupBy) IntsX

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

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

func (*SynsetGroupBy) Scan

func (sgb *SynsetGroupBy) Scan(ctx context.Context, v any) error

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

func (*SynsetGroupBy) ScanX

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

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

func (*SynsetGroupBy) String

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

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

func (*SynsetGroupBy) StringX

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

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

func (*SynsetGroupBy) Strings

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

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

func (*SynsetGroupBy) StringsX

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

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

type SynsetMutation

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

SynsetMutation represents an operation that mutates the Synset nodes in the graph.

func (*SynsetMutation) AddDefinitionIDs

func (m *SynsetMutation) AddDefinitionIDs(ids ...int)

AddDefinitionIDs adds the "definitions" edge to the Definition entity by ids.

func (*SynsetMutation) AddField

func (m *SynsetMutation) 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 (*SynsetMutation) AddRelFromIDs

func (m *SynsetMutation) AddRelFromIDs(ids ...int)

AddRelFromIDs adds the "relFrom" edge to the SynsetRelation entity by ids.

func (*SynsetMutation) AddRelToIDs

func (m *SynsetMutation) AddRelToIDs(ids ...int)

AddRelToIDs adds the "relTo" edge to the SynsetRelation entity by ids.

func (*SynsetMutation) AddSenseIDs

func (m *SynsetMutation) AddSenseIDs(ids ...string)

AddSenseIDs adds the "sense" edge to the Sense entity by ids.

func (*SynsetMutation) AddedEdges

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

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

func (*SynsetMutation) AddedField

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

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

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

func (*SynsetMutation) AddedIDs

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

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

func (*SynsetMutation) ClearDefinitions

func (m *SynsetMutation) ClearDefinitions()

ClearDefinitions clears the "definitions" edge to the Definition entity.

func (*SynsetMutation) ClearEdge

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

func (m *SynsetMutation) 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 (*SynsetMutation) ClearRelFrom

func (m *SynsetMutation) ClearRelFrom()

ClearRelFrom clears the "relFrom" edge to the SynsetRelation entity.

func (*SynsetMutation) ClearRelTo

func (m *SynsetMutation) ClearRelTo()

ClearRelTo clears the "relTo" edge to the SynsetRelation entity.

func (*SynsetMutation) ClearSense

func (m *SynsetMutation) ClearSense()

ClearSense clears the "sense" edge to the Sense entity.

func (*SynsetMutation) ClearedEdges

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

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

func (*SynsetMutation) ClearedFields

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

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

func (SynsetMutation) Client

func (m SynsetMutation) 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 (*SynsetMutation) DefinitionsCleared

func (m *SynsetMutation) DefinitionsCleared() bool

DefinitionsCleared reports if the "definitions" edge to the Definition entity was cleared.

func (*SynsetMutation) DefinitionsIDs

func (m *SynsetMutation) DefinitionsIDs() (ids []int)

DefinitionsIDs returns the "definitions" edge IDs in the mutation.

func (*SynsetMutation) EdgeCleared

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

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

func (*SynsetMutation) Field

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

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

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

func (*SynsetMutation) Fields

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

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

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

func (*SynsetMutation) IDs

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

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

func (*SynsetMutation) OldField

func (m *SynsetMutation) 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 (*SynsetMutation) OldPartOfSpeech

func (m *SynsetMutation) OldPartOfSpeech(ctx context.Context) (v string, err error)

OldPartOfSpeech returns the old "partOfSpeech" field's value of the Synset entity. If the Synset 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 (*SynsetMutation) Op

func (m *SynsetMutation) Op() Op

Op returns the operation name.

func (*SynsetMutation) PartOfSpeech

func (m *SynsetMutation) PartOfSpeech() (r string, exists bool)

PartOfSpeech returns the value of the "partOfSpeech" field in the mutation.

func (*SynsetMutation) RelFromCleared

func (m *SynsetMutation) RelFromCleared() bool

RelFromCleared reports if the "relFrom" edge to the SynsetRelation entity was cleared.

func (*SynsetMutation) RelFromIDs

func (m *SynsetMutation) RelFromIDs() (ids []int)

RelFromIDs returns the "relFrom" edge IDs in the mutation.

func (*SynsetMutation) RelToCleared

func (m *SynsetMutation) RelToCleared() bool

RelToCleared reports if the "relTo" edge to the SynsetRelation entity was cleared.

func (*SynsetMutation) RelToIDs

func (m *SynsetMutation) RelToIDs() (ids []int)

RelToIDs returns the "relTo" edge IDs in the mutation.

func (*SynsetMutation) RemoveDefinitionIDs

func (m *SynsetMutation) RemoveDefinitionIDs(ids ...int)

RemoveDefinitionIDs removes the "definitions" edge to the Definition entity by IDs.

func (*SynsetMutation) RemoveRelFromIDs

func (m *SynsetMutation) RemoveRelFromIDs(ids ...int)

RemoveRelFromIDs removes the "relFrom" edge to the SynsetRelation entity by IDs.

func (*SynsetMutation) RemoveRelToIDs

func (m *SynsetMutation) RemoveRelToIDs(ids ...int)

RemoveRelToIDs removes the "relTo" edge to the SynsetRelation entity by IDs.

func (*SynsetMutation) RemoveSenseIDs

func (m *SynsetMutation) RemoveSenseIDs(ids ...string)

RemoveSenseIDs removes the "sense" edge to the Sense entity by IDs.

func (*SynsetMutation) RemovedDefinitionsIDs

func (m *SynsetMutation) RemovedDefinitionsIDs() (ids []int)

RemovedDefinitions returns the removed IDs of the "definitions" edge to the Definition entity.

func (*SynsetMutation) RemovedEdges

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

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

func (*SynsetMutation) RemovedIDs

func (m *SynsetMutation) 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 (*SynsetMutation) RemovedRelFromIDs

func (m *SynsetMutation) RemovedRelFromIDs() (ids []int)

RemovedRelFrom returns the removed IDs of the "relFrom" edge to the SynsetRelation entity.

func (*SynsetMutation) RemovedRelToIDs

func (m *SynsetMutation) RemovedRelToIDs() (ids []int)

RemovedRelTo returns the removed IDs of the "relTo" edge to the SynsetRelation entity.

func (*SynsetMutation) RemovedSenseIDs

func (m *SynsetMutation) RemovedSenseIDs() (ids []string)

RemovedSense returns the removed IDs of the "sense" edge to the Sense entity.

func (*SynsetMutation) ResetDefinitions

func (m *SynsetMutation) ResetDefinitions()

ResetDefinitions resets all changes to the "definitions" edge.

func (*SynsetMutation) ResetEdge

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

func (m *SynsetMutation) 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 (*SynsetMutation) ResetPartOfSpeech

func (m *SynsetMutation) ResetPartOfSpeech()

ResetPartOfSpeech resets all changes to the "partOfSpeech" field.

func (*SynsetMutation) ResetRelFrom

func (m *SynsetMutation) ResetRelFrom()

ResetRelFrom resets all changes to the "relFrom" edge.

func (*SynsetMutation) ResetRelTo

func (m *SynsetMutation) ResetRelTo()

ResetRelTo resets all changes to the "relTo" edge.

func (*SynsetMutation) ResetSense

func (m *SynsetMutation) ResetSense()

ResetSense resets all changes to the "sense" edge.

func (*SynsetMutation) SenseCleared

func (m *SynsetMutation) SenseCleared() bool

SenseCleared reports if the "sense" edge to the Sense entity was cleared.

func (*SynsetMutation) SenseIDs

func (m *SynsetMutation) SenseIDs() (ids []string)

SenseIDs returns the "sense" edge IDs in the mutation.

func (*SynsetMutation) SetField

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

func (m *SynsetMutation) SetID(id string)

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

func (*SynsetMutation) SetOp

func (m *SynsetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SynsetMutation) SetPartOfSpeech

func (m *SynsetMutation) SetPartOfSpeech(s string)

SetPartOfSpeech sets the "partOfSpeech" field.

func (SynsetMutation) Tx

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

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

func (*SynsetMutation) Type

func (m *SynsetMutation) Type() string

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

func (*SynsetMutation) Where

func (m *SynsetMutation) Where(ps ...predicate.Synset)

Where appends a list predicates to the SynsetMutation builder.

func (*SynsetMutation) WhereP

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

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

type SynsetQuery

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

SynsetQuery is the builder for querying Synset entities.

func (*SynsetQuery) Aggregate

func (sq *SynsetQuery) Aggregate(fns ...AggregateFunc) *SynsetSelect

Aggregate returns a SynsetSelect configured with the given aggregations.

func (*SynsetQuery) All

func (sq *SynsetQuery) All(ctx context.Context) ([]*Synset, error)

All executes the query and returns a list of Synsets.

func (*SynsetQuery) AllX

func (sq *SynsetQuery) AllX(ctx context.Context) []*Synset

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

func (*SynsetQuery) Clone

func (sq *SynsetQuery) Clone() *SynsetQuery

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

func (*SynsetQuery) Count

func (sq *SynsetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SynsetQuery) CountX

func (sq *SynsetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SynsetQuery) Exist

func (sq *SynsetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SynsetQuery) ExistX

func (sq *SynsetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SynsetQuery) First

func (sq *SynsetQuery) First(ctx context.Context) (*Synset, error)

First returns the first Synset entity from the query. Returns a *NotFoundError when no Synset was found.

func (*SynsetQuery) FirstID

func (sq *SynsetQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Synset ID from the query. Returns a *NotFoundError when no Synset ID was found.

func (*SynsetQuery) FirstIDX

func (sq *SynsetQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*SynsetQuery) FirstX

func (sq *SynsetQuery) FirstX(ctx context.Context) *Synset

FirstX is like First, but panics if an error occurs.

func (*SynsetQuery) GroupBy

func (sq *SynsetQuery) GroupBy(field string, fields ...string) *SynsetGroupBy

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 {
	PartOfSpeech string `json:"partOfSpeech,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Synset.Query().
	GroupBy(synset.FieldPartOfSpeech).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SynsetQuery) IDs

func (sq *SynsetQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Synset IDs.

func (*SynsetQuery) IDsX

func (sq *SynsetQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*SynsetQuery) Limit

func (sq *SynsetQuery) Limit(limit int) *SynsetQuery

Limit the number of records to be returned by this query.

func (*SynsetQuery) Offset

func (sq *SynsetQuery) Offset(offset int) *SynsetQuery

Offset to start from.

func (*SynsetQuery) Only

func (sq *SynsetQuery) Only(ctx context.Context) (*Synset, error)

Only returns a single Synset entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Synset entity is found. Returns a *NotFoundError when no Synset entities are found.

func (*SynsetQuery) OnlyID

func (sq *SynsetQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Synset ID in the query. Returns a *NotSingularError when more than one Synset ID is found. Returns a *NotFoundError when no entities are found.

func (*SynsetQuery) OnlyIDX

func (sq *SynsetQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SynsetQuery) OnlyX

func (sq *SynsetQuery) OnlyX(ctx context.Context) *Synset

OnlyX is like Only, but panics if an error occurs.

func (*SynsetQuery) Order

func (sq *SynsetQuery) Order(o ...synset.OrderOption) *SynsetQuery

Order specifies how the records should be ordered.

func (*SynsetQuery) QueryDefinitions

func (sq *SynsetQuery) QueryDefinitions() *DefinitionQuery

QueryDefinitions chains the current query on the "definitions" edge.

func (*SynsetQuery) QueryRelFrom

func (sq *SynsetQuery) QueryRelFrom() *SynsetRelationQuery

QueryRelFrom chains the current query on the "relFrom" edge.

func (*SynsetQuery) QueryRelTo

func (sq *SynsetQuery) QueryRelTo() *SynsetRelationQuery

QueryRelTo chains the current query on the "relTo" edge.

func (*SynsetQuery) QuerySense

func (sq *SynsetQuery) QuerySense() *SenseQuery

QuerySense chains the current query on the "sense" edge.

func (*SynsetQuery) Select

func (sq *SynsetQuery) Select(fields ...string) *SynsetSelect

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 {
	PartOfSpeech string `json:"partOfSpeech,omitempty"`
}

client.Synset.Query().
	Select(synset.FieldPartOfSpeech).
	Scan(ctx, &v)

func (*SynsetQuery) Unique

func (sq *SynsetQuery) Unique(unique bool) *SynsetQuery

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 (*SynsetQuery) Where

func (sq *SynsetQuery) Where(ps ...predicate.Synset) *SynsetQuery

Where adds a new predicate for the SynsetQuery builder.

func (*SynsetQuery) WithDefinitions

func (sq *SynsetQuery) WithDefinitions(opts ...func(*DefinitionQuery)) *SynsetQuery

WithDefinitions tells the query-builder to eager-load the nodes that are connected to the "definitions" edge. The optional arguments are used to configure the query builder of the edge.

func (*SynsetQuery) WithRelFrom

func (sq *SynsetQuery) WithRelFrom(opts ...func(*SynsetRelationQuery)) *SynsetQuery

WithRelFrom tells the query-builder to eager-load the nodes that are connected to the "relFrom" edge. The optional arguments are used to configure the query builder of the edge.

func (*SynsetQuery) WithRelTo

func (sq *SynsetQuery) WithRelTo(opts ...func(*SynsetRelationQuery)) *SynsetQuery

WithRelTo tells the query-builder to eager-load the nodes that are connected to the "relTo" edge. The optional arguments are used to configure the query builder of the edge.

func (*SynsetQuery) WithSense

func (sq *SynsetQuery) WithSense(opts ...func(*SenseQuery)) *SynsetQuery

WithSense tells the query-builder to eager-load the nodes that are connected to the "sense" edge. The optional arguments are used to configure the query builder of the edge.

type SynsetRelation

type SynsetRelation struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// RelType holds the value of the "relType" field.
	RelType string `json:"relType,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SynsetRelationQuery when eager-loading is set.
	Edges SynsetRelationEdges `json:"edges"`
	// contains filtered or unexported fields
}

SynsetRelation is the model entity for the SynsetRelation schema.

func (*SynsetRelation) QueryFrom

func (sr *SynsetRelation) QueryFrom() *SynsetQuery

QueryFrom queries the "from" edge of the SynsetRelation entity.

func (*SynsetRelation) QueryTo

func (sr *SynsetRelation) QueryTo() *SynsetQuery

QueryTo queries the "to" edge of the SynsetRelation entity.

func (*SynsetRelation) String

func (sr *SynsetRelation) String() string

String implements the fmt.Stringer.

func (*SynsetRelation) Unwrap

func (sr *SynsetRelation) Unwrap() *SynsetRelation

Unwrap unwraps the SynsetRelation 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 (*SynsetRelation) Update

Update returns a builder for updating this SynsetRelation. Note that you need to call SynsetRelation.Unwrap() before calling this method if this SynsetRelation was returned from a transaction, and the transaction was committed or rolled back.

func (*SynsetRelation) Value

func (sr *SynsetRelation) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SynsetRelation. This includes values selected through modifiers, order, etc.

type SynsetRelationClient

type SynsetRelationClient struct {
	// contains filtered or unexported fields
}

SynsetRelationClient is a client for the SynsetRelation schema.

func NewSynsetRelationClient

func NewSynsetRelationClient(c config) *SynsetRelationClient

NewSynsetRelationClient returns a client for the SynsetRelation from the given config.

func (*SynsetRelationClient) Create

Create returns a builder for creating a SynsetRelation entity.

func (*SynsetRelationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of SynsetRelation entities.

func (*SynsetRelationClient) Delete

Delete returns a delete builder for SynsetRelation.

func (*SynsetRelationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SynsetRelationClient) DeleteOneID

func (c *SynsetRelationClient) DeleteOneID(id int) *SynsetRelationDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SynsetRelationClient) Get

Get returns a SynsetRelation entity by its id.

func (*SynsetRelationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*SynsetRelationClient) Hooks

func (c *SynsetRelationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SynsetRelationClient) Intercept

func (c *SynsetRelationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `synsetrelation.Intercept(f(g(h())))`.

func (*SynsetRelationClient) Interceptors

func (c *SynsetRelationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SynsetRelationClient) MapCreateBulk

func (c *SynsetRelationClient) MapCreateBulk(slice any, setFunc func(*SynsetRelationCreate, int)) *SynsetRelationCreateBulk

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 (*SynsetRelationClient) Query

Query returns a query builder for SynsetRelation.

func (*SynsetRelationClient) QueryFrom

func (c *SynsetRelationClient) QueryFrom(sr *SynsetRelation) *SynsetQuery

QueryFrom queries the from edge of a SynsetRelation.

func (*SynsetRelationClient) QueryTo

QueryTo queries the to edge of a SynsetRelation.

func (*SynsetRelationClient) Update

Update returns an update builder for SynsetRelation.

func (*SynsetRelationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SynsetRelationClient) UpdateOneID

func (c *SynsetRelationClient) UpdateOneID(id int) *SynsetRelationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SynsetRelationClient) Use

func (c *SynsetRelationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `synsetrelation.Hooks(f(g(h())))`.

type SynsetRelationCreate

type SynsetRelationCreate struct {
	// contains filtered or unexported fields
}

SynsetRelationCreate is the builder for creating a SynsetRelation entity.

func (*SynsetRelationCreate) Exec

func (src *SynsetRelationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SynsetRelationCreate) ExecX

func (src *SynsetRelationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetRelationCreate) Mutation

Mutation returns the SynsetRelationMutation object of the builder.

func (*SynsetRelationCreate) Save

Save creates the SynsetRelation in the database.

func (*SynsetRelationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SynsetRelationCreate) SetFrom

SetFrom sets the "from" edge to the Synset entity.

func (*SynsetRelationCreate) SetFromID

func (src *SynsetRelationCreate) SetFromID(id string) *SynsetRelationCreate

SetFromID sets the "from" edge to the Synset entity by ID.

func (*SynsetRelationCreate) SetRelType

func (src *SynsetRelationCreate) SetRelType(s string) *SynsetRelationCreate

SetRelType sets the "relType" field.

func (*SynsetRelationCreate) SetTo

SetTo sets the "to" edge to the Synset entity.

func (*SynsetRelationCreate) SetToID

SetToID sets the "to" edge to the Synset entity by ID.

type SynsetRelationCreateBulk

type SynsetRelationCreateBulk struct {
	// contains filtered or unexported fields
}

SynsetRelationCreateBulk is the builder for creating many SynsetRelation entities in bulk.

func (*SynsetRelationCreateBulk) Exec

Exec executes the query.

func (*SynsetRelationCreateBulk) ExecX

func (srcb *SynsetRelationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetRelationCreateBulk) Save

Save creates the SynsetRelation entities in the database.

func (*SynsetRelationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type SynsetRelationDelete

type SynsetRelationDelete struct {
	// contains filtered or unexported fields
}

SynsetRelationDelete is the builder for deleting a SynsetRelation entity.

func (*SynsetRelationDelete) Exec

func (srd *SynsetRelationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SynsetRelationDelete) ExecX

func (srd *SynsetRelationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SynsetRelationDelete) Where

Where appends a list predicates to the SynsetRelationDelete builder.

type SynsetRelationDeleteOne

type SynsetRelationDeleteOne struct {
	// contains filtered or unexported fields
}

SynsetRelationDeleteOne is the builder for deleting a single SynsetRelation entity.

func (*SynsetRelationDeleteOne) Exec

func (srdo *SynsetRelationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SynsetRelationDeleteOne) ExecX

func (srdo *SynsetRelationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetRelationDeleteOne) Where

Where appends a list predicates to the SynsetRelationDelete builder.

type SynsetRelationEdges

type SynsetRelationEdges struct {
	// From holds the value of the from edge.
	From *Synset `json:"from,omitempty"`
	// To holds the value of the to edge.
	To *Synset `json:"to,omitempty"`
	// contains filtered or unexported fields
}

SynsetRelationEdges holds the relations/edges for other nodes in the graph.

func (SynsetRelationEdges) FromOrErr

func (e SynsetRelationEdges) FromOrErr() (*Synset, error)

FromOrErr returns the From value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (SynsetRelationEdges) ToOrErr

func (e SynsetRelationEdges) ToOrErr() (*Synset, error)

ToOrErr returns the To value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SynsetRelationGroupBy

type SynsetRelationGroupBy struct {
	// contains filtered or unexported fields
}

SynsetRelationGroupBy is the group-by builder for SynsetRelation entities.

func (*SynsetRelationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*SynsetRelationGroupBy) Bool

func (s *SynsetRelationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) BoolX

func (s *SynsetRelationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SynsetRelationGroupBy) Bools

func (s *SynsetRelationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) BoolsX

func (s *SynsetRelationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SynsetRelationGroupBy) Float64

func (s *SynsetRelationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) Float64X

func (s *SynsetRelationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SynsetRelationGroupBy) Float64s

func (s *SynsetRelationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) Float64sX

func (s *SynsetRelationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SynsetRelationGroupBy) Int

func (s *SynsetRelationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) IntX

func (s *SynsetRelationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SynsetRelationGroupBy) Ints

func (s *SynsetRelationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) IntsX

func (s *SynsetRelationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SynsetRelationGroupBy) Scan

func (srgb *SynsetRelationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SynsetRelationGroupBy) ScanX

func (s *SynsetRelationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SynsetRelationGroupBy) String

func (s *SynsetRelationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) StringX

func (s *SynsetRelationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SynsetRelationGroupBy) Strings

func (s *SynsetRelationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SynsetRelationGroupBy) StringsX

func (s *SynsetRelationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SynsetRelationMutation

type SynsetRelationMutation struct {
	// contains filtered or unexported fields
}

SynsetRelationMutation represents an operation that mutates the SynsetRelation nodes in the graph.

func (*SynsetRelationMutation) AddField

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) AddedEdges

func (m *SynsetRelationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SynsetRelationMutation) AddedField

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) AddedFields

func (m *SynsetRelationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SynsetRelationMutation) AddedIDs

func (m *SynsetRelationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SynsetRelationMutation) ClearEdge

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) ClearField

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) ClearFrom

func (m *SynsetRelationMutation) ClearFrom()

ClearFrom clears the "from" edge to the Synset entity.

func (*SynsetRelationMutation) ClearTo

func (m *SynsetRelationMutation) ClearTo()

ClearTo clears the "to" edge to the Synset entity.

func (*SynsetRelationMutation) ClearedEdges

func (m *SynsetRelationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SynsetRelationMutation) ClearedFields

func (m *SynsetRelationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SynsetRelationMutation) Client

func (m SynsetRelationMutation) 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 (*SynsetRelationMutation) EdgeCleared

func (m *SynsetRelationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SynsetRelationMutation) Field

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) FieldCleared

func (m *SynsetRelationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SynsetRelationMutation) Fields

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) FromCleared

func (m *SynsetRelationMutation) FromCleared() bool

FromCleared reports if the "from" edge to the Synset entity was cleared.

func (*SynsetRelationMutation) FromID

func (m *SynsetRelationMutation) FromID() (id string, exists bool)

FromID returns the "from" edge ID in the mutation.

func (*SynsetRelationMutation) FromIDs

func (m *SynsetRelationMutation) FromIDs() (ids []string)

FromIDs returns the "from" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FromID instead. It exists only for internal usage by the builders.

func (*SynsetRelationMutation) ID

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) IDs

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) OldField

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) OldRelType

func (m *SynsetRelationMutation) OldRelType(ctx context.Context) (v string, err error)

OldRelType returns the old "relType" field's value of the SynsetRelation entity. If the SynsetRelation 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 (*SynsetRelationMutation) Op

func (m *SynsetRelationMutation) Op() Op

Op returns the operation name.

func (*SynsetRelationMutation) RelType

func (m *SynsetRelationMutation) RelType() (r string, exists bool)

RelType returns the value of the "relType" field in the mutation.

func (*SynsetRelationMutation) RemovedEdges

func (m *SynsetRelationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SynsetRelationMutation) RemovedIDs

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) ResetEdge

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) ResetField

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) ResetFrom

func (m *SynsetRelationMutation) ResetFrom()

ResetFrom resets all changes to the "from" edge.

func (*SynsetRelationMutation) ResetRelType

func (m *SynsetRelationMutation) ResetRelType()

ResetRelType resets all changes to the "relType" field.

func (*SynsetRelationMutation) ResetTo

func (m *SynsetRelationMutation) ResetTo()

ResetTo resets all changes to the "to" edge.

func (*SynsetRelationMutation) SetField

func (m *SynsetRelationMutation) 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 (*SynsetRelationMutation) SetFromID

func (m *SynsetRelationMutation) SetFromID(id string)

SetFromID sets the "from" edge to the Synset entity by id.

func (*SynsetRelationMutation) SetOp

func (m *SynsetRelationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SynsetRelationMutation) SetRelType

func (m *SynsetRelationMutation) SetRelType(s string)

SetRelType sets the "relType" field.

func (*SynsetRelationMutation) SetToID

func (m *SynsetRelationMutation) SetToID(id string)

SetToID sets the "to" edge to the Synset entity by id.

func (*SynsetRelationMutation) ToCleared

func (m *SynsetRelationMutation) ToCleared() bool

ToCleared reports if the "to" edge to the Synset entity was cleared.

func (*SynsetRelationMutation) ToID

func (m *SynsetRelationMutation) ToID() (id string, exists bool)

ToID returns the "to" edge ID in the mutation.

func (*SynsetRelationMutation) ToIDs

func (m *SynsetRelationMutation) ToIDs() (ids []string)

ToIDs returns the "to" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ToID instead. It exists only for internal usage by the builders.

func (SynsetRelationMutation) Tx

func (m SynsetRelationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SynsetRelationMutation) Type

func (m *SynsetRelationMutation) Type() string

Type returns the node type of this mutation (SynsetRelation).

func (*SynsetRelationMutation) Where

Where appends a list predicates to the SynsetRelationMutation builder.

func (*SynsetRelationMutation) WhereP

func (m *SynsetRelationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SynsetRelationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SynsetRelationQuery

type SynsetRelationQuery struct {
	// contains filtered or unexported fields
}

SynsetRelationQuery is the builder for querying SynsetRelation entities.

func (*SynsetRelationQuery) Aggregate

func (srq *SynsetRelationQuery) Aggregate(fns ...AggregateFunc) *SynsetRelationSelect

Aggregate returns a SynsetRelationSelect configured with the given aggregations.

func (*SynsetRelationQuery) All

All executes the query and returns a list of SynsetRelations.

func (*SynsetRelationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*SynsetRelationQuery) Clone

Clone returns a duplicate of the SynsetRelationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SynsetRelationQuery) Count

func (srq *SynsetRelationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SynsetRelationQuery) CountX

func (srq *SynsetRelationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SynsetRelationQuery) Exist

func (srq *SynsetRelationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SynsetRelationQuery) ExistX

func (srq *SynsetRelationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SynsetRelationQuery) First

First returns the first SynsetRelation entity from the query. Returns a *NotFoundError when no SynsetRelation was found.

func (*SynsetRelationQuery) FirstID

func (srq *SynsetRelationQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SynsetRelation ID from the query. Returns a *NotFoundError when no SynsetRelation ID was found.

func (*SynsetRelationQuery) FirstIDX

func (srq *SynsetRelationQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SynsetRelationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*SynsetRelationQuery) GroupBy

func (srq *SynsetRelationQuery) GroupBy(field string, fields ...string) *SynsetRelationGroupBy

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 {
	RelType string `json:"relType,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SynsetRelation.Query().
	GroupBy(synsetrelation.FieldRelType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SynsetRelationQuery) IDs

func (srq *SynsetRelationQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of SynsetRelation IDs.

func (*SynsetRelationQuery) IDsX

func (srq *SynsetRelationQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SynsetRelationQuery) Limit

func (srq *SynsetRelationQuery) Limit(limit int) *SynsetRelationQuery

Limit the number of records to be returned by this query.

func (*SynsetRelationQuery) Offset

func (srq *SynsetRelationQuery) Offset(offset int) *SynsetRelationQuery

Offset to start from.

func (*SynsetRelationQuery) Only

Only returns a single SynsetRelation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SynsetRelation entity is found. Returns a *NotFoundError when no SynsetRelation entities are found.

func (*SynsetRelationQuery) OnlyID

func (srq *SynsetRelationQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SynsetRelation ID in the query. Returns a *NotSingularError when more than one SynsetRelation ID is found. Returns a *NotFoundError when no entities are found.

func (*SynsetRelationQuery) OnlyIDX

func (srq *SynsetRelationQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SynsetRelationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*SynsetRelationQuery) Order

Order specifies how the records should be ordered.

func (*SynsetRelationQuery) QueryFrom

func (srq *SynsetRelationQuery) QueryFrom() *SynsetQuery

QueryFrom chains the current query on the "from" edge.

func (*SynsetRelationQuery) QueryTo

func (srq *SynsetRelationQuery) QueryTo() *SynsetQuery

QueryTo chains the current query on the "to" edge.

func (*SynsetRelationQuery) Select

func (srq *SynsetRelationQuery) Select(fields ...string) *SynsetRelationSelect

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 {
	RelType string `json:"relType,omitempty"`
}

client.SynsetRelation.Query().
	Select(synsetrelation.FieldRelType).
	Scan(ctx, &v)

func (*SynsetRelationQuery) Unique

func (srq *SynsetRelationQuery) Unique(unique bool) *SynsetRelationQuery

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 (*SynsetRelationQuery) Where

Where adds a new predicate for the SynsetRelationQuery builder.

func (*SynsetRelationQuery) WithFrom

func (srq *SynsetRelationQuery) WithFrom(opts ...func(*SynsetQuery)) *SynsetRelationQuery

WithFrom tells the query-builder to eager-load the nodes that are connected to the "from" edge. The optional arguments are used to configure the query builder of the edge.

func (*SynsetRelationQuery) WithTo

func (srq *SynsetRelationQuery) WithTo(opts ...func(*SynsetQuery)) *SynsetRelationQuery

WithTo tells the query-builder to eager-load the nodes that are connected to the "to" edge. The optional arguments are used to configure the query builder of the edge.

type SynsetRelationSelect

type SynsetRelationSelect struct {
	*SynsetRelationQuery
	// contains filtered or unexported fields
}

SynsetRelationSelect is the builder for selecting fields of SynsetRelation entities.

func (*SynsetRelationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*SynsetRelationSelect) Bool

func (s *SynsetRelationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) BoolX

func (s *SynsetRelationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SynsetRelationSelect) Bools

func (s *SynsetRelationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) BoolsX

func (s *SynsetRelationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SynsetRelationSelect) Float64

func (s *SynsetRelationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) Float64X

func (s *SynsetRelationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SynsetRelationSelect) Float64s

func (s *SynsetRelationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) Float64sX

func (s *SynsetRelationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SynsetRelationSelect) Int

func (s *SynsetRelationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) IntX

func (s *SynsetRelationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SynsetRelationSelect) Ints

func (s *SynsetRelationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) IntsX

func (s *SynsetRelationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SynsetRelationSelect) Scan

func (srs *SynsetRelationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SynsetRelationSelect) ScanX

func (s *SynsetRelationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SynsetRelationSelect) String

func (s *SynsetRelationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) StringX

func (s *SynsetRelationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SynsetRelationSelect) Strings

func (s *SynsetRelationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SynsetRelationSelect) StringsX

func (s *SynsetRelationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SynsetRelationUpdate

type SynsetRelationUpdate struct {
	// contains filtered or unexported fields
}

SynsetRelationUpdate is the builder for updating SynsetRelation entities.

func (*SynsetRelationUpdate) ClearFrom

func (sru *SynsetRelationUpdate) ClearFrom() *SynsetRelationUpdate

ClearFrom clears the "from" edge to the Synset entity.

func (*SynsetRelationUpdate) ClearTo

ClearTo clears the "to" edge to the Synset entity.

func (*SynsetRelationUpdate) Exec

func (sru *SynsetRelationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SynsetRelationUpdate) ExecX

func (sru *SynsetRelationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetRelationUpdate) Mutation

Mutation returns the SynsetRelationMutation object of the builder.

func (*SynsetRelationUpdate) Save

func (sru *SynsetRelationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SynsetRelationUpdate) SaveX

func (sru *SynsetRelationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SynsetRelationUpdate) SetFrom

SetFrom sets the "from" edge to the Synset entity.

func (*SynsetRelationUpdate) SetFromID

func (sru *SynsetRelationUpdate) SetFromID(id string) *SynsetRelationUpdate

SetFromID sets the "from" edge to the Synset entity by ID.

func (*SynsetRelationUpdate) SetNillableRelType

func (sru *SynsetRelationUpdate) SetNillableRelType(s *string) *SynsetRelationUpdate

SetNillableRelType sets the "relType" field if the given value is not nil.

func (*SynsetRelationUpdate) SetRelType

func (sru *SynsetRelationUpdate) SetRelType(s string) *SynsetRelationUpdate

SetRelType sets the "relType" field.

func (*SynsetRelationUpdate) SetTo

SetTo sets the "to" edge to the Synset entity.

func (*SynsetRelationUpdate) SetToID

SetToID sets the "to" edge to the Synset entity by ID.

func (*SynsetRelationUpdate) Where

Where appends a list predicates to the SynsetRelationUpdate builder.

type SynsetRelationUpdateOne

type SynsetRelationUpdateOne struct {
	// contains filtered or unexported fields
}

SynsetRelationUpdateOne is the builder for updating a single SynsetRelation entity.

func (*SynsetRelationUpdateOne) ClearFrom

ClearFrom clears the "from" edge to the Synset entity.

func (*SynsetRelationUpdateOne) ClearTo

ClearTo clears the "to" edge to the Synset entity.

func (*SynsetRelationUpdateOne) Exec

func (sruo *SynsetRelationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SynsetRelationUpdateOne) ExecX

func (sruo *SynsetRelationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetRelationUpdateOne) Mutation

Mutation returns the SynsetRelationMutation object of the builder.

func (*SynsetRelationUpdateOne) Save

Save executes the query and returns the updated SynsetRelation entity.

func (*SynsetRelationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SynsetRelationUpdateOne) Select

func (sruo *SynsetRelationUpdateOne) Select(field string, fields ...string) *SynsetRelationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SynsetRelationUpdateOne) SetFrom

SetFrom sets the "from" edge to the Synset entity.

func (*SynsetRelationUpdateOne) SetFromID

SetFromID sets the "from" edge to the Synset entity by ID.

func (*SynsetRelationUpdateOne) SetNillableRelType

func (sruo *SynsetRelationUpdateOne) SetNillableRelType(s *string) *SynsetRelationUpdateOne

SetNillableRelType sets the "relType" field if the given value is not nil.

func (*SynsetRelationUpdateOne) SetRelType

SetRelType sets the "relType" field.

func (*SynsetRelationUpdateOne) SetTo

SetTo sets the "to" edge to the Synset entity.

func (*SynsetRelationUpdateOne) SetToID

SetToID sets the "to" edge to the Synset entity by ID.

func (*SynsetRelationUpdateOne) Where

Where appends a list predicates to the SynsetRelationUpdate builder.

type SynsetRelations

type SynsetRelations []*SynsetRelation

SynsetRelations is a parsable slice of SynsetRelation.

type SynsetSelect

type SynsetSelect struct {
	*SynsetQuery
	// contains filtered or unexported fields
}

SynsetSelect is the builder for selecting fields of Synset entities.

func (*SynsetSelect) Aggregate

func (ss *SynsetSelect) Aggregate(fns ...AggregateFunc) *SynsetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SynsetSelect) Bool

func (s *SynsetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) BoolX

func (s *SynsetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SynsetSelect) Bools

func (s *SynsetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) BoolsX

func (s *SynsetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SynsetSelect) Float64

func (s *SynsetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) Float64X

func (s *SynsetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SynsetSelect) Float64s

func (s *SynsetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) Float64sX

func (s *SynsetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SynsetSelect) Int

func (s *SynsetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) IntX

func (s *SynsetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SynsetSelect) Ints

func (s *SynsetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) IntsX

func (s *SynsetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SynsetSelect) Scan

func (ss *SynsetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SynsetSelect) ScanX

func (s *SynsetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SynsetSelect) String

func (s *SynsetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) StringX

func (s *SynsetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SynsetSelect) Strings

func (s *SynsetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SynsetSelect) StringsX

func (s *SynsetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SynsetUpdate

type SynsetUpdate struct {
	// contains filtered or unexported fields
}

SynsetUpdate is the builder for updating Synset entities.

func (*SynsetUpdate) AddDefinitionIDs

func (su *SynsetUpdate) AddDefinitionIDs(ids ...int) *SynsetUpdate

AddDefinitionIDs adds the "definitions" edge to the Definition entity by IDs.

func (*SynsetUpdate) AddDefinitions

func (su *SynsetUpdate) AddDefinitions(d ...*Definition) *SynsetUpdate

AddDefinitions adds the "definitions" edges to the Definition entity.

func (*SynsetUpdate) AddRelFrom

func (su *SynsetUpdate) AddRelFrom(s ...*SynsetRelation) *SynsetUpdate

AddRelFrom adds the "relFrom" edges to the SynsetRelation entity.

func (*SynsetUpdate) AddRelFromIDs

func (su *SynsetUpdate) AddRelFromIDs(ids ...int) *SynsetUpdate

AddRelFromIDs adds the "relFrom" edge to the SynsetRelation entity by IDs.

func (*SynsetUpdate) AddRelTo

func (su *SynsetUpdate) AddRelTo(s ...*SynsetRelation) *SynsetUpdate

AddRelTo adds the "relTo" edges to the SynsetRelation entity.

func (*SynsetUpdate) AddRelToIDs

func (su *SynsetUpdate) AddRelToIDs(ids ...int) *SynsetUpdate

AddRelToIDs adds the "relTo" edge to the SynsetRelation entity by IDs.

func (*SynsetUpdate) AddSense

func (su *SynsetUpdate) AddSense(s ...*Sense) *SynsetUpdate

AddSense adds the "sense" edges to the Sense entity.

func (*SynsetUpdate) AddSenseIDs

func (su *SynsetUpdate) AddSenseIDs(ids ...string) *SynsetUpdate

AddSenseIDs adds the "sense" edge to the Sense entity by IDs.

func (*SynsetUpdate) ClearDefinitions

func (su *SynsetUpdate) ClearDefinitions() *SynsetUpdate

ClearDefinitions clears all "definitions" edges to the Definition entity.

func (*SynsetUpdate) ClearRelFrom

func (su *SynsetUpdate) ClearRelFrom() *SynsetUpdate

ClearRelFrom clears all "relFrom" edges to the SynsetRelation entity.

func (*SynsetUpdate) ClearRelTo

func (su *SynsetUpdate) ClearRelTo() *SynsetUpdate

ClearRelTo clears all "relTo" edges to the SynsetRelation entity.

func (*SynsetUpdate) ClearSense

func (su *SynsetUpdate) ClearSense() *SynsetUpdate

ClearSense clears all "sense" edges to the Sense entity.

func (*SynsetUpdate) Exec

func (su *SynsetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SynsetUpdate) ExecX

func (su *SynsetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetUpdate) Mutation

func (su *SynsetUpdate) Mutation() *SynsetMutation

Mutation returns the SynsetMutation object of the builder.

func (*SynsetUpdate) RemoveDefinitionIDs

func (su *SynsetUpdate) RemoveDefinitionIDs(ids ...int) *SynsetUpdate

RemoveDefinitionIDs removes the "definitions" edge to Definition entities by IDs.

func (*SynsetUpdate) RemoveDefinitions

func (su *SynsetUpdate) RemoveDefinitions(d ...*Definition) *SynsetUpdate

RemoveDefinitions removes "definitions" edges to Definition entities.

func (*SynsetUpdate) RemoveRelFrom

func (su *SynsetUpdate) RemoveRelFrom(s ...*SynsetRelation) *SynsetUpdate

RemoveRelFrom removes "relFrom" edges to SynsetRelation entities.

func (*SynsetUpdate) RemoveRelFromIDs

func (su *SynsetUpdate) RemoveRelFromIDs(ids ...int) *SynsetUpdate

RemoveRelFromIDs removes the "relFrom" edge to SynsetRelation entities by IDs.

func (*SynsetUpdate) RemoveRelTo

func (su *SynsetUpdate) RemoveRelTo(s ...*SynsetRelation) *SynsetUpdate

RemoveRelTo removes "relTo" edges to SynsetRelation entities.

func (*SynsetUpdate) RemoveRelToIDs

func (su *SynsetUpdate) RemoveRelToIDs(ids ...int) *SynsetUpdate

RemoveRelToIDs removes the "relTo" edge to SynsetRelation entities by IDs.

func (*SynsetUpdate) RemoveSense

func (su *SynsetUpdate) RemoveSense(s ...*Sense) *SynsetUpdate

RemoveSense removes "sense" edges to Sense entities.

func (*SynsetUpdate) RemoveSenseIDs

func (su *SynsetUpdate) RemoveSenseIDs(ids ...string) *SynsetUpdate

RemoveSenseIDs removes the "sense" edge to Sense entities by IDs.

func (*SynsetUpdate) Save

func (su *SynsetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SynsetUpdate) SaveX

func (su *SynsetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SynsetUpdate) SetNillablePartOfSpeech

func (su *SynsetUpdate) SetNillablePartOfSpeech(s *string) *SynsetUpdate

SetNillablePartOfSpeech sets the "partOfSpeech" field if the given value is not nil.

func (*SynsetUpdate) SetPartOfSpeech

func (su *SynsetUpdate) SetPartOfSpeech(s string) *SynsetUpdate

SetPartOfSpeech sets the "partOfSpeech" field.

func (*SynsetUpdate) Where

func (su *SynsetUpdate) Where(ps ...predicate.Synset) *SynsetUpdate

Where appends a list predicates to the SynsetUpdate builder.

type SynsetUpdateOne

type SynsetUpdateOne struct {
	// contains filtered or unexported fields
}

SynsetUpdateOne is the builder for updating a single Synset entity.

func (*SynsetUpdateOne) AddDefinitionIDs

func (suo *SynsetUpdateOne) AddDefinitionIDs(ids ...int) *SynsetUpdateOne

AddDefinitionIDs adds the "definitions" edge to the Definition entity by IDs.

func (*SynsetUpdateOne) AddDefinitions

func (suo *SynsetUpdateOne) AddDefinitions(d ...*Definition) *SynsetUpdateOne

AddDefinitions adds the "definitions" edges to the Definition entity.

func (*SynsetUpdateOne) AddRelFrom

func (suo *SynsetUpdateOne) AddRelFrom(s ...*SynsetRelation) *SynsetUpdateOne

AddRelFrom adds the "relFrom" edges to the SynsetRelation entity.

func (*SynsetUpdateOne) AddRelFromIDs

func (suo *SynsetUpdateOne) AddRelFromIDs(ids ...int) *SynsetUpdateOne

AddRelFromIDs adds the "relFrom" edge to the SynsetRelation entity by IDs.

func (*SynsetUpdateOne) AddRelTo

func (suo *SynsetUpdateOne) AddRelTo(s ...*SynsetRelation) *SynsetUpdateOne

AddRelTo adds the "relTo" edges to the SynsetRelation entity.

func (*SynsetUpdateOne) AddRelToIDs

func (suo *SynsetUpdateOne) AddRelToIDs(ids ...int) *SynsetUpdateOne

AddRelToIDs adds the "relTo" edge to the SynsetRelation entity by IDs.

func (*SynsetUpdateOne) AddSense

func (suo *SynsetUpdateOne) AddSense(s ...*Sense) *SynsetUpdateOne

AddSense adds the "sense" edges to the Sense entity.

func (*SynsetUpdateOne) AddSenseIDs

func (suo *SynsetUpdateOne) AddSenseIDs(ids ...string) *SynsetUpdateOne

AddSenseIDs adds the "sense" edge to the Sense entity by IDs.

func (*SynsetUpdateOne) ClearDefinitions

func (suo *SynsetUpdateOne) ClearDefinitions() *SynsetUpdateOne

ClearDefinitions clears all "definitions" edges to the Definition entity.

func (*SynsetUpdateOne) ClearRelFrom

func (suo *SynsetUpdateOne) ClearRelFrom() *SynsetUpdateOne

ClearRelFrom clears all "relFrom" edges to the SynsetRelation entity.

func (*SynsetUpdateOne) ClearRelTo

func (suo *SynsetUpdateOne) ClearRelTo() *SynsetUpdateOne

ClearRelTo clears all "relTo" edges to the SynsetRelation entity.

func (*SynsetUpdateOne) ClearSense

func (suo *SynsetUpdateOne) ClearSense() *SynsetUpdateOne

ClearSense clears all "sense" edges to the Sense entity.

func (*SynsetUpdateOne) Exec

func (suo *SynsetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SynsetUpdateOne) ExecX

func (suo *SynsetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SynsetUpdateOne) Mutation

func (suo *SynsetUpdateOne) Mutation() *SynsetMutation

Mutation returns the SynsetMutation object of the builder.

func (*SynsetUpdateOne) RemoveDefinitionIDs

func (suo *SynsetUpdateOne) RemoveDefinitionIDs(ids ...int) *SynsetUpdateOne

RemoveDefinitionIDs removes the "definitions" edge to Definition entities by IDs.

func (*SynsetUpdateOne) RemoveDefinitions

func (suo *SynsetUpdateOne) RemoveDefinitions(d ...*Definition) *SynsetUpdateOne

RemoveDefinitions removes "definitions" edges to Definition entities.

func (*SynsetUpdateOne) RemoveRelFrom

func (suo *SynsetUpdateOne) RemoveRelFrom(s ...*SynsetRelation) *SynsetUpdateOne

RemoveRelFrom removes "relFrom" edges to SynsetRelation entities.

func (*SynsetUpdateOne) RemoveRelFromIDs

func (suo *SynsetUpdateOne) RemoveRelFromIDs(ids ...int) *SynsetUpdateOne

RemoveRelFromIDs removes the "relFrom" edge to SynsetRelation entities by IDs.

func (*SynsetUpdateOne) RemoveRelTo

func (suo *SynsetUpdateOne) RemoveRelTo(s ...*SynsetRelation) *SynsetUpdateOne

RemoveRelTo removes "relTo" edges to SynsetRelation entities.

func (*SynsetUpdateOne) RemoveRelToIDs

func (suo *SynsetUpdateOne) RemoveRelToIDs(ids ...int) *SynsetUpdateOne

RemoveRelToIDs removes the "relTo" edge to SynsetRelation entities by IDs.

func (*SynsetUpdateOne) RemoveSense

func (suo *SynsetUpdateOne) RemoveSense(s ...*Sense) *SynsetUpdateOne

RemoveSense removes "sense" edges to Sense entities.

func (*SynsetUpdateOne) RemoveSenseIDs

func (suo *SynsetUpdateOne) RemoveSenseIDs(ids ...string) *SynsetUpdateOne

RemoveSenseIDs removes the "sense" edge to Sense entities by IDs.

func (*SynsetUpdateOne) Save

func (suo *SynsetUpdateOne) Save(ctx context.Context) (*Synset, error)

Save executes the query and returns the updated Synset entity.

func (*SynsetUpdateOne) SaveX

func (suo *SynsetUpdateOne) SaveX(ctx context.Context) *Synset

SaveX is like Save, but panics if an error occurs.

func (*SynsetUpdateOne) Select

func (suo *SynsetUpdateOne) Select(field string, fields ...string) *SynsetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SynsetUpdateOne) SetNillablePartOfSpeech

func (suo *SynsetUpdateOne) SetNillablePartOfSpeech(s *string) *SynsetUpdateOne

SetNillablePartOfSpeech sets the "partOfSpeech" field if the given value is not nil.

func (*SynsetUpdateOne) SetPartOfSpeech

func (suo *SynsetUpdateOne) SetPartOfSpeech(s string) *SynsetUpdateOne

SetPartOfSpeech sets the "partOfSpeech" field.

func (*SynsetUpdateOne) Where

func (suo *SynsetUpdateOne) Where(ps ...predicate.Synset) *SynsetUpdateOne

Where appends a list predicates to the SynsetUpdate builder.

type Synsets

type Synsets []*Synset

Synsets is a parsable slice of Synset.

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 {

	// Definition is the client for interacting with the Definition builders.
	Definition *DefinitionClient
	// Lemma is the client for interacting with the Lemma builders.
	Lemma *LemmaClient
	// Sense is the client for interacting with the Sense builders.
	Sense *SenseClient
	// SenseRelation is the client for interacting with the SenseRelation builders.
	SenseRelation *SenseRelationClient
	// Synset is the client for interacting with the Synset builders.
	Synset *SynsetClient
	// SynsetRelation is the client for interacting with the SynsetRelation builders.
	SynsetRelation *SynsetRelationClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL