ent

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 36 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.
	TypeAttachedFile     = "AttachedFile"
	TypeFile             = "File"
	TypeFriendship       = "Friendship"
	TypeGroup            = "Group"
	TypeGroupTag         = "GroupTag"
	TypeProcess          = "Process"
	TypeRelationship     = "Relationship"
	TypeRelationshipInfo = "RelationshipInfo"
	TypeRole             = "Role"
	TypeRoleUser         = "RoleUser"
	TypeTag              = "Tag"
	TypeTweet            = "Tweet"
	TypeTweetLike        = "TweetLike"
	TypeTweetTag         = "TweetTag"
	TypeUser             = "User"
	TypeUserGroup        = "UserGroup"
	TypeUserTweet        = "UserTweet"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type AttachedFile added in v0.11.8

type AttachedFile struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// AttachTime holds the value of the "attach_time" field.
	AttachTime time.Time `json:"attach_time,omitempty"`
	// FID holds the value of the "f_id" field.
	FID int `json:"f_id,omitempty"`
	// ProcID holds the value of the "proc_id" field.
	ProcID int `json:"proc_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AttachedFileQuery when eager-loading is set.
	Edges AttachedFileEdges `json:"edges"`
	// contains filtered or unexported fields
}

AttachedFile is the model entity for the AttachedFile schema.

func (*AttachedFile) QueryFi added in v0.11.8

func (af *AttachedFile) QueryFi() *FileQuery

QueryFi queries the "fi" edge of the AttachedFile entity.

func (*AttachedFile) QueryProc added in v0.11.8

func (af *AttachedFile) QueryProc() *ProcessQuery

QueryProc queries the "proc" edge of the AttachedFile entity.

func (*AttachedFile) String added in v0.11.8

func (af *AttachedFile) String() string

String implements the fmt.Stringer.

func (*AttachedFile) Unwrap added in v0.11.8

func (af *AttachedFile) Unwrap() *AttachedFile

Unwrap unwraps the AttachedFile 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 (*AttachedFile) Update added in v0.11.8

func (af *AttachedFile) Update() *AttachedFileUpdateOne

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

type AttachedFileClient added in v0.11.8

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

AttachedFileClient is a client for the AttachedFile schema.

func NewAttachedFileClient added in v0.11.8

func NewAttachedFileClient(c config) *AttachedFileClient

NewAttachedFileClient returns a client for the AttachedFile from the given config.

func (*AttachedFileClient) Create added in v0.11.8

Create returns a builder for creating a AttachedFile entity.

func (*AttachedFileClient) CreateBulk added in v0.11.8

func (c *AttachedFileClient) CreateBulk(builders ...*AttachedFileCreate) *AttachedFileCreateBulk

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

func (*AttachedFileClient) Delete added in v0.11.8

Delete returns a delete builder for AttachedFile.

func (*AttachedFileClient) DeleteOne added in v0.11.8

DeleteOne returns a builder for deleting the given entity.

func (*AttachedFileClient) DeleteOneID added in v0.11.8

func (c *AttachedFileClient) DeleteOneID(id int) *AttachedFileDeleteOne

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

func (*AttachedFileClient) Get added in v0.11.8

Get returns a AttachedFile entity by its id.

func (*AttachedFileClient) GetX added in v0.11.8

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

func (*AttachedFileClient) Hooks added in v0.11.8

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

Hooks returns the client hooks.

func (*AttachedFileClient) Intercept added in v0.11.8

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

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

func (*AttachedFileClient) Interceptors added in v0.11.8

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

Interceptors returns the client interceptors.

func (*AttachedFileClient) Query added in v0.11.8

Query returns a query builder for AttachedFile.

func (*AttachedFileClient) QueryFi added in v0.11.8

func (c *AttachedFileClient) QueryFi(af *AttachedFile) *FileQuery

QueryFi queries the fi edge of a AttachedFile.

func (*AttachedFileClient) QueryProc added in v0.11.8

func (c *AttachedFileClient) QueryProc(af *AttachedFile) *ProcessQuery

QueryProc queries the proc edge of a AttachedFile.

func (*AttachedFileClient) Update added in v0.11.8

Update returns an update builder for AttachedFile.

func (*AttachedFileClient) UpdateOne added in v0.11.8

UpdateOne returns an update builder for the given entity.

func (*AttachedFileClient) UpdateOneID added in v0.11.8

func (c *AttachedFileClient) UpdateOneID(id int) *AttachedFileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AttachedFileClient) Use added in v0.11.8

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

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

type AttachedFileCreate added in v0.11.8

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

AttachedFileCreate is the builder for creating a AttachedFile entity.

func (*AttachedFileCreate) Exec added in v0.11.8

func (afc *AttachedFileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachedFileCreate) ExecX added in v0.11.8

func (afc *AttachedFileCreate) ExecX(ctx context.Context)

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

func (*AttachedFileCreate) Mutation added in v0.11.8

func (afc *AttachedFileCreate) Mutation() *AttachedFileMutation

Mutation returns the AttachedFileMutation object of the builder.

func (*AttachedFileCreate) OnConflict added in v0.11.8

func (afc *AttachedFileCreate) OnConflict(opts ...sql.ConflictOption) *AttachedFileUpsertOne

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

client.AttachedFile.Create().
	SetAttachTime(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AttachedFileUpsert) {
		SetAttachTime(v+v).
	}).
	Exec(ctx)

func (*AttachedFileCreate) OnConflictColumns added in v0.11.8

func (afc *AttachedFileCreate) OnConflictColumns(columns ...string) *AttachedFileUpsertOne

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

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

func (*AttachedFileCreate) Save added in v0.11.8

Save creates the AttachedFile in the database.

func (*AttachedFileCreate) SaveX added in v0.11.8

SaveX calls Save and panics if Save returns an error.

func (*AttachedFileCreate) SetAttachTime added in v0.11.8

func (afc *AttachedFileCreate) SetAttachTime(t time.Time) *AttachedFileCreate

SetAttachTime sets the "attach_time" field.

func (*AttachedFileCreate) SetFID added in v0.11.8

func (afc *AttachedFileCreate) SetFID(i int) *AttachedFileCreate

SetFID sets the "f_id" field.

func (*AttachedFileCreate) SetFi added in v0.11.8

func (afc *AttachedFileCreate) SetFi(f *File) *AttachedFileCreate

SetFi sets the "fi" edge to the File entity.

func (*AttachedFileCreate) SetFiID added in v0.11.8

func (afc *AttachedFileCreate) SetFiID(id int) *AttachedFileCreate

SetFiID sets the "fi" edge to the File entity by ID.

func (*AttachedFileCreate) SetNillableAttachTime added in v0.11.8

func (afc *AttachedFileCreate) SetNillableAttachTime(t *time.Time) *AttachedFileCreate

SetNillableAttachTime sets the "attach_time" field if the given value is not nil.

func (*AttachedFileCreate) SetProc added in v0.11.8

func (afc *AttachedFileCreate) SetProc(p *Process) *AttachedFileCreate

SetProc sets the "proc" edge to the Process entity.

func (*AttachedFileCreate) SetProcID added in v0.11.8

func (afc *AttachedFileCreate) SetProcID(i int) *AttachedFileCreate

SetProcID sets the "proc_id" field.

type AttachedFileCreateBulk added in v0.11.8

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

AttachedFileCreateBulk is the builder for creating many AttachedFile entities in bulk.

func (*AttachedFileCreateBulk) Exec added in v0.11.8

func (afcb *AttachedFileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachedFileCreateBulk) ExecX added in v0.11.8

func (afcb *AttachedFileCreateBulk) ExecX(ctx context.Context)

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

func (*AttachedFileCreateBulk) OnConflict added in v0.11.8

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

client.AttachedFile.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AttachedFileUpsert) {
		SetAttachTime(v+v).
	}).
	Exec(ctx)

func (*AttachedFileCreateBulk) OnConflictColumns added in v0.11.8

func (afcb *AttachedFileCreateBulk) OnConflictColumns(columns ...string) *AttachedFileUpsertBulk

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

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

func (*AttachedFileCreateBulk) Save added in v0.11.8

Save creates the AttachedFile entities in the database.

func (*AttachedFileCreateBulk) SaveX added in v0.11.8

func (afcb *AttachedFileCreateBulk) SaveX(ctx context.Context) []*AttachedFile

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

type AttachedFileDelete added in v0.11.8

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

AttachedFileDelete is the builder for deleting a AttachedFile entity.

func (*AttachedFileDelete) Exec added in v0.11.8

func (afd *AttachedFileDelete) Exec(ctx context.Context) (int, error)

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

func (*AttachedFileDelete) ExecX added in v0.11.8

func (afd *AttachedFileDelete) ExecX(ctx context.Context) int

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

func (*AttachedFileDelete) Where added in v0.11.8

Where appends a list predicates to the AttachedFileDelete builder.

type AttachedFileDeleteOne added in v0.11.8

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

AttachedFileDeleteOne is the builder for deleting a single AttachedFile entity.

func (*AttachedFileDeleteOne) Exec added in v0.11.8

func (afdo *AttachedFileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AttachedFileDeleteOne) ExecX added in v0.11.8

func (afdo *AttachedFileDeleteOne) ExecX(ctx context.Context)

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

func (*AttachedFileDeleteOne) Where added in v0.11.8

Where appends a list predicates to the AttachedFileDelete builder.

type AttachedFileEdges added in v0.11.8

type AttachedFileEdges struct {
	// Fi holds the value of the fi edge.
	Fi *File `json:"fi,omitempty"`
	// Proc holds the value of the proc edge.
	Proc *Process `json:"proc,omitempty"`
	// contains filtered or unexported fields
}

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

func (AttachedFileEdges) FiOrErr added in v0.11.8

func (e AttachedFileEdges) FiOrErr() (*File, error)

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

func (AttachedFileEdges) ProcOrErr added in v0.11.8

func (e AttachedFileEdges) ProcOrErr() (*Process, error)

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

type AttachedFileFilter added in v0.11.8

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

AttachedFileFilter provides a generic filtering capability at runtime for AttachedFileQuery.

func (*AttachedFileFilter) Where added in v0.11.8

func (f *AttachedFileFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*AttachedFileFilter) WhereAttachTime added in v0.11.8

func (f *AttachedFileFilter) WhereAttachTime(p entql.TimeP)

WhereAttachTime applies the entql time.Time predicate on the attach_time field.

func (*AttachedFileFilter) WhereFID added in v0.11.8

func (f *AttachedFileFilter) WhereFID(p entql.IntP)

WhereFID applies the entql int predicate on the f_id field.

func (*AttachedFileFilter) WhereHasFi added in v0.11.8

func (f *AttachedFileFilter) WhereHasFi()

WhereHasFi applies a predicate to check if query has an edge fi.

func (*AttachedFileFilter) WhereHasFiWith added in v0.11.8

func (f *AttachedFileFilter) WhereHasFiWith(preds ...predicate.File)

WhereHasFiWith applies a predicate to check if query has an edge fi with a given conditions (other predicates).

func (*AttachedFileFilter) WhereHasProc added in v0.11.8

func (f *AttachedFileFilter) WhereHasProc()

WhereHasProc applies a predicate to check if query has an edge proc.

func (*AttachedFileFilter) WhereHasProcWith added in v0.11.8

func (f *AttachedFileFilter) WhereHasProcWith(preds ...predicate.Process)

WhereHasProcWith applies a predicate to check if query has an edge proc with a given conditions (other predicates).

func (*AttachedFileFilter) WhereID added in v0.11.8

func (f *AttachedFileFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*AttachedFileFilter) WhereProcID added in v0.11.8

func (f *AttachedFileFilter) WhereProcID(p entql.IntP)

WhereProcID applies the entql int predicate on the proc_id field.

type AttachedFileGroupBy added in v0.11.8

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

AttachedFileGroupBy is the group-by builder for AttachedFile entities.

func (*AttachedFileGroupBy) Aggregate added in v0.11.8

func (afgb *AttachedFileGroupBy) Aggregate(fns ...AggregateFunc) *AttachedFileGroupBy

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

func (*AttachedFileGroupBy) Bool added in v0.11.8

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

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

func (*AttachedFileGroupBy) BoolX added in v0.11.8

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

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

func (*AttachedFileGroupBy) Bools added in v0.11.8

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

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

func (*AttachedFileGroupBy) BoolsX added in v0.11.8

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

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

func (*AttachedFileGroupBy) Float64 added in v0.11.8

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

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

func (*AttachedFileGroupBy) Float64X added in v0.11.8

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

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

func (*AttachedFileGroupBy) Float64s added in v0.11.8

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

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

func (*AttachedFileGroupBy) Float64sX added in v0.11.8

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

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

func (*AttachedFileGroupBy) Int added in v0.11.8

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

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

func (*AttachedFileGroupBy) IntX added in v0.11.8

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

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

func (*AttachedFileGroupBy) Ints added in v0.11.8

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

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

func (*AttachedFileGroupBy) IntsX added in v0.11.8

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

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

func (*AttachedFileGroupBy) Scan added in v0.11.8

func (afgb *AttachedFileGroupBy) Scan(ctx context.Context, v any) error

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

func (*AttachedFileGroupBy) ScanX added in v0.11.8

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

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

func (*AttachedFileGroupBy) String added in v0.11.8

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

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

func (*AttachedFileGroupBy) StringX added in v0.11.8

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

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

func (*AttachedFileGroupBy) Strings added in v0.11.8

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

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

func (*AttachedFileGroupBy) StringsX added in v0.11.8

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

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

type AttachedFileMutation added in v0.11.8

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

AttachedFileMutation represents an operation that mutates the AttachedFile nodes in the graph.

func (*AttachedFileMutation) AddField added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) AddedEdges added in v0.11.8

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

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

func (*AttachedFileMutation) AddedField added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) AddedFields added in v0.11.8

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

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

func (*AttachedFileMutation) AddedIDs added in v0.11.8

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

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

func (*AttachedFileMutation) AttachTime added in v0.11.8

func (m *AttachedFileMutation) AttachTime() (r time.Time, exists bool)

AttachTime returns the value of the "attach_time" field in the mutation.

func (*AttachedFileMutation) ClearEdge added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) ClearFi added in v0.11.8

func (m *AttachedFileMutation) ClearFi()

ClearFi clears the "fi" edge to the File entity.

func (*AttachedFileMutation) ClearField added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) ClearProc added in v0.11.8

func (m *AttachedFileMutation) ClearProc()

ClearProc clears the "proc" edge to the Process entity.

func (*AttachedFileMutation) ClearedEdges added in v0.11.8

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

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

func (*AttachedFileMutation) ClearedFields added in v0.11.8

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

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

func (AttachedFileMutation) Client added in v0.11.8

func (m AttachedFileMutation) 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 (*AttachedFileMutation) EdgeCleared added in v0.11.8

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

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

func (*AttachedFileMutation) FID added in v0.11.8

func (m *AttachedFileMutation) FID() (r int, exists bool)

FID returns the value of the "f_id" field in the mutation.

func (*AttachedFileMutation) FiCleared added in v0.11.8

func (m *AttachedFileMutation) FiCleared() bool

FiCleared reports if the "fi" edge to the File entity was cleared.

func (*AttachedFileMutation) FiID added in v0.11.8

func (m *AttachedFileMutation) FiID() (id int, exists bool)

FiID returns the "fi" edge ID in the mutation.

func (*AttachedFileMutation) FiIDs added in v0.11.8

func (m *AttachedFileMutation) FiIDs() (ids []int)

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

func (*AttachedFileMutation) Field added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) FieldCleared added in v0.11.8

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

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

func (*AttachedFileMutation) Fields added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) Filter added in v0.11.8

Filter returns an entql.Where implementation to apply filters on the AttachedFileMutation builder.

func (*AttachedFileMutation) ID added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) IDs added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) OldAttachTime added in v0.11.8

func (m *AttachedFileMutation) OldAttachTime(ctx context.Context) (v time.Time, err error)

OldAttachTime returns the old "attach_time" field's value of the AttachedFile entity. If the AttachedFile 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 (*AttachedFileMutation) OldFID added in v0.11.8

func (m *AttachedFileMutation) OldFID(ctx context.Context) (v int, err error)

OldFID returns the old "f_id" field's value of the AttachedFile entity. If the AttachedFile 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 (*AttachedFileMutation) OldField added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) OldProcID added in v0.11.8

func (m *AttachedFileMutation) OldProcID(ctx context.Context) (v int, err error)

OldProcID returns the old "proc_id" field's value of the AttachedFile entity. If the AttachedFile 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 (*AttachedFileMutation) Op added in v0.11.8

func (m *AttachedFileMutation) Op() Op

Op returns the operation name.

func (*AttachedFileMutation) ProcCleared added in v0.11.8

func (m *AttachedFileMutation) ProcCleared() bool

ProcCleared reports if the "proc" edge to the Process entity was cleared.

func (*AttachedFileMutation) ProcID added in v0.11.8

func (m *AttachedFileMutation) ProcID() (r int, exists bool)

ProcID returns the value of the "proc_id" field in the mutation.

func (*AttachedFileMutation) ProcIDs added in v0.11.8

func (m *AttachedFileMutation) ProcIDs() (ids []int)

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

func (*AttachedFileMutation) RemovedEdges added in v0.11.8

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

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

func (*AttachedFileMutation) RemovedIDs added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) ResetAttachTime added in v0.11.8

func (m *AttachedFileMutation) ResetAttachTime()

ResetAttachTime resets all changes to the "attach_time" field.

func (*AttachedFileMutation) ResetEdge added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) ResetFID added in v0.11.8

func (m *AttachedFileMutation) ResetFID()

ResetFID resets all changes to the "f_id" field.

func (*AttachedFileMutation) ResetFi added in v0.11.8

func (m *AttachedFileMutation) ResetFi()

ResetFi resets all changes to the "fi" edge.

func (*AttachedFileMutation) ResetField added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) ResetProc added in v0.11.8

func (m *AttachedFileMutation) ResetProc()

ResetProc resets all changes to the "proc" edge.

func (*AttachedFileMutation) ResetProcID added in v0.11.8

func (m *AttachedFileMutation) ResetProcID()

ResetProcID resets all changes to the "proc_id" field.

func (*AttachedFileMutation) SetAttachTime added in v0.11.8

func (m *AttachedFileMutation) SetAttachTime(t time.Time)

SetAttachTime sets the "attach_time" field.

func (*AttachedFileMutation) SetFID added in v0.11.8

func (m *AttachedFileMutation) SetFID(i int)

SetFID sets the "f_id" field.

func (*AttachedFileMutation) SetFiID added in v0.11.8

func (m *AttachedFileMutation) SetFiID(id int)

SetFiID sets the "fi" edge to the File entity by id.

func (*AttachedFileMutation) SetField added in v0.11.8

func (m *AttachedFileMutation) 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 (*AttachedFileMutation) SetOp added in v0.11.8

func (m *AttachedFileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AttachedFileMutation) SetProcID added in v0.11.8

func (m *AttachedFileMutation) SetProcID(i int)

SetProcID sets the "proc_id" field.

func (AttachedFileMutation) Tx added in v0.11.8

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

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

func (*AttachedFileMutation) Type added in v0.11.8

func (m *AttachedFileMutation) Type() string

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

func (*AttachedFileMutation) Where added in v0.11.8

Where appends a list predicates to the AttachedFileMutation builder.

func (*AttachedFileMutation) WhereP added in v0.11.8

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

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

type AttachedFileQuery added in v0.11.8

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

AttachedFileQuery is the builder for querying AttachedFile entities.

func (*AttachedFileQuery) Aggregate added in v0.11.8

func (afq *AttachedFileQuery) Aggregate(fns ...AggregateFunc) *AttachedFileSelect

Aggregate returns a AttachedFileSelect configured with the given aggregations.

func (*AttachedFileQuery) All added in v0.11.8

func (afq *AttachedFileQuery) All(ctx context.Context) ([]*AttachedFile, error)

All executes the query and returns a list of AttachedFiles.

func (*AttachedFileQuery) AllX added in v0.11.8

func (afq *AttachedFileQuery) AllX(ctx context.Context) []*AttachedFile

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

func (*AttachedFileQuery) Clone added in v0.11.8

func (afq *AttachedFileQuery) Clone() *AttachedFileQuery

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

func (*AttachedFileQuery) Count added in v0.11.8

func (afq *AttachedFileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AttachedFileQuery) CountX added in v0.11.8

func (afq *AttachedFileQuery) CountX(ctx context.Context) int

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

func (*AttachedFileQuery) Exist added in v0.11.8

func (afq *AttachedFileQuery) Exist(ctx context.Context) (bool, error)

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

func (*AttachedFileQuery) ExistX added in v0.11.8

func (afq *AttachedFileQuery) ExistX(ctx context.Context) bool

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

func (*AttachedFileQuery) Filter added in v0.11.8

func (afq *AttachedFileQuery) Filter() *AttachedFileFilter

Filter returns a Filter implementation to apply filters on the AttachedFileQuery builder.

func (*AttachedFileQuery) First added in v0.11.8

func (afq *AttachedFileQuery) First(ctx context.Context) (*AttachedFile, error)

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

func (*AttachedFileQuery) FirstID added in v0.11.8

func (afq *AttachedFileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AttachedFileQuery) FirstIDX added in v0.11.8

func (afq *AttachedFileQuery) FirstIDX(ctx context.Context) int

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

func (*AttachedFileQuery) FirstX added in v0.11.8

func (afq *AttachedFileQuery) FirstX(ctx context.Context) *AttachedFile

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

func (*AttachedFileQuery) GroupBy added in v0.11.8

func (afq *AttachedFileQuery) GroupBy(field string, fields ...string) *AttachedFileGroupBy

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

client.AttachedFile.Query().
	GroupBy(attachedfile.FieldAttachTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AttachedFileQuery) IDs added in v0.11.8

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

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

func (*AttachedFileQuery) IDsX added in v0.11.8

func (afq *AttachedFileQuery) IDsX(ctx context.Context) []int

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

func (*AttachedFileQuery) Limit added in v0.11.8

func (afq *AttachedFileQuery) Limit(limit int) *AttachedFileQuery

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

func (*AttachedFileQuery) Offset added in v0.11.8

func (afq *AttachedFileQuery) Offset(offset int) *AttachedFileQuery

Offset to start from.

func (*AttachedFileQuery) Only added in v0.11.8

func (afq *AttachedFileQuery) Only(ctx context.Context) (*AttachedFile, error)

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

func (*AttachedFileQuery) OnlyID added in v0.11.8

func (afq *AttachedFileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AttachedFileQuery) OnlyIDX added in v0.11.8

func (afq *AttachedFileQuery) OnlyIDX(ctx context.Context) int

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

func (*AttachedFileQuery) OnlyX added in v0.11.8

func (afq *AttachedFileQuery) OnlyX(ctx context.Context) *AttachedFile

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

func (*AttachedFileQuery) Order added in v0.11.8

func (afq *AttachedFileQuery) Order(o ...OrderFunc) *AttachedFileQuery

Order specifies how the records should be ordered.

func (*AttachedFileQuery) QueryFi added in v0.11.8

func (afq *AttachedFileQuery) QueryFi() *FileQuery

QueryFi chains the current query on the "fi" edge.

func (*AttachedFileQuery) QueryProc added in v0.11.8

func (afq *AttachedFileQuery) QueryProc() *ProcessQuery

QueryProc chains the current query on the "proc" edge.

func (*AttachedFileQuery) Select added in v0.11.8

func (afq *AttachedFileQuery) Select(fields ...string) *AttachedFileSelect

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

client.AttachedFile.Query().
	Select(attachedfile.FieldAttachTime).
	Scan(ctx, &v)

func (*AttachedFileQuery) Unique added in v0.11.8

func (afq *AttachedFileQuery) Unique(unique bool) *AttachedFileQuery

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 (*AttachedFileQuery) Where added in v0.11.8

Where adds a new predicate for the AttachedFileQuery builder.

func (*AttachedFileQuery) WithFi added in v0.11.8

func (afq *AttachedFileQuery) WithFi(opts ...func(*FileQuery)) *AttachedFileQuery

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

func (*AttachedFileQuery) WithProc added in v0.11.8

func (afq *AttachedFileQuery) WithProc(opts ...func(*ProcessQuery)) *AttachedFileQuery

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

type AttachedFileSelect added in v0.11.8

type AttachedFileSelect struct {
	*AttachedFileQuery
	// contains filtered or unexported fields
}

AttachedFileSelect is the builder for selecting fields of AttachedFile entities.

func (*AttachedFileSelect) Aggregate added in v0.11.8

func (afs *AttachedFileSelect) Aggregate(fns ...AggregateFunc) *AttachedFileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AttachedFileSelect) Bool added in v0.11.8

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

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

func (*AttachedFileSelect) BoolX added in v0.11.8

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

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

func (*AttachedFileSelect) Bools added in v0.11.8

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

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

func (*AttachedFileSelect) BoolsX added in v0.11.8

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

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

func (*AttachedFileSelect) Float64 added in v0.11.8

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

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

func (*AttachedFileSelect) Float64X added in v0.11.8

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

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

func (*AttachedFileSelect) Float64s added in v0.11.8

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

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

func (*AttachedFileSelect) Float64sX added in v0.11.8

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

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

func (*AttachedFileSelect) Int added in v0.11.8

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

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

func (*AttachedFileSelect) IntX added in v0.11.8

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

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

func (*AttachedFileSelect) Ints added in v0.11.8

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

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

func (*AttachedFileSelect) IntsX added in v0.11.8

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

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

func (*AttachedFileSelect) Scan added in v0.11.8

func (afs *AttachedFileSelect) Scan(ctx context.Context, v any) error

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

func (*AttachedFileSelect) ScanX added in v0.11.8

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

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

func (*AttachedFileSelect) String added in v0.11.8

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

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

func (*AttachedFileSelect) StringX added in v0.11.8

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

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

func (*AttachedFileSelect) Strings added in v0.11.8

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

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

func (*AttachedFileSelect) StringsX added in v0.11.8

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

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

type AttachedFileUpdate added in v0.11.8

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

AttachedFileUpdate is the builder for updating AttachedFile entities.

func (*AttachedFileUpdate) ClearFi added in v0.11.8

func (afu *AttachedFileUpdate) ClearFi() *AttachedFileUpdate

ClearFi clears the "fi" edge to the File entity.

func (*AttachedFileUpdate) ClearProc added in v0.11.8

func (afu *AttachedFileUpdate) ClearProc() *AttachedFileUpdate

ClearProc clears the "proc" edge to the Process entity.

func (*AttachedFileUpdate) Exec added in v0.11.8

func (afu *AttachedFileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachedFileUpdate) ExecX added in v0.11.8

func (afu *AttachedFileUpdate) ExecX(ctx context.Context)

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

func (*AttachedFileUpdate) Mutation added in v0.11.8

func (afu *AttachedFileUpdate) Mutation() *AttachedFileMutation

Mutation returns the AttachedFileMutation object of the builder.

func (*AttachedFileUpdate) Save added in v0.11.8

func (afu *AttachedFileUpdate) Save(ctx context.Context) (int, error)

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

func (*AttachedFileUpdate) SaveX added in v0.11.8

func (afu *AttachedFileUpdate) SaveX(ctx context.Context) int

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

func (*AttachedFileUpdate) SetAttachTime added in v0.11.8

func (afu *AttachedFileUpdate) SetAttachTime(t time.Time) *AttachedFileUpdate

SetAttachTime sets the "attach_time" field.

func (*AttachedFileUpdate) SetFID added in v0.11.8

func (afu *AttachedFileUpdate) SetFID(i int) *AttachedFileUpdate

SetFID sets the "f_id" field.

func (*AttachedFileUpdate) SetFi added in v0.11.8

func (afu *AttachedFileUpdate) SetFi(f *File) *AttachedFileUpdate

SetFi sets the "fi" edge to the File entity.

func (*AttachedFileUpdate) SetFiID added in v0.11.8

func (afu *AttachedFileUpdate) SetFiID(id int) *AttachedFileUpdate

SetFiID sets the "fi" edge to the File entity by ID.

func (*AttachedFileUpdate) SetNillableAttachTime added in v0.11.8

func (afu *AttachedFileUpdate) SetNillableAttachTime(t *time.Time) *AttachedFileUpdate

SetNillableAttachTime sets the "attach_time" field if the given value is not nil.

func (*AttachedFileUpdate) SetProc added in v0.11.8

func (afu *AttachedFileUpdate) SetProc(p *Process) *AttachedFileUpdate

SetProc sets the "proc" edge to the Process entity.

func (*AttachedFileUpdate) SetProcID added in v0.11.8

func (afu *AttachedFileUpdate) SetProcID(i int) *AttachedFileUpdate

SetProcID sets the "proc_id" field.

func (*AttachedFileUpdate) Where added in v0.11.8

Where appends a list predicates to the AttachedFileUpdate builder.

type AttachedFileUpdateOne added in v0.11.8

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

AttachedFileUpdateOne is the builder for updating a single AttachedFile entity.

func (*AttachedFileUpdateOne) ClearFi added in v0.11.8

ClearFi clears the "fi" edge to the File entity.

func (*AttachedFileUpdateOne) ClearProc added in v0.11.8

func (afuo *AttachedFileUpdateOne) ClearProc() *AttachedFileUpdateOne

ClearProc clears the "proc" edge to the Process entity.

func (*AttachedFileUpdateOne) Exec added in v0.11.8

func (afuo *AttachedFileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AttachedFileUpdateOne) ExecX added in v0.11.8

func (afuo *AttachedFileUpdateOne) ExecX(ctx context.Context)

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

func (*AttachedFileUpdateOne) Mutation added in v0.11.8

func (afuo *AttachedFileUpdateOne) Mutation() *AttachedFileMutation

Mutation returns the AttachedFileMutation object of the builder.

func (*AttachedFileUpdateOne) Save added in v0.11.8

Save executes the query and returns the updated AttachedFile entity.

func (*AttachedFileUpdateOne) SaveX added in v0.11.8

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

func (*AttachedFileUpdateOne) Select added in v0.11.8

func (afuo *AttachedFileUpdateOne) Select(field string, fields ...string) *AttachedFileUpdateOne

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

func (*AttachedFileUpdateOne) SetAttachTime added in v0.11.8

func (afuo *AttachedFileUpdateOne) SetAttachTime(t time.Time) *AttachedFileUpdateOne

SetAttachTime sets the "attach_time" field.

func (*AttachedFileUpdateOne) SetFID added in v0.11.8

SetFID sets the "f_id" field.

func (*AttachedFileUpdateOne) SetFi added in v0.11.8

SetFi sets the "fi" edge to the File entity.

func (*AttachedFileUpdateOne) SetFiID added in v0.11.8

func (afuo *AttachedFileUpdateOne) SetFiID(id int) *AttachedFileUpdateOne

SetFiID sets the "fi" edge to the File entity by ID.

func (*AttachedFileUpdateOne) SetNillableAttachTime added in v0.11.8

func (afuo *AttachedFileUpdateOne) SetNillableAttachTime(t *time.Time) *AttachedFileUpdateOne

SetNillableAttachTime sets the "attach_time" field if the given value is not nil.

func (*AttachedFileUpdateOne) SetProc added in v0.11.8

SetProc sets the "proc" edge to the Process entity.

func (*AttachedFileUpdateOne) SetProcID added in v0.11.8

func (afuo *AttachedFileUpdateOne) SetProcID(i int) *AttachedFileUpdateOne

SetProcID sets the "proc_id" field.

func (*AttachedFileUpdateOne) Where added in v0.11.8

Where appends a list predicates to the AttachedFileUpdate builder.

type AttachedFileUpsert added in v0.11.8

type AttachedFileUpsert struct {
	*sql.UpdateSet
}

AttachedFileUpsert is the "OnConflict" setter.

func (*AttachedFileUpsert) SetAttachTime added in v0.11.8

func (u *AttachedFileUpsert) SetAttachTime(v time.Time) *AttachedFileUpsert

SetAttachTime sets the "attach_time" field.

func (*AttachedFileUpsert) SetFID added in v0.11.8

SetFID sets the "f_id" field.

func (*AttachedFileUpsert) SetProcID added in v0.11.8

func (u *AttachedFileUpsert) SetProcID(v int) *AttachedFileUpsert

SetProcID sets the "proc_id" field.

func (*AttachedFileUpsert) UpdateAttachTime added in v0.11.8

func (u *AttachedFileUpsert) UpdateAttachTime() *AttachedFileUpsert

UpdateAttachTime sets the "attach_time" field to the value that was provided on create.

func (*AttachedFileUpsert) UpdateFID added in v0.11.8

func (u *AttachedFileUpsert) UpdateFID() *AttachedFileUpsert

UpdateFID sets the "f_id" field to the value that was provided on create.

func (*AttachedFileUpsert) UpdateProcID added in v0.11.8

func (u *AttachedFileUpsert) UpdateProcID() *AttachedFileUpsert

UpdateProcID sets the "proc_id" field to the value that was provided on create.

type AttachedFileUpsertBulk added in v0.11.8

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

AttachedFileUpsertBulk is the builder for "upsert"-ing a bulk of AttachedFile nodes.

func (*AttachedFileUpsertBulk) DoNothing added in v0.11.8

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

func (*AttachedFileUpsertBulk) Exec added in v0.11.8

Exec executes the query.

func (*AttachedFileUpsertBulk) ExecX added in v0.11.8

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

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

func (*AttachedFileUpsertBulk) Ignore added in v0.11.8

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

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

func (*AttachedFileUpsertBulk) SetAttachTime added in v0.11.8

SetAttachTime sets the "attach_time" field.

func (*AttachedFileUpsertBulk) SetFID added in v0.11.8

SetFID sets the "f_id" field.

func (*AttachedFileUpsertBulk) SetProcID added in v0.11.8

SetProcID sets the "proc_id" field.

func (*AttachedFileUpsertBulk) Update added in v0.11.8

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

func (*AttachedFileUpsertBulk) UpdateAttachTime added in v0.11.8

func (u *AttachedFileUpsertBulk) UpdateAttachTime() *AttachedFileUpsertBulk

UpdateAttachTime sets the "attach_time" field to the value that was provided on create.

func (*AttachedFileUpsertBulk) UpdateFID added in v0.11.8

UpdateFID sets the "f_id" field to the value that was provided on create.

func (*AttachedFileUpsertBulk) UpdateNewValues added in v0.11.8

func (u *AttachedFileUpsertBulk) UpdateNewValues() *AttachedFileUpsertBulk

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

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

func (*AttachedFileUpsertBulk) UpdateProcID added in v0.11.8

UpdateProcID sets the "proc_id" field to the value that was provided on create.

type AttachedFileUpsertOne added in v0.11.8

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

AttachedFileUpsertOne is the builder for "upsert"-ing

one AttachedFile node.

func (*AttachedFileUpsertOne) DoNothing added in v0.11.8

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

func (*AttachedFileUpsertOne) Exec added in v0.11.8

Exec executes the query.

func (*AttachedFileUpsertOne) ExecX added in v0.11.8

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

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

func (*AttachedFileUpsertOne) ID added in v0.11.8

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

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

func (*AttachedFileUpsertOne) IDX added in v0.11.8

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

func (*AttachedFileUpsertOne) Ignore added in v0.11.8

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

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

func (*AttachedFileUpsertOne) SetAttachTime added in v0.11.8

SetAttachTime sets the "attach_time" field.

func (*AttachedFileUpsertOne) SetFID added in v0.11.8

SetFID sets the "f_id" field.

func (*AttachedFileUpsertOne) SetProcID added in v0.11.8

SetProcID sets the "proc_id" field.

func (*AttachedFileUpsertOne) Update added in v0.11.8

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

func (*AttachedFileUpsertOne) UpdateAttachTime added in v0.11.8

func (u *AttachedFileUpsertOne) UpdateAttachTime() *AttachedFileUpsertOne

UpdateAttachTime sets the "attach_time" field to the value that was provided on create.

func (*AttachedFileUpsertOne) UpdateFID added in v0.11.8

UpdateFID sets the "f_id" field to the value that was provided on create.

func (*AttachedFileUpsertOne) UpdateNewValues added in v0.11.8

func (u *AttachedFileUpsertOne) UpdateNewValues() *AttachedFileUpsertOne

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

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

func (*AttachedFileUpsertOne) UpdateProcID added in v0.11.8

func (u *AttachedFileUpsertOne) UpdateProcID() *AttachedFileUpsertOne

UpdateProcID sets the "proc_id" field to the value that was provided on create.

type AttachedFiles added in v0.11.8

type AttachedFiles []*AttachedFile

AttachedFiles is a parsable slice of AttachedFile.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AttachedFile is the client for interacting with the AttachedFile builders.
	AttachedFile *AttachedFileClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Friendship is the client for interacting with the Friendship builders.
	Friendship *FriendshipClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupTag is the client for interacting with the GroupTag builders.
	GroupTag *GroupTagClient
	// Process is the client for interacting with the Process builders.
	Process *ProcessClient
	// Relationship is the client for interacting with the Relationship builders.
	Relationship *RelationshipClient
	// RelationshipInfo is the client for interacting with the RelationshipInfo builders.
	RelationshipInfo *RelationshipInfoClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// RoleUser is the client for interacting with the RoleUser builders.
	RoleUser *RoleUserClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// Tweet is the client for interacting with the Tweet builders.
	Tweet *TweetClient
	// TweetLike is the client for interacting with the TweetLike builders.
	TweetLike *TweetLikeClient
	// TweetTag is the client for interacting with the TweetTag builders.
	TweetTag *TweetTagClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserGroup is the client for interacting with the UserGroup builders.
	UserGroup *UserGroupClient
	// UserTweet is the client for interacting with the UserTweet builders.
	UserTweet *UserTweetClient
	// 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().
	AttachedFile.
	Query().
	Count(ctx)

func (*Client) Intercept added in v0.11.5

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 added in v0.11.5

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 File added in v0.11.8

type File struct {

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

File is the model entity for the File schema.

func (*File) QueryProcesses added in v0.11.8

func (f *File) QueryProcesses() *ProcessQuery

QueryProcesses queries the "processes" edge of the File entity.

func (*File) String added in v0.11.8

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap added in v0.11.8

func (f *File) Unwrap() *File

Unwrap unwraps the File 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 (*File) Update added in v0.11.8

func (f *File) Update() *FileUpdateOne

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

type FileClient added in v0.11.8

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

FileClient is a client for the File schema.

func NewFileClient added in v0.11.8

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create added in v0.11.8

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk added in v0.11.8

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

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

func (*FileClient) Delete added in v0.11.8

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne added in v0.11.8

func (c *FileClient) DeleteOne(f *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID added in v0.11.8

func (c *FileClient) DeleteOneID(id int) *FileDeleteOne

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

func (*FileClient) Get added in v0.11.8

func (c *FileClient) Get(ctx context.Context, id int) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX added in v0.11.8

func (c *FileClient) GetX(ctx context.Context, id int) *File

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

func (*FileClient) Hooks added in v0.11.8

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

Hooks returns the client hooks.

func (*FileClient) Intercept added in v0.11.8

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

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

func (*FileClient) Interceptors added in v0.11.8

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

Interceptors returns the client interceptors.

func (*FileClient) Query added in v0.11.8

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) QueryProcesses added in v0.11.8

func (c *FileClient) QueryProcesses(f *File) *ProcessQuery

QueryProcesses queries the processes edge of a File.

func (*FileClient) Update added in v0.11.8

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne added in v0.11.8

func (c *FileClient) UpdateOne(f *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID added in v0.11.8

func (c *FileClient) UpdateOneID(id int) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use added in v0.11.8

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

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

type FileCreate added in v0.11.8

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

FileCreate is the builder for creating a File entity.

func (*FileCreate) AddProcessIDs added in v0.11.8

func (fc *FileCreate) AddProcessIDs(ids ...int) *FileCreate

AddProcessIDs adds the "processes" edge to the Process entity by IDs.

func (*FileCreate) AddProcesses added in v0.11.8

func (fc *FileCreate) AddProcesses(p ...*Process) *FileCreate

AddProcesses adds the "processes" edges to the Process entity.

func (*FileCreate) Exec added in v0.11.8

func (fc *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecX added in v0.11.8

func (fc *FileCreate) ExecX(ctx context.Context)

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

func (*FileCreate) Mutation added in v0.11.8

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) OnConflict added in v0.11.8

func (fc *FileCreate) OnConflict(opts ...sql.ConflictOption) *FileUpsertOne

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

client.File.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*FileCreate) OnConflictColumns added in v0.11.8

func (fc *FileCreate) OnConflictColumns(columns ...string) *FileUpsertOne

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

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

func (*FileCreate) Save added in v0.11.8

func (fc *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX added in v0.11.8

func (fc *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetName added in v0.11.8

func (fc *FileCreate) SetName(s string) *FileCreate

SetName sets the "name" field.

type FileCreateBulk added in v0.11.8

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

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec added in v0.11.8

func (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecX added in v0.11.8

func (fcb *FileCreateBulk) ExecX(ctx context.Context)

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

func (*FileCreateBulk) OnConflict added in v0.11.8

func (fcb *FileCreateBulk) OnConflict(opts ...sql.ConflictOption) *FileUpsertBulk

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

client.File.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*FileCreateBulk) OnConflictColumns added in v0.11.8

func (fcb *FileCreateBulk) OnConflictColumns(columns ...string) *FileUpsertBulk

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

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

func (*FileCreateBulk) Save added in v0.11.8

func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX added in v0.11.8

func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File

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

type FileDelete added in v0.11.8

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

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec added in v0.11.8

func (fd *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecX added in v0.11.8

func (fd *FileDelete) ExecX(ctx context.Context) int

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

func (*FileDelete) Where added in v0.11.8

func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne added in v0.11.8

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

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec added in v0.11.8

func (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX added in v0.11.8

func (fdo *FileDeleteOne) ExecX(ctx context.Context)

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

func (*FileDeleteOne) Where added in v0.11.8

func (fdo *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileEdges added in v0.11.8

type FileEdges struct {
	// Processes holds the value of the processes edge.
	Processes []*Process `json:"processes,omitempty"`
	// contains filtered or unexported fields
}

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

func (FileEdges) ProcessesOrErr added in v0.11.8

func (e FileEdges) ProcessesOrErr() ([]*Process, error)

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

type FileFilter added in v0.11.8

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

FileFilter provides a generic filtering capability at runtime for FileQuery.

func (*FileFilter) Where added in v0.11.8

func (f *FileFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*FileFilter) WhereHasProcesses added in v0.11.8

func (f *FileFilter) WhereHasProcesses()

WhereHasProcesses applies a predicate to check if query has an edge processes.

func (*FileFilter) WhereHasProcessesWith added in v0.11.8

func (f *FileFilter) WhereHasProcessesWith(preds ...predicate.Process)

WhereHasProcessesWith applies a predicate to check if query has an edge processes with a given conditions (other predicates).

func (*FileFilter) WhereID added in v0.11.8

func (f *FileFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*FileFilter) WhereName added in v0.11.8

func (f *FileFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

type FileGroupBy added in v0.11.8

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate added in v0.11.8

func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

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

func (*FileGroupBy) Bool added in v0.11.8

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

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

func (*FileGroupBy) BoolX added in v0.11.8

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

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

func (*FileGroupBy) Bools added in v0.11.8

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

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

func (*FileGroupBy) BoolsX added in v0.11.8

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

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

func (*FileGroupBy) Float64 added in v0.11.8

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

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

func (*FileGroupBy) Float64X added in v0.11.8

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

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

func (*FileGroupBy) Float64s added in v0.11.8

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

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

func (*FileGroupBy) Float64sX added in v0.11.8

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

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

func (*FileGroupBy) Int added in v0.11.8

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

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

func (*FileGroupBy) IntX added in v0.11.8

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

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

func (*FileGroupBy) Ints added in v0.11.8

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

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

func (*FileGroupBy) IntsX added in v0.11.8

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

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

func (*FileGroupBy) Scan added in v0.11.8

func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error

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

func (*FileGroupBy) ScanX added in v0.11.8

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

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

func (*FileGroupBy) String added in v0.11.8

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

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

func (*FileGroupBy) StringX added in v0.11.8

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

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

func (*FileGroupBy) Strings added in v0.11.8

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

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

func (*FileGroupBy) StringsX added in v0.11.8

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

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

type FileMutation added in v0.11.8

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

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddField added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) AddProcessIDs added in v0.11.8

func (m *FileMutation) AddProcessIDs(ids ...int)

AddProcessIDs adds the "processes" edge to the Process entity by ids.

func (*FileMutation) AddedEdges added in v0.11.8

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

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

func (*FileMutation) AddedField added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) AddedFields added in v0.11.8

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

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

func (*FileMutation) AddedIDs added in v0.11.8

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

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

func (*FileMutation) ClearEdge added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) ClearField added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) ClearProcesses added in v0.11.8

func (m *FileMutation) ClearProcesses()

ClearProcesses clears the "processes" edge to the Process entity.

func (*FileMutation) ClearedEdges added in v0.11.8

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

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

func (*FileMutation) ClearedFields added in v0.11.8

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

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

func (FileMutation) Client added in v0.11.8

func (m FileMutation) 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 (*FileMutation) EdgeCleared added in v0.11.8

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

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

func (*FileMutation) Field added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) FieldCleared added in v0.11.8

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

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

func (*FileMutation) Fields added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) Filter added in v0.11.8

func (m *FileMutation) Filter() *FileFilter

Filter returns an entql.Where implementation to apply filters on the FileMutation builder.

func (*FileMutation) ID added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) IDs added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) Name added in v0.11.8

func (m *FileMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*FileMutation) OldField added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) OldName added in v0.11.8

func (m *FileMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the File entity. If the File 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 (*FileMutation) Op added in v0.11.8

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) ProcessesCleared added in v0.11.8

func (m *FileMutation) ProcessesCleared() bool

ProcessesCleared reports if the "processes" edge to the Process entity was cleared.

func (*FileMutation) ProcessesIDs added in v0.11.8

func (m *FileMutation) ProcessesIDs() (ids []int)

ProcessesIDs returns the "processes" edge IDs in the mutation.

func (*FileMutation) RemoveProcessIDs added in v0.11.8

func (m *FileMutation) RemoveProcessIDs(ids ...int)

RemoveProcessIDs removes the "processes" edge to the Process entity by IDs.

func (*FileMutation) RemovedEdges added in v0.11.8

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

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

func (*FileMutation) RemovedIDs added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) RemovedProcessesIDs added in v0.11.8

func (m *FileMutation) RemovedProcessesIDs() (ids []int)

RemovedProcesses returns the removed IDs of the "processes" edge to the Process entity.

func (*FileMutation) ResetEdge added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) ResetField added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) ResetName added in v0.11.8

func (m *FileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileMutation) ResetProcesses added in v0.11.8

func (m *FileMutation) ResetProcesses()

ResetProcesses resets all changes to the "processes" edge.

func (*FileMutation) SetField added in v0.11.8

func (m *FileMutation) 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 (*FileMutation) SetName added in v0.11.8

func (m *FileMutation) SetName(s string)

SetName sets the "name" field.

func (*FileMutation) SetOp added in v0.11.8

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (FileMutation) Tx added in v0.11.8

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

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

func (*FileMutation) Type added in v0.11.8

func (m *FileMutation) Type() string

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

func (*FileMutation) Where added in v0.11.8

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP added in v0.11.8

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

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

type FileQuery added in v0.11.8

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

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate added in v0.11.8

func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All added in v0.11.8

func (fq *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX added in v0.11.8

func (fq *FileQuery) AllX(ctx context.Context) []*File

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

func (*FileQuery) Clone added in v0.11.8

func (fq *FileQuery) Clone() *FileQuery

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

func (*FileQuery) Count added in v0.11.8

func (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX added in v0.11.8

func (fq *FileQuery) CountX(ctx context.Context) int

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

func (*FileQuery) Exist added in v0.11.8

func (fq *FileQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileQuery) ExistX added in v0.11.8

func (fq *FileQuery) ExistX(ctx context.Context) bool

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

func (*FileQuery) Filter added in v0.11.8

func (fq *FileQuery) Filter() *FileFilter

Filter returns a Filter implementation to apply filters on the FileQuery builder.

func (*FileQuery) First added in v0.11.8

func (fq *FileQuery) First(ctx context.Context) (*File, error)

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

func (*FileQuery) FirstID added in v0.11.8

func (fq *FileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FileQuery) FirstIDX added in v0.11.8

func (fq *FileQuery) FirstIDX(ctx context.Context) int

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

func (*FileQuery) FirstX added in v0.11.8

func (fq *FileQuery) FirstX(ctx context.Context) *File

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

func (*FileQuery) GroupBy added in v0.11.8

func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

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

client.File.Query().
	GroupBy(file.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs added in v0.11.8

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

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

func (*FileQuery) IDsX added in v0.11.8

func (fq *FileQuery) IDsX(ctx context.Context) []int

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

func (*FileQuery) Limit added in v0.11.8

func (fq *FileQuery) Limit(limit int) *FileQuery

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

func (*FileQuery) Offset added in v0.11.8

func (fq *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only added in v0.11.8

func (fq *FileQuery) Only(ctx context.Context) (*File, error)

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

func (*FileQuery) OnlyID added in v0.11.8

func (fq *FileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FileQuery) OnlyIDX added in v0.11.8

func (fq *FileQuery) OnlyIDX(ctx context.Context) int

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

func (*FileQuery) OnlyX added in v0.11.8

func (fq *FileQuery) OnlyX(ctx context.Context) *File

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

func (*FileQuery) Order added in v0.11.8

func (fq *FileQuery) Order(o ...OrderFunc) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) QueryProcesses added in v0.11.8

func (fq *FileQuery) QueryProcesses() *ProcessQuery

QueryProcesses chains the current query on the "processes" edge.

func (*FileQuery) Select added in v0.11.8

func (fq *FileQuery) Select(fields ...string) *FileSelect

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

client.File.Query().
	Select(file.FieldName).
	Scan(ctx, &v)

func (*FileQuery) Unique added in v0.11.8

func (fq *FileQuery) Unique(unique bool) *FileQuery

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 (*FileQuery) Where added in v0.11.8

func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WithProcesses added in v0.11.8

func (fq *FileQuery) WithProcesses(opts ...func(*ProcessQuery)) *FileQuery

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

type FileSelect added in v0.11.8

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate added in v0.11.8

func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool added in v0.11.8

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

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

func (*FileSelect) BoolX added in v0.11.8

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

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

func (*FileSelect) Bools added in v0.11.8

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

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

func (*FileSelect) BoolsX added in v0.11.8

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

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

func (*FileSelect) Float64 added in v0.11.8

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

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

func (*FileSelect) Float64X added in v0.11.8

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

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

func (*FileSelect) Float64s added in v0.11.8

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

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

func (*FileSelect) Float64sX added in v0.11.8

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

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

func (*FileSelect) Int added in v0.11.8

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

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

func (*FileSelect) IntX added in v0.11.8

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

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

func (*FileSelect) Ints added in v0.11.8

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

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

func (*FileSelect) IntsX added in v0.11.8

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

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

func (*FileSelect) Scan added in v0.11.8

func (fs *FileSelect) Scan(ctx context.Context, v any) error

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

func (*FileSelect) ScanX added in v0.11.8

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

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

func (*FileSelect) String added in v0.11.8

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

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

func (*FileSelect) StringX added in v0.11.8

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

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

func (*FileSelect) Strings added in v0.11.8

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

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

func (*FileSelect) StringsX added in v0.11.8

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

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

type FileUpdate added in v0.11.8

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

FileUpdate is the builder for updating File entities.

func (*FileUpdate) AddProcessIDs added in v0.11.8

func (fu *FileUpdate) AddProcessIDs(ids ...int) *FileUpdate

AddProcessIDs adds the "processes" edge to the Process entity by IDs.

func (*FileUpdate) AddProcesses added in v0.11.8

func (fu *FileUpdate) AddProcesses(p ...*Process) *FileUpdate

AddProcesses adds the "processes" edges to the Process entity.

func (*FileUpdate) ClearProcesses added in v0.11.8

func (fu *FileUpdate) ClearProcesses() *FileUpdate

ClearProcesses clears all "processes" edges to the Process entity.

func (*FileUpdate) Exec added in v0.11.8

func (fu *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecX added in v0.11.8

func (fu *FileUpdate) ExecX(ctx context.Context)

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

func (*FileUpdate) Mutation added in v0.11.8

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) RemoveProcessIDs added in v0.11.8

func (fu *FileUpdate) RemoveProcessIDs(ids ...int) *FileUpdate

RemoveProcessIDs removes the "processes" edge to Process entities by IDs.

func (*FileUpdate) RemoveProcesses added in v0.11.8

func (fu *FileUpdate) RemoveProcesses(p ...*Process) *FileUpdate

RemoveProcesses removes "processes" edges to Process entities.

func (*FileUpdate) Save added in v0.11.8

func (fu *FileUpdate) Save(ctx context.Context) (int, error)

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

func (*FileUpdate) SaveX added in v0.11.8

func (fu *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) SetName added in v0.11.8

func (fu *FileUpdate) SetName(s string) *FileUpdate

SetName sets the "name" field.

func (*FileUpdate) Where added in v0.11.8

func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne added in v0.11.8

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

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) AddProcessIDs added in v0.11.8

func (fuo *FileUpdateOne) AddProcessIDs(ids ...int) *FileUpdateOne

AddProcessIDs adds the "processes" edge to the Process entity by IDs.

func (*FileUpdateOne) AddProcesses added in v0.11.8

func (fuo *FileUpdateOne) AddProcesses(p ...*Process) *FileUpdateOne

AddProcesses adds the "processes" edges to the Process entity.

func (*FileUpdateOne) ClearProcesses added in v0.11.8

func (fuo *FileUpdateOne) ClearProcesses() *FileUpdateOne

ClearProcesses clears all "processes" edges to the Process entity.

func (*FileUpdateOne) Exec added in v0.11.8

func (fuo *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecX added in v0.11.8

func (fuo *FileUpdateOne) ExecX(ctx context.Context)

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

func (*FileUpdateOne) Mutation added in v0.11.8

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) RemoveProcessIDs added in v0.11.8

func (fuo *FileUpdateOne) RemoveProcessIDs(ids ...int) *FileUpdateOne

RemoveProcessIDs removes the "processes" edge to Process entities by IDs.

func (*FileUpdateOne) RemoveProcesses added in v0.11.8

func (fuo *FileUpdateOne) RemoveProcesses(p ...*Process) *FileUpdateOne

RemoveProcesses removes "processes" edges to Process entities.

func (*FileUpdateOne) Save added in v0.11.8

func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX added in v0.11.8

func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File

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

func (*FileUpdateOne) Select added in v0.11.8

func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

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

func (*FileUpdateOne) SetName added in v0.11.8

func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne

SetName sets the "name" field.

func (*FileUpdateOne) Where added in v0.11.8

func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type FileUpsert added in v0.11.8

type FileUpsert struct {
	*sql.UpdateSet
}

FileUpsert is the "OnConflict" setter.

func (*FileUpsert) SetName added in v0.11.8

func (u *FileUpsert) SetName(v string) *FileUpsert

SetName sets the "name" field.

func (*FileUpsert) UpdateName added in v0.11.8

func (u *FileUpsert) UpdateName() *FileUpsert

UpdateName sets the "name" field to the value that was provided on create.

type FileUpsertBulk added in v0.11.8

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

FileUpsertBulk is the builder for "upsert"-ing a bulk of File nodes.

func (*FileUpsertBulk) DoNothing added in v0.11.8

func (u *FileUpsertBulk) DoNothing() *FileUpsertBulk

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

func (*FileUpsertBulk) Exec added in v0.11.8

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

Exec executes the query.

func (*FileUpsertBulk) ExecX added in v0.11.8

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

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

func (*FileUpsertBulk) Ignore added in v0.11.8

func (u *FileUpsertBulk) Ignore() *FileUpsertBulk

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

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

func (*FileUpsertBulk) SetName added in v0.11.8

func (u *FileUpsertBulk) SetName(v string) *FileUpsertBulk

SetName sets the "name" field.

func (*FileUpsertBulk) Update added in v0.11.8

func (u *FileUpsertBulk) Update(set func(*FileUpsert)) *FileUpsertBulk

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

func (*FileUpsertBulk) UpdateName added in v0.11.8

func (u *FileUpsertBulk) UpdateName() *FileUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateNewValues added in v0.11.8

func (u *FileUpsertBulk) UpdateNewValues() *FileUpsertBulk

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

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

type FileUpsertOne added in v0.11.8

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

FileUpsertOne is the builder for "upsert"-ing

one File node.

func (*FileUpsertOne) DoNothing added in v0.11.8

func (u *FileUpsertOne) DoNothing() *FileUpsertOne

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

func (*FileUpsertOne) Exec added in v0.11.8

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

Exec executes the query.

func (*FileUpsertOne) ExecX added in v0.11.8

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

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

func (*FileUpsertOne) ID added in v0.11.8

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

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

func (*FileUpsertOne) IDX added in v0.11.8

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

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

func (*FileUpsertOne) Ignore added in v0.11.8

func (u *FileUpsertOne) Ignore() *FileUpsertOne

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

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

func (*FileUpsertOne) SetName added in v0.11.8

func (u *FileUpsertOne) SetName(v string) *FileUpsertOne

SetName sets the "name" field.

func (*FileUpsertOne) Update added in v0.11.8

func (u *FileUpsertOne) Update(set func(*FileUpsert)) *FileUpsertOne

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

func (*FileUpsertOne) UpdateName added in v0.11.8

func (u *FileUpsertOne) UpdateName() *FileUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*FileUpsertOne) UpdateNewValues added in v0.11.8

func (u *FileUpsertOne) UpdateNewValues() *FileUpsertOne

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

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

type Files added in v0.11.8

type Files []*File

Files is a parsable slice of File.

type Friendship

type Friendship struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Weight holds the value of the "weight" field.
	Weight int `json:"weight,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// FriendID holds the value of the "friend_id" field.
	FriendID int `json:"friend_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FriendshipQuery when eager-loading is set.
	Edges FriendshipEdges `json:"edges"`
	// contains filtered or unexported fields
}

Friendship is the model entity for the Friendship schema.

func (*Friendship) QueryFriend

func (f *Friendship) QueryFriend() *UserQuery

QueryFriend queries the "friend" edge of the Friendship entity.

func (*Friendship) QueryUser

func (f *Friendship) QueryUser() *UserQuery

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

func (*Friendship) String

func (f *Friendship) String() string

String implements the fmt.Stringer.

func (*Friendship) Unwrap

func (f *Friendship) Unwrap() *Friendship

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

func (f *Friendship) Update() *FriendshipUpdateOne

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

type FriendshipClient

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

FriendshipClient is a client for the Friendship schema.

func NewFriendshipClient

func NewFriendshipClient(c config) *FriendshipClient

NewFriendshipClient returns a client for the Friendship from the given config.

func (*FriendshipClient) Create

func (c *FriendshipClient) Create() *FriendshipCreate

Create returns a builder for creating a Friendship entity.

func (*FriendshipClient) CreateBulk

func (c *FriendshipClient) CreateBulk(builders ...*FriendshipCreate) *FriendshipCreateBulk

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

func (*FriendshipClient) Delete

func (c *FriendshipClient) Delete() *FriendshipDelete

Delete returns a delete builder for Friendship.

func (*FriendshipClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FriendshipClient) DeleteOneID

func (c *FriendshipClient) DeleteOneID(id int) *FriendshipDeleteOne

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

func (*FriendshipClient) Get

func (c *FriendshipClient) Get(ctx context.Context, id int) (*Friendship, error)

Get returns a Friendship entity by its id.

func (*FriendshipClient) GetX

func (c *FriendshipClient) GetX(ctx context.Context, id int) *Friendship

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

func (*FriendshipClient) Hooks

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

Hooks returns the client hooks.

func (*FriendshipClient) Intercept added in v0.11.5

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

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

func (*FriendshipClient) Interceptors added in v0.11.5

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

Interceptors returns the client interceptors.

func (*FriendshipClient) Query

func (c *FriendshipClient) Query() *FriendshipQuery

Query returns a query builder for Friendship.

func (*FriendshipClient) QueryFriend

func (c *FriendshipClient) QueryFriend(f *Friendship) *UserQuery

QueryFriend queries the friend edge of a Friendship.

func (*FriendshipClient) QueryUser

func (c *FriendshipClient) QueryUser(f *Friendship) *UserQuery

QueryUser queries the user edge of a Friendship.

func (*FriendshipClient) Update

func (c *FriendshipClient) Update() *FriendshipUpdate

Update returns an update builder for Friendship.

func (*FriendshipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*FriendshipClient) UpdateOneID

func (c *FriendshipClient) UpdateOneID(id int) *FriendshipUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FriendshipClient) Use

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

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

type FriendshipCreate

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

FriendshipCreate is the builder for creating a Friendship entity.

func (*FriendshipCreate) Exec

func (fc *FriendshipCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendshipCreate) ExecX

func (fc *FriendshipCreate) ExecX(ctx context.Context)

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

func (*FriendshipCreate) Mutation

func (fc *FriendshipCreate) Mutation() *FriendshipMutation

Mutation returns the FriendshipMutation object of the builder.

func (*FriendshipCreate) OnConflict

func (fc *FriendshipCreate) OnConflict(opts ...sql.ConflictOption) *FriendshipUpsertOne

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

client.Friendship.Create().
	SetWeight(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FriendshipUpsert) {
		SetWeight(v+v).
	}).
	Exec(ctx)

func (*FriendshipCreate) OnConflictColumns

func (fc *FriendshipCreate) OnConflictColumns(columns ...string) *FriendshipUpsertOne

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

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

func (*FriendshipCreate) Save

func (fc *FriendshipCreate) Save(ctx context.Context) (*Friendship, error)

Save creates the Friendship in the database.

func (*FriendshipCreate) SaveX

func (fc *FriendshipCreate) SaveX(ctx context.Context) *Friendship

SaveX calls Save and panics if Save returns an error.

func (*FriendshipCreate) SetCreatedAt

func (fc *FriendshipCreate) SetCreatedAt(t time.Time) *FriendshipCreate

SetCreatedAt sets the "created_at" field.

func (*FriendshipCreate) SetFriend

func (fc *FriendshipCreate) SetFriend(u *User) *FriendshipCreate

SetFriend sets the "friend" edge to the User entity.

func (*FriendshipCreate) SetFriendID

func (fc *FriendshipCreate) SetFriendID(i int) *FriendshipCreate

SetFriendID sets the "friend_id" field.

func (*FriendshipCreate) SetNillableCreatedAt

func (fc *FriendshipCreate) SetNillableCreatedAt(t *time.Time) *FriendshipCreate

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

func (*FriendshipCreate) SetNillableWeight

func (fc *FriendshipCreate) SetNillableWeight(i *int) *FriendshipCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*FriendshipCreate) SetUser

func (fc *FriendshipCreate) SetUser(u *User) *FriendshipCreate

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

func (*FriendshipCreate) SetUserID

func (fc *FriendshipCreate) SetUserID(i int) *FriendshipCreate

SetUserID sets the "user_id" field.

func (*FriendshipCreate) SetWeight

func (fc *FriendshipCreate) SetWeight(i int) *FriendshipCreate

SetWeight sets the "weight" field.

type FriendshipCreateBulk

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

FriendshipCreateBulk is the builder for creating many Friendship entities in bulk.

func (*FriendshipCreateBulk) Exec

func (fcb *FriendshipCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendshipCreateBulk) ExecX

func (fcb *FriendshipCreateBulk) ExecX(ctx context.Context)

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

func (*FriendshipCreateBulk) OnConflict

func (fcb *FriendshipCreateBulk) OnConflict(opts ...sql.ConflictOption) *FriendshipUpsertBulk

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

client.Friendship.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FriendshipUpsert) {
		SetWeight(v+v).
	}).
	Exec(ctx)

func (*FriendshipCreateBulk) OnConflictColumns

func (fcb *FriendshipCreateBulk) OnConflictColumns(columns ...string) *FriendshipUpsertBulk

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

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

func (*FriendshipCreateBulk) Save

func (fcb *FriendshipCreateBulk) Save(ctx context.Context) ([]*Friendship, error)

Save creates the Friendship entities in the database.

func (*FriendshipCreateBulk) SaveX

func (fcb *FriendshipCreateBulk) SaveX(ctx context.Context) []*Friendship

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

type FriendshipDelete

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

FriendshipDelete is the builder for deleting a Friendship entity.

func (*FriendshipDelete) Exec

func (fd *FriendshipDelete) Exec(ctx context.Context) (int, error)

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

func (*FriendshipDelete) ExecX

func (fd *FriendshipDelete) ExecX(ctx context.Context) int

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

func (*FriendshipDelete) Where

Where appends a list predicates to the FriendshipDelete builder.

type FriendshipDeleteOne

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

FriendshipDeleteOne is the builder for deleting a single Friendship entity.

func (*FriendshipDeleteOne) Exec

func (fdo *FriendshipDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FriendshipDeleteOne) ExecX

func (fdo *FriendshipDeleteOne) ExecX(ctx context.Context)

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

func (*FriendshipDeleteOne) Where added in v0.11.7

Where appends a list predicates to the FriendshipDelete builder.

type FriendshipEdges

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

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

func (FriendshipEdges) FriendOrErr

func (e FriendshipEdges) FriendOrErr() (*User, error)

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

func (FriendshipEdges) UserOrErr

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

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

type FriendshipFilter added in v0.11.2

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

FriendshipFilter provides a generic filtering capability at runtime for FriendshipQuery.

func (*FriendshipFilter) Where added in v0.11.2

func (f *FriendshipFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*FriendshipFilter) WhereCreatedAt added in v0.11.2

func (f *FriendshipFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*FriendshipFilter) WhereFriendID added in v0.11.2

func (f *FriendshipFilter) WhereFriendID(p entql.IntP)

WhereFriendID applies the entql int predicate on the friend_id field.

func (*FriendshipFilter) WhereHasFriend added in v0.11.2

func (f *FriendshipFilter) WhereHasFriend()

WhereHasFriend applies a predicate to check if query has an edge friend.

func (*FriendshipFilter) WhereHasFriendWith added in v0.11.2

func (f *FriendshipFilter) WhereHasFriendWith(preds ...predicate.User)

WhereHasFriendWith applies a predicate to check if query has an edge friend with a given conditions (other predicates).

func (*FriendshipFilter) WhereHasUser added in v0.11.2

func (f *FriendshipFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*FriendshipFilter) WhereHasUserWith added in v0.11.2

func (f *FriendshipFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*FriendshipFilter) WhereID added in v0.11.2

func (f *FriendshipFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*FriendshipFilter) WhereUserID added in v0.11.2

func (f *FriendshipFilter) WhereUserID(p entql.IntP)

WhereUserID applies the entql int predicate on the user_id field.

func (*FriendshipFilter) WhereWeight added in v0.11.2

func (f *FriendshipFilter) WhereWeight(p entql.IntP)

WhereWeight applies the entql int predicate on the weight field.

type FriendshipGroupBy

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

FriendshipGroupBy is the group-by builder for Friendship entities.

func (*FriendshipGroupBy) Aggregate

func (fgb *FriendshipGroupBy) Aggregate(fns ...AggregateFunc) *FriendshipGroupBy

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

func (*FriendshipGroupBy) Bool

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

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

func (*FriendshipGroupBy) BoolX

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

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

func (*FriendshipGroupBy) Bools

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

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

func (*FriendshipGroupBy) BoolsX

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

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

func (*FriendshipGroupBy) Float64

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

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

func (*FriendshipGroupBy) Float64X

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

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

func (*FriendshipGroupBy) Float64s

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

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

func (*FriendshipGroupBy) Float64sX

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

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

func (*FriendshipGroupBy) Int

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

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

func (*FriendshipGroupBy) IntX

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

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

func (*FriendshipGroupBy) Ints

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

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

func (*FriendshipGroupBy) IntsX

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

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

func (*FriendshipGroupBy) Scan

func (fgb *FriendshipGroupBy) Scan(ctx context.Context, v any) error

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

func (*FriendshipGroupBy) ScanX

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

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

func (*FriendshipGroupBy) String

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

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

func (*FriendshipGroupBy) StringX

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

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

func (*FriendshipGroupBy) Strings

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

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

func (*FriendshipGroupBy) StringsX

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

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

type FriendshipMutation

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

FriendshipMutation represents an operation that mutates the Friendship nodes in the graph.

func (*FriendshipMutation) AddField

func (m *FriendshipMutation) 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 (*FriendshipMutation) AddWeight

func (m *FriendshipMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*FriendshipMutation) AddedEdges

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

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

func (*FriendshipMutation) AddedField

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

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

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

func (*FriendshipMutation) AddedIDs

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

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

func (*FriendshipMutation) AddedWeight

func (m *FriendshipMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*FriendshipMutation) ClearEdge

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

func (m *FriendshipMutation) 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 (*FriendshipMutation) ClearFriend

func (m *FriendshipMutation) ClearFriend()

ClearFriend clears the "friend" edge to the User entity.

func (*FriendshipMutation) ClearUser

func (m *FriendshipMutation) ClearUser()

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

func (*FriendshipMutation) ClearedEdges

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

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

func (*FriendshipMutation) ClearedFields

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

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

func (FriendshipMutation) Client

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

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

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

func (*FriendshipMutation) EdgeCleared

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

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

func (*FriendshipMutation) Field

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

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

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

func (*FriendshipMutation) Fields

func (m *FriendshipMutation) 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 (*FriendshipMutation) Filter added in v0.11.2

func (m *FriendshipMutation) Filter() *FriendshipFilter

Filter returns an entql.Where implementation to apply filters on the FriendshipMutation builder.

func (*FriendshipMutation) FriendCleared

func (m *FriendshipMutation) FriendCleared() bool

FriendCleared reports if the "friend" edge to the User entity was cleared.

func (*FriendshipMutation) FriendID

func (m *FriendshipMutation) FriendID() (r int, exists bool)

FriendID returns the value of the "friend_id" field in the mutation.

func (*FriendshipMutation) FriendIDs

func (m *FriendshipMutation) FriendIDs() (ids []int)

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

func (*FriendshipMutation) ID

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

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

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

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

func (m *FriendshipMutation) 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 (*FriendshipMutation) OldFriendID

func (m *FriendshipMutation) OldFriendID(ctx context.Context) (v int, err error)

OldFriendID returns the old "friend_id" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) OldUserID

func (m *FriendshipMutation) OldUserID(ctx context.Context) (v int, err error)

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

func (m *FriendshipMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) Op

func (m *FriendshipMutation) Op() Op

Op returns the operation name.

func (*FriendshipMutation) RemovedEdges

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

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

func (*FriendshipMutation) RemovedIDs

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

func (m *FriendshipMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FriendshipMutation) ResetEdge

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

func (m *FriendshipMutation) 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 (*FriendshipMutation) ResetFriend

func (m *FriendshipMutation) ResetFriend()

ResetFriend resets all changes to the "friend" edge.

func (*FriendshipMutation) ResetFriendID

func (m *FriendshipMutation) ResetFriendID()

ResetFriendID resets all changes to the "friend_id" field.

func (*FriendshipMutation) ResetUser

func (m *FriendshipMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*FriendshipMutation) ResetUserID

func (m *FriendshipMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*FriendshipMutation) ResetWeight

func (m *FriendshipMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*FriendshipMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FriendshipMutation) SetField

func (m *FriendshipMutation) 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 (*FriendshipMutation) SetFriendID

func (m *FriendshipMutation) SetFriendID(i int)

SetFriendID sets the "friend_id" field.

func (*FriendshipMutation) SetOp added in v0.11.5

func (m *FriendshipMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FriendshipMutation) SetUserID

func (m *FriendshipMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*FriendshipMutation) SetWeight

func (m *FriendshipMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (FriendshipMutation) Tx

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

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

func (*FriendshipMutation) Type

func (m *FriendshipMutation) Type() string

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

func (*FriendshipMutation) UserCleared

func (m *FriendshipMutation) UserCleared() bool

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

func (*FriendshipMutation) UserID

func (m *FriendshipMutation) UserID() (r int, exists bool)

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

func (*FriendshipMutation) UserIDs

func (m *FriendshipMutation) UserIDs() (ids []int)

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

func (*FriendshipMutation) Weight

func (m *FriendshipMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*FriendshipMutation) Where

func (m *FriendshipMutation) Where(ps ...predicate.Friendship)

Where appends a list predicates to the FriendshipMutation builder.

func (*FriendshipMutation) WhereP added in v0.11.5

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

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

type FriendshipQuery

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

FriendshipQuery is the builder for querying Friendship entities.

func (*FriendshipQuery) Aggregate added in v0.11.4

func (fq *FriendshipQuery) Aggregate(fns ...AggregateFunc) *FriendshipSelect

Aggregate returns a FriendshipSelect configured with the given aggregations.

func (*FriendshipQuery) All

func (fq *FriendshipQuery) All(ctx context.Context) ([]*Friendship, error)

All executes the query and returns a list of Friendships.

func (*FriendshipQuery) AllX

func (fq *FriendshipQuery) AllX(ctx context.Context) []*Friendship

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

func (*FriendshipQuery) Clone

func (fq *FriendshipQuery) Clone() *FriendshipQuery

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

func (*FriendshipQuery) Count

func (fq *FriendshipQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FriendshipQuery) CountX

func (fq *FriendshipQuery) CountX(ctx context.Context) int

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

func (*FriendshipQuery) Exist

func (fq *FriendshipQuery) Exist(ctx context.Context) (bool, error)

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

func (*FriendshipQuery) ExistX

func (fq *FriendshipQuery) ExistX(ctx context.Context) bool

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

func (*FriendshipQuery) Filter added in v0.11.2

func (fq *FriendshipQuery) Filter() *FriendshipFilter

Filter returns a Filter implementation to apply filters on the FriendshipQuery builder.

func (*FriendshipQuery) First

func (fq *FriendshipQuery) First(ctx context.Context) (*Friendship, error)

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

func (*FriendshipQuery) FirstID

func (fq *FriendshipQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FriendshipQuery) FirstIDX

func (fq *FriendshipQuery) FirstIDX(ctx context.Context) int

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

func (*FriendshipQuery) FirstX

func (fq *FriendshipQuery) FirstX(ctx context.Context) *Friendship

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

func (*FriendshipQuery) GroupBy

func (fq *FriendshipQuery) GroupBy(field string, fields ...string) *FriendshipGroupBy

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

client.Friendship.Query().
	GroupBy(friendship.FieldWeight).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FriendshipQuery) IDs

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

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

func (*FriendshipQuery) IDsX

func (fq *FriendshipQuery) IDsX(ctx context.Context) []int

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

func (*FriendshipQuery) Limit

func (fq *FriendshipQuery) Limit(limit int) *FriendshipQuery

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

func (*FriendshipQuery) Offset

func (fq *FriendshipQuery) Offset(offset int) *FriendshipQuery

Offset to start from.

func (*FriendshipQuery) Only

func (fq *FriendshipQuery) Only(ctx context.Context) (*Friendship, error)

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

func (*FriendshipQuery) OnlyID

func (fq *FriendshipQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FriendshipQuery) OnlyIDX

func (fq *FriendshipQuery) OnlyIDX(ctx context.Context) int

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

func (*FriendshipQuery) OnlyX

func (fq *FriendshipQuery) OnlyX(ctx context.Context) *Friendship

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

func (*FriendshipQuery) Order

func (fq *FriendshipQuery) Order(o ...OrderFunc) *FriendshipQuery

Order specifies how the records should be ordered.

func (*FriendshipQuery) QueryFriend

func (fq *FriendshipQuery) QueryFriend() *UserQuery

QueryFriend chains the current query on the "friend" edge.

func (*FriendshipQuery) QueryUser

func (fq *FriendshipQuery) QueryUser() *UserQuery

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

func (*FriendshipQuery) Select

func (fq *FriendshipQuery) Select(fields ...string) *FriendshipSelect

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 {
	Weight int `json:"weight,omitempty"`
}

client.Friendship.Query().
	Select(friendship.FieldWeight).
	Scan(ctx, &v)

func (*FriendshipQuery) Unique

func (fq *FriendshipQuery) Unique(unique bool) *FriendshipQuery

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

Where adds a new predicate for the FriendshipQuery builder.

func (*FriendshipQuery) WithFriend

func (fq *FriendshipQuery) WithFriend(opts ...func(*UserQuery)) *FriendshipQuery

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

func (*FriendshipQuery) WithUser

func (fq *FriendshipQuery) WithUser(opts ...func(*UserQuery)) *FriendshipQuery

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

type FriendshipSelect

type FriendshipSelect struct {
	*FriendshipQuery
	// contains filtered or unexported fields
}

FriendshipSelect is the builder for selecting fields of Friendship entities.

func (*FriendshipSelect) Aggregate added in v0.11.4

func (fs *FriendshipSelect) Aggregate(fns ...AggregateFunc) *FriendshipSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FriendshipSelect) Bool

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

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

func (*FriendshipSelect) BoolX

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

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

func (*FriendshipSelect) Bools

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

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

func (*FriendshipSelect) BoolsX

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

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

func (*FriendshipSelect) Float64

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

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

func (*FriendshipSelect) Float64X

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

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

func (*FriendshipSelect) Float64s

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

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

func (*FriendshipSelect) Float64sX

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

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

func (*FriendshipSelect) Int

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

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

func (*FriendshipSelect) IntX

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

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

func (*FriendshipSelect) Ints

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

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

func (*FriendshipSelect) IntsX

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

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

func (*FriendshipSelect) Scan

func (fs *FriendshipSelect) Scan(ctx context.Context, v any) error

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

func (*FriendshipSelect) ScanX

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

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

func (*FriendshipSelect) String

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

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

func (*FriendshipSelect) StringX

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

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

func (*FriendshipSelect) Strings

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

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

func (*FriendshipSelect) StringsX

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

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

type FriendshipUpdate

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

FriendshipUpdate is the builder for updating Friendship entities.

func (*FriendshipUpdate) AddWeight

func (fu *FriendshipUpdate) AddWeight(i int) *FriendshipUpdate

AddWeight adds i to the "weight" field.

func (*FriendshipUpdate) Exec

func (fu *FriendshipUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendshipUpdate) ExecX

func (fu *FriendshipUpdate) ExecX(ctx context.Context)

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

func (*FriendshipUpdate) Mutation

func (fu *FriendshipUpdate) Mutation() *FriendshipMutation

Mutation returns the FriendshipMutation object of the builder.

func (*FriendshipUpdate) Save

func (fu *FriendshipUpdate) Save(ctx context.Context) (int, error)

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

func (*FriendshipUpdate) SaveX

func (fu *FriendshipUpdate) SaveX(ctx context.Context) int

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

func (*FriendshipUpdate) SetCreatedAt

func (fu *FriendshipUpdate) SetCreatedAt(t time.Time) *FriendshipUpdate

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpdate) SetNillableCreatedAt

func (fu *FriendshipUpdate) SetNillableCreatedAt(t *time.Time) *FriendshipUpdate

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

func (*FriendshipUpdate) SetNillableWeight

func (fu *FriendshipUpdate) SetNillableWeight(i *int) *FriendshipUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*FriendshipUpdate) SetWeight

func (fu *FriendshipUpdate) SetWeight(i int) *FriendshipUpdate

SetWeight sets the "weight" field.

func (*FriendshipUpdate) Where

Where appends a list predicates to the FriendshipUpdate builder.

type FriendshipUpdateOne

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

FriendshipUpdateOne is the builder for updating a single Friendship entity.

func (*FriendshipUpdateOne) AddWeight

func (fuo *FriendshipUpdateOne) AddWeight(i int) *FriendshipUpdateOne

AddWeight adds i to the "weight" field.

func (*FriendshipUpdateOne) Exec

func (fuo *FriendshipUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FriendshipUpdateOne) ExecX

func (fuo *FriendshipUpdateOne) ExecX(ctx context.Context)

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

func (*FriendshipUpdateOne) Mutation

func (fuo *FriendshipUpdateOne) Mutation() *FriendshipMutation

Mutation returns the FriendshipMutation object of the builder.

func (*FriendshipUpdateOne) Save

func (fuo *FriendshipUpdateOne) Save(ctx context.Context) (*Friendship, error)

Save executes the query and returns the updated Friendship entity.

func (*FriendshipUpdateOne) SaveX

func (fuo *FriendshipUpdateOne) SaveX(ctx context.Context) *Friendship

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

func (*FriendshipUpdateOne) Select

func (fuo *FriendshipUpdateOne) Select(field string, fields ...string) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetCreatedAt

func (fuo *FriendshipUpdateOne) SetCreatedAt(t time.Time) *FriendshipUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpdateOne) SetNillableCreatedAt

func (fuo *FriendshipUpdateOne) SetNillableCreatedAt(t *time.Time) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetNillableWeight

func (fuo *FriendshipUpdateOne) SetNillableWeight(i *int) *FriendshipUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*FriendshipUpdateOne) SetWeight

func (fuo *FriendshipUpdateOne) SetWeight(i int) *FriendshipUpdateOne

SetWeight sets the "weight" field.

func (*FriendshipUpdateOne) Where added in v0.11.8

Where appends a list predicates to the FriendshipUpdate builder.

type FriendshipUpsert

type FriendshipUpsert struct {
	*sql.UpdateSet
}

FriendshipUpsert is the "OnConflict" setter.

func (*FriendshipUpsert) AddWeight

func (u *FriendshipUpsert) AddWeight(v int) *FriendshipUpsert

AddWeight adds v to the "weight" field.

func (*FriendshipUpsert) SetCreatedAt

func (u *FriendshipUpsert) SetCreatedAt(v time.Time) *FriendshipUpsert

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpsert) SetWeight

func (u *FriendshipUpsert) SetWeight(v int) *FriendshipUpsert

SetWeight sets the "weight" field.

func (*FriendshipUpsert) UpdateCreatedAt

func (u *FriendshipUpsert) UpdateCreatedAt() *FriendshipUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FriendshipUpsert) UpdateWeight

func (u *FriendshipUpsert) UpdateWeight() *FriendshipUpsert

UpdateWeight sets the "weight" field to the value that was provided on create.

type FriendshipUpsertBulk

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

FriendshipUpsertBulk is the builder for "upsert"-ing a bulk of Friendship nodes.

func (*FriendshipUpsertBulk) AddWeight

AddWeight adds v to the "weight" field.

func (*FriendshipUpsertBulk) DoNothing

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

func (*FriendshipUpsertBulk) Exec

Exec executes the query.

func (*FriendshipUpsertBulk) ExecX

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

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

func (*FriendshipUpsertBulk) Ignore

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

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

func (*FriendshipUpsertBulk) SetCreatedAt

func (u *FriendshipUpsertBulk) SetCreatedAt(v time.Time) *FriendshipUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpsertBulk) SetWeight

SetWeight sets the "weight" field.

func (*FriendshipUpsertBulk) Update

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

func (*FriendshipUpsertBulk) UpdateCreatedAt

func (u *FriendshipUpsertBulk) UpdateCreatedAt() *FriendshipUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FriendshipUpsertBulk) UpdateNewValues

func (u *FriendshipUpsertBulk) UpdateNewValues() *FriendshipUpsertBulk

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

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

func (*FriendshipUpsertBulk) UpdateWeight

func (u *FriendshipUpsertBulk) UpdateWeight() *FriendshipUpsertBulk

UpdateWeight sets the "weight" field to the value that was provided on create.

type FriendshipUpsertOne

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

FriendshipUpsertOne is the builder for "upsert"-ing

one Friendship node.

func (*FriendshipUpsertOne) AddWeight

func (u *FriendshipUpsertOne) AddWeight(v int) *FriendshipUpsertOne

AddWeight adds v to the "weight" field.

func (*FriendshipUpsertOne) DoNothing

func (u *FriendshipUpsertOne) DoNothing() *FriendshipUpsertOne

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

func (*FriendshipUpsertOne) Exec

Exec executes the query.

func (*FriendshipUpsertOne) ExecX

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

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

func (*FriendshipUpsertOne) ID

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

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

func (*FriendshipUpsertOne) IDX

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

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

func (*FriendshipUpsertOne) Ignore

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

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

func (*FriendshipUpsertOne) SetCreatedAt

func (u *FriendshipUpsertOne) SetCreatedAt(v time.Time) *FriendshipUpsertOne

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpsertOne) SetWeight

func (u *FriendshipUpsertOne) SetWeight(v int) *FriendshipUpsertOne

SetWeight sets the "weight" field.

func (*FriendshipUpsertOne) Update

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

func (*FriendshipUpsertOne) UpdateCreatedAt

func (u *FriendshipUpsertOne) UpdateCreatedAt() *FriendshipUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FriendshipUpsertOne) UpdateNewValues

func (u *FriendshipUpsertOne) UpdateNewValues() *FriendshipUpsertOne

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

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

func (*FriendshipUpsertOne) UpdateWeight

func (u *FriendshipUpsertOne) UpdateWeight() *FriendshipUpsertOne

UpdateWeight sets the "weight" field to the value that was provided on create.

type Friendships

type Friendships []*Friendship

Friendships is a parsable slice of Friendship.

type Group

type Group struct {

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

Group is the model entity for the Group schema.

func (*Group) QueryGroupTags added in v0.11.5

func (gr *Group) QueryGroupTags() *GroupTagQuery

QueryGroupTags queries the "group_tags" edge of the Group entity.

func (*Group) QueryJoinedUsers

func (gr *Group) QueryJoinedUsers() *UserGroupQuery

QueryJoinedUsers queries the "joined_users" edge of the Group entity.

func (*Group) QueryTags added in v0.11.5

func (gr *Group) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Group entity.

func (*Group) QueryUsers

func (gr *Group) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Group entity.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

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

func (gr *Group) Update() *GroupUpdateOne

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne

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

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id int) *Group

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Intercept added in v0.11.5

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

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

func (*GroupClient) Interceptors added in v0.11.5

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

Interceptors returns the client interceptors.

func (*GroupClient) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryGroupTags added in v0.11.5

func (c *GroupClient) QueryGroupTags(gr *Group) *GroupTagQuery

QueryGroupTags queries the group_tags edge of a Group.

func (*GroupClient) QueryJoinedUsers

func (c *GroupClient) QueryJoinedUsers(gr *Group) *UserGroupQuery

QueryJoinedUsers queries the joined_users edge of a Group.

func (*GroupClient) QueryTags added in v0.11.5

func (c *GroupClient) QueryTags(gr *Group) *TagQuery

QueryTags queries the tags edge of a Group.

func (*GroupClient) QueryUsers

func (c *GroupClient) QueryUsers(gr *Group) *UserQuery

QueryUsers queries the users edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddGroupTagIDs added in v0.11.5

func (gc *GroupCreate) AddGroupTagIDs(ids ...int) *GroupCreate

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by IDs.

func (*GroupCreate) AddGroupTags added in v0.11.5

func (gc *GroupCreate) AddGroupTags(g ...*GroupTag) *GroupCreate

AddGroupTags adds the "group_tags" edges to the GroupTag entity.

func (*GroupCreate) AddJoinedUserIDs

func (gc *GroupCreate) AddJoinedUserIDs(ids ...int) *GroupCreate

AddJoinedUserIDs adds the "joined_users" edge to the UserGroup entity by IDs.

func (*GroupCreate) AddJoinedUsers

func (gc *GroupCreate) AddJoinedUsers(u ...*UserGroup) *GroupCreate

AddJoinedUsers adds the "joined_users" edges to the UserGroup entity.

func (*GroupCreate) AddTagIDs added in v0.11.5

func (gc *GroupCreate) AddTagIDs(ids ...int) *GroupCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*GroupCreate) AddTags added in v0.11.5

func (gc *GroupCreate) AddTags(t ...*Tag) *GroupCreate

AddTags adds the "tags" edges to the Tag entity.

func (*GroupCreate) AddUserIDs

func (gc *GroupCreate) AddUserIDs(ids ...int) *GroupCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupCreate) AddUsers

func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate

AddUsers adds the "users" edges to the User entity.

func (*GroupCreate) Exec

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) OnConflict

func (gc *GroupCreate) OnConflict(opts ...sql.ConflictOption) *GroupUpsertOne

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

client.Group.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GroupUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GroupCreate) OnConflictColumns

func (gc *GroupCreate) OnConflictColumns(columns ...string) *GroupUpsertOne

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

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

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetName

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" field.

func (*GroupCreate) SetNillableName

func (gc *GroupCreate) SetNillableName(s *string) *GroupCreate

SetNillableName sets the "name" field if the given value is not nil.

type GroupCreateBulk

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) OnConflict

func (gcb *GroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUpsertBulk

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

client.Group.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GroupUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GroupCreateBulk) OnConflictColumns

func (gcb *GroupCreateBulk) OnConflictColumns(columns ...string) *GroupUpsertBulk

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

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

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

func (*GroupDeleteOne) Where added in v0.11.7

func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne

Where appends a list predicates to the GroupDelete builder.

type GroupEdges

type GroupEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// JoinedUsers holds the value of the joined_users edge.
	JoinedUsers []*UserGroup `json:"joined_users,omitempty"`
	// GroupTags holds the value of the group_tags edge.
	GroupTags []*GroupTag `json:"group_tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroupEdges) GroupTagsOrErr added in v0.11.5

func (e GroupEdges) GroupTagsOrErr() ([]*GroupTag, error)

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

func (GroupEdges) JoinedUsersOrErr

func (e GroupEdges) JoinedUsersOrErr() ([]*UserGroup, error)

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

func (GroupEdges) TagsOrErr added in v0.11.5

func (e GroupEdges) TagsOrErr() ([]*Tag, error)

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

func (GroupEdges) UsersOrErr

func (e GroupEdges) UsersOrErr() ([]*User, error)

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

type GroupFilter added in v0.11.2

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

GroupFilter provides a generic filtering capability at runtime for GroupQuery.

func (*GroupFilter) Where added in v0.11.2

func (f *GroupFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*GroupFilter) WhereHasGroupTags added in v0.11.5

func (f *GroupFilter) WhereHasGroupTags()

WhereHasGroupTags applies a predicate to check if query has an edge group_tags.

func (*GroupFilter) WhereHasGroupTagsWith added in v0.11.5

func (f *GroupFilter) WhereHasGroupTagsWith(preds ...predicate.GroupTag)

WhereHasGroupTagsWith applies a predicate to check if query has an edge group_tags with a given conditions (other predicates).

func (*GroupFilter) WhereHasJoinedUsers added in v0.11.2

func (f *GroupFilter) WhereHasJoinedUsers()

WhereHasJoinedUsers applies a predicate to check if query has an edge joined_users.

func (*GroupFilter) WhereHasJoinedUsersWith added in v0.11.2

func (f *GroupFilter) WhereHasJoinedUsersWith(preds ...predicate.UserGroup)

WhereHasJoinedUsersWith applies a predicate to check if query has an edge joined_users with a given conditions (other predicates).

func (*GroupFilter) WhereHasTags added in v0.11.5

func (f *GroupFilter) WhereHasTags()

WhereHasTags applies a predicate to check if query has an edge tags.

func (*GroupFilter) WhereHasTagsWith added in v0.11.5

func (f *GroupFilter) WhereHasTagsWith(preds ...predicate.Tag)

WhereHasTagsWith applies a predicate to check if query has an edge tags with a given conditions (other predicates).

func (*GroupFilter) WhereHasUsers added in v0.11.2

func (f *GroupFilter) WhereHasUsers()

WhereHasUsers applies a predicate to check if query has an edge users.

func (*GroupFilter) WhereHasUsersWith added in v0.11.2

func (f *GroupFilter) WhereHasUsersWith(preds ...predicate.User)

WhereHasUsersWith applies a predicate to check if query has an edge users with a given conditions (other predicates).

func (*GroupFilter) WhereID added in v0.11.2

func (f *GroupFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*GroupFilter) WhereName added in v0.11.2

func (f *GroupFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

type GroupGroupBy

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool

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

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

func (*GroupGroupBy) BoolX

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

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

func (*GroupGroupBy) Bools

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

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

func (*GroupGroupBy) BoolsX

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

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

func (*GroupGroupBy) Float64

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

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

func (*GroupGroupBy) Float64X

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

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

func (*GroupGroupBy) Float64s

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

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

func (*GroupGroupBy) Float64sX

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

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

func (*GroupGroupBy) Int

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

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

func (*GroupGroupBy) IntX

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

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

func (*GroupGroupBy) Ints

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

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

func (*GroupGroupBy) IntsX

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

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

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroupGroupBy) ScanX

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

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

func (*GroupGroupBy) String

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

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

func (*GroupGroupBy) StringX

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

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

func (*GroupGroupBy) Strings

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

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

func (*GroupGroupBy) StringsX

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

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

type GroupMutation

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddField

func (m *GroupMutation) 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 (*GroupMutation) AddGroupTagIDs added in v0.11.5

func (m *GroupMutation) AddGroupTagIDs(ids ...int)

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by ids.

func (*GroupMutation) AddJoinedUserIDs

func (m *GroupMutation) AddJoinedUserIDs(ids ...int)

AddJoinedUserIDs adds the "joined_users" edge to the UserGroup entity by ids.

func (*GroupMutation) AddTagIDs added in v0.11.5

func (m *GroupMutation) AddTagIDs(ids ...int)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*GroupMutation) AddUserIDs

func (m *GroupMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*GroupMutation) AddedEdges

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

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

func (*GroupMutation) AddedField

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

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

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

func (*GroupMutation) AddedIDs

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

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

func (*GroupMutation) ClearEdge

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

func (m *GroupMutation) 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 (*GroupMutation) ClearGroupTags added in v0.11.5

func (m *GroupMutation) ClearGroupTags()

ClearGroupTags clears the "group_tags" edge to the GroupTag entity.

func (*GroupMutation) ClearJoinedUsers

func (m *GroupMutation) ClearJoinedUsers()

ClearJoinedUsers clears the "joined_users" edge to the UserGroup entity.

func (*GroupMutation) ClearTags added in v0.11.5

func (m *GroupMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*GroupMutation) ClearUsers

func (m *GroupMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*GroupMutation) ClearedEdges

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

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

func (*GroupMutation) ClearedFields

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

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

func (GroupMutation) Client

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

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

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

func (*GroupMutation) Field

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

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

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

func (*GroupMutation) Fields

func (m *GroupMutation) 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 (*GroupMutation) Filter added in v0.11.2

func (m *GroupMutation) Filter() *GroupFilter

Filter returns an entql.Where implementation to apply filters on the GroupMutation builder.

func (*GroupMutation) GroupTagsCleared added in v0.11.5

func (m *GroupMutation) GroupTagsCleared() bool

GroupTagsCleared reports if the "group_tags" edge to the GroupTag entity was cleared.

func (*GroupMutation) GroupTagsIDs added in v0.11.5

func (m *GroupMutation) GroupTagsIDs() (ids []int)

GroupTagsIDs returns the "group_tags" edge IDs in the mutation.

func (*GroupMutation) ID

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

func (m *GroupMutation) 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 (*GroupMutation) JoinedUsersCleared

func (m *GroupMutation) JoinedUsersCleared() bool

JoinedUsersCleared reports if the "joined_users" edge to the UserGroup entity was cleared.

func (*GroupMutation) JoinedUsersIDs

func (m *GroupMutation) JoinedUsersIDs() (ids []int)

JoinedUsersIDs returns the "joined_users" edge IDs in the mutation.

func (*GroupMutation) Name

func (m *GroupMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroupMutation) OldField

func (m *GroupMutation) 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 (*GroupMutation) OldName

func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Group entity. If the Group 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 (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveGroupTagIDs added in v0.11.5

func (m *GroupMutation) RemoveGroupTagIDs(ids ...int)

RemoveGroupTagIDs removes the "group_tags" edge to the GroupTag entity by IDs.

func (*GroupMutation) RemoveJoinedUserIDs

func (m *GroupMutation) RemoveJoinedUserIDs(ids ...int)

RemoveJoinedUserIDs removes the "joined_users" edge to the UserGroup entity by IDs.

func (*GroupMutation) RemoveTagIDs added in v0.11.5

func (m *GroupMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*GroupMutation) RemoveUserIDs

func (m *GroupMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*GroupMutation) RemovedEdges

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

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

func (*GroupMutation) RemovedGroupTagsIDs added in v0.11.5

func (m *GroupMutation) RemovedGroupTagsIDs() (ids []int)

RemovedGroupTags returns the removed IDs of the "group_tags" edge to the GroupTag entity.

func (*GroupMutation) RemovedIDs

func (m *GroupMutation) 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 (*GroupMutation) RemovedJoinedUsersIDs

func (m *GroupMutation) RemovedJoinedUsersIDs() (ids []int)

RemovedJoinedUsers returns the removed IDs of the "joined_users" edge to the UserGroup entity.

func (*GroupMutation) RemovedTagsIDs added in v0.11.5

func (m *GroupMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*GroupMutation) RemovedUsersIDs

func (m *GroupMutation) RemovedUsersIDs() (ids []int)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*GroupMutation) ResetEdge

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

func (m *GroupMutation) 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 (*GroupMutation) ResetGroupTags added in v0.11.5

func (m *GroupMutation) ResetGroupTags()

ResetGroupTags resets all changes to the "group_tags" edge.

func (*GroupMutation) ResetJoinedUsers

func (m *GroupMutation) ResetJoinedUsers()

ResetJoinedUsers resets all changes to the "joined_users" edge.

func (*GroupMutation) ResetName

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetTags added in v0.11.5

func (m *GroupMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*GroupMutation) SetField

func (m *GroupMutation) 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 (*GroupMutation) SetName

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetOp added in v0.11.5

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMutation) TagsCleared added in v0.11.5

func (m *GroupMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*GroupMutation) TagsIDs added in v0.11.5

func (m *GroupMutation) TagsIDs() (ids []int)

TagsIDs returns the "tags" edge IDs in the mutation.

func (GroupMutation) Tx

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

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

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UsersCleared

func (m *GroupMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*GroupMutation) UsersIDs

func (m *GroupMutation) UsersIDs() (ids []int)

UsersIDs returns the "users" edge IDs in the mutation.

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP added in v0.11.5

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

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

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) Aggregate added in v0.11.4

func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate returns a GroupSelect configured with the given aggregations.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

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

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

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

func (*GroupQuery) Filter added in v0.11.2

func (gq *GroupQuery) Filter() *GroupFilter

Filter returns a Filter implementation to apply filters on the GroupQuery builder.

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

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

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) int

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

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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

client.Group.Query().
	GroupBy(group.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

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

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

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []int

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

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

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

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset to start from.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

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

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) int

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

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery

Order specifies how the records should be ordered.

func (*GroupQuery) QueryGroupTags added in v0.11.5

func (gq *GroupQuery) QueryGroupTags() *GroupTagQuery

QueryGroupTags chains the current query on the "group_tags" edge.

func (*GroupQuery) QueryJoinedUsers

func (gq *GroupQuery) QueryJoinedUsers() *UserGroupQuery

QueryJoinedUsers chains the current query on the "joined_users" edge.

func (*GroupQuery) QueryTags added in v0.11.5

func (gq *GroupQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*GroupQuery) QueryUsers

func (gq *GroupQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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

client.Group.Query().
	Select(group.FieldName).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithGroupTags added in v0.11.5

func (gq *GroupQuery) WithGroupTags(opts ...func(*GroupTagQuery)) *GroupQuery

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

func (*GroupQuery) WithJoinedUsers

func (gq *GroupQuery) WithJoinedUsers(opts ...func(*UserGroupQuery)) *GroupQuery

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

func (*GroupQuery) WithTags added in v0.11.5

func (gq *GroupQuery) WithTags(opts ...func(*TagQuery)) *GroupQuery

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

func (*GroupQuery) WithUsers

func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery

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

type GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Aggregate added in v0.11.4

func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupSelect) Bool

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

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

func (*GroupSelect) BoolX

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

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

func (*GroupSelect) Bools

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

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

func (*GroupSelect) BoolsX

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

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

func (*GroupSelect) Float64

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

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

func (*GroupSelect) Float64X

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

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

func (*GroupSelect) Float64s

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

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

func (*GroupSelect) Float64sX

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

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

func (*GroupSelect) Int

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

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

func (*GroupSelect) IntX

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

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

func (*GroupSelect) Ints

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

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

func (*GroupSelect) IntsX

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

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

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v any) error

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

func (*GroupSelect) ScanX

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

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

func (*GroupSelect) String

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

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

func (*GroupSelect) StringX

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

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

func (*GroupSelect) Strings

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

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

func (*GroupSelect) StringsX

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

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

type GroupTag added in v0.11.5

type GroupTag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TagID holds the value of the "tag_id" field.
	TagID int `json:"tag_id,omitempty"`
	// GroupID holds the value of the "group_id" field.
	GroupID int `json:"group_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupTagQuery when eager-loading is set.
	Edges GroupTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroupTag is the model entity for the GroupTag schema.

func (*GroupTag) QueryGroup added in v0.11.5

func (gt *GroupTag) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the GroupTag entity.

func (*GroupTag) QueryTag added in v0.11.5

func (gt *GroupTag) QueryTag() *TagQuery

QueryTag queries the "tag" edge of the GroupTag entity.

func (*GroupTag) String added in v0.11.5

func (gt *GroupTag) String() string

String implements the fmt.Stringer.

func (*GroupTag) Unwrap added in v0.11.5

func (gt *GroupTag) Unwrap() *GroupTag

Unwrap unwraps the GroupTag 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 (*GroupTag) Update added in v0.11.5

func (gt *GroupTag) Update() *GroupTagUpdateOne

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

type GroupTagClient added in v0.11.5

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

GroupTagClient is a client for the GroupTag schema.

func NewGroupTagClient added in v0.11.5

func NewGroupTagClient(c config) *GroupTagClient

NewGroupTagClient returns a client for the GroupTag from the given config.

func (*GroupTagClient) Create added in v0.11.5

func (c *GroupTagClient) Create() *GroupTagCreate

Create returns a builder for creating a GroupTag entity.

func (*GroupTagClient) CreateBulk added in v0.11.5

func (c *GroupTagClient) CreateBulk(builders ...*GroupTagCreate) *GroupTagCreateBulk

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

func (*GroupTagClient) Delete added in v0.11.5

func (c *GroupTagClient) Delete() *GroupTagDelete

Delete returns a delete builder for GroupTag.

func (*GroupTagClient) DeleteOne added in v0.11.5

func (c *GroupTagClient) DeleteOne(gt *GroupTag) *GroupTagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupTagClient) DeleteOneID added in v0.11.5

func (c *GroupTagClient) DeleteOneID(id int) *GroupTagDeleteOne

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

func (*GroupTagClient) Get added in v0.11.5

func (c *GroupTagClient) Get(ctx context.Context, id int) (*GroupTag, error)

Get returns a GroupTag entity by its id.

func (*GroupTagClient) GetX added in v0.11.5

func (c *GroupTagClient) GetX(ctx context.Context, id int) *GroupTag

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

func (*GroupTagClient) Hooks added in v0.11.5

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

Hooks returns the client hooks.

func (*GroupTagClient) Intercept added in v0.11.5

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

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

func (*GroupTagClient) Interceptors added in v0.11.5

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

Interceptors returns the client interceptors.

func (*GroupTagClient) Query added in v0.11.5

func (c *GroupTagClient) Query() *GroupTagQuery

Query returns a query builder for GroupTag.

func (*GroupTagClient) QueryGroup added in v0.11.5

func (c *GroupTagClient) QueryGroup(gt *GroupTag) *GroupQuery

QueryGroup queries the group edge of a GroupTag.

func (*GroupTagClient) QueryTag added in v0.11.5

func (c *GroupTagClient) QueryTag(gt *GroupTag) *TagQuery

QueryTag queries the tag edge of a GroupTag.

func (*GroupTagClient) Update added in v0.11.5

func (c *GroupTagClient) Update() *GroupTagUpdate

Update returns an update builder for GroupTag.

func (*GroupTagClient) UpdateOne added in v0.11.5

func (c *GroupTagClient) UpdateOne(gt *GroupTag) *GroupTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupTagClient) UpdateOneID added in v0.11.5

func (c *GroupTagClient) UpdateOneID(id int) *GroupTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupTagClient) Use added in v0.11.5

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

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

type GroupTagCreate added in v0.11.5

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

GroupTagCreate is the builder for creating a GroupTag entity.

func (*GroupTagCreate) Exec added in v0.11.5

func (gtc *GroupTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupTagCreate) ExecX added in v0.11.5

func (gtc *GroupTagCreate) ExecX(ctx context.Context)

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

func (*GroupTagCreate) Mutation added in v0.11.5

func (gtc *GroupTagCreate) Mutation() *GroupTagMutation

Mutation returns the GroupTagMutation object of the builder.

func (*GroupTagCreate) OnConflict added in v0.11.5

func (gtc *GroupTagCreate) OnConflict(opts ...sql.ConflictOption) *GroupTagUpsertOne

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

client.GroupTag.Create().
	SetTagID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GroupTagUpsert) {
		SetTagID(v+v).
	}).
	Exec(ctx)

func (*GroupTagCreate) OnConflictColumns added in v0.11.5

func (gtc *GroupTagCreate) OnConflictColumns(columns ...string) *GroupTagUpsertOne

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

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

func (*GroupTagCreate) Save added in v0.11.5

func (gtc *GroupTagCreate) Save(ctx context.Context) (*GroupTag, error)

Save creates the GroupTag in the database.

func (*GroupTagCreate) SaveX added in v0.11.5

func (gtc *GroupTagCreate) SaveX(ctx context.Context) *GroupTag

SaveX calls Save and panics if Save returns an error.

func (*GroupTagCreate) SetGroup added in v0.11.5

func (gtc *GroupTagCreate) SetGroup(g *Group) *GroupTagCreate

SetGroup sets the "group" edge to the Group entity.

func (*GroupTagCreate) SetGroupID added in v0.11.5

func (gtc *GroupTagCreate) SetGroupID(i int) *GroupTagCreate

SetGroupID sets the "group_id" field.

func (*GroupTagCreate) SetTag added in v0.11.5

func (gtc *GroupTagCreate) SetTag(t *Tag) *GroupTagCreate

SetTag sets the "tag" edge to the Tag entity.

func (*GroupTagCreate) SetTagID added in v0.11.5

func (gtc *GroupTagCreate) SetTagID(i int) *GroupTagCreate

SetTagID sets the "tag_id" field.

type GroupTagCreateBulk added in v0.11.5

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

GroupTagCreateBulk is the builder for creating many GroupTag entities in bulk.

func (*GroupTagCreateBulk) Exec added in v0.11.5

func (gtcb *GroupTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupTagCreateBulk) ExecX added in v0.11.5

func (gtcb *GroupTagCreateBulk) ExecX(ctx context.Context)

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

func (*GroupTagCreateBulk) OnConflict added in v0.11.5

func (gtcb *GroupTagCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupTagUpsertBulk

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

client.GroupTag.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GroupTagUpsert) {
		SetTagID(v+v).
	}).
	Exec(ctx)

func (*GroupTagCreateBulk) OnConflictColumns added in v0.11.5

func (gtcb *GroupTagCreateBulk) OnConflictColumns(columns ...string) *GroupTagUpsertBulk

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

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

func (*GroupTagCreateBulk) Save added in v0.11.5

func (gtcb *GroupTagCreateBulk) Save(ctx context.Context) ([]*GroupTag, error)

Save creates the GroupTag entities in the database.

func (*GroupTagCreateBulk) SaveX added in v0.11.5

func (gtcb *GroupTagCreateBulk) SaveX(ctx context.Context) []*GroupTag

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

type GroupTagDelete added in v0.11.5

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

GroupTagDelete is the builder for deleting a GroupTag entity.

func (*GroupTagDelete) Exec added in v0.11.5

func (gtd *GroupTagDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupTagDelete) ExecX added in v0.11.5

func (gtd *GroupTagDelete) ExecX(ctx context.Context) int

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

func (*GroupTagDelete) Where added in v0.11.5

func (gtd *GroupTagDelete) Where(ps ...predicate.GroupTag) *GroupTagDelete

Where appends a list predicates to the GroupTagDelete builder.

type GroupTagDeleteOne added in v0.11.5

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

GroupTagDeleteOne is the builder for deleting a single GroupTag entity.

func (*GroupTagDeleteOne) Exec added in v0.11.5

func (gtdo *GroupTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupTagDeleteOne) ExecX added in v0.11.5

func (gtdo *GroupTagDeleteOne) ExecX(ctx context.Context)

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

func (*GroupTagDeleteOne) Where added in v0.11.7

Where appends a list predicates to the GroupTagDelete builder.

type GroupTagEdges added in v0.11.5

type GroupTagEdges struct {
	// Tag holds the value of the tag edge.
	Tag *Tag `json:"tag,omitempty"`
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroupTagEdges) GroupOrErr added in v0.11.5

func (e GroupTagEdges) GroupOrErr() (*Group, error)

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

func (GroupTagEdges) TagOrErr added in v0.11.5

func (e GroupTagEdges) TagOrErr() (*Tag, error)

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

type GroupTagFilter added in v0.11.5

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

GroupTagFilter provides a generic filtering capability at runtime for GroupTagQuery.

func (*GroupTagFilter) Where added in v0.11.5

func (f *GroupTagFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*GroupTagFilter) WhereGroupID added in v0.11.5

func (f *GroupTagFilter) WhereGroupID(p entql.IntP)

WhereGroupID applies the entql int predicate on the group_id field.

func (*GroupTagFilter) WhereHasGroup added in v0.11.5

func (f *GroupTagFilter) WhereHasGroup()

WhereHasGroup applies a predicate to check if query has an edge group.

func (*GroupTagFilter) WhereHasGroupWith added in v0.11.5

func (f *GroupTagFilter) WhereHasGroupWith(preds ...predicate.Group)

WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates).

func (*GroupTagFilter) WhereHasTag added in v0.11.5

func (f *GroupTagFilter) WhereHasTag()

WhereHasTag applies a predicate to check if query has an edge tag.

func (*GroupTagFilter) WhereHasTagWith added in v0.11.5

func (f *GroupTagFilter) WhereHasTagWith(preds ...predicate.Tag)

WhereHasTagWith applies a predicate to check if query has an edge tag with a given conditions (other predicates).

func (*GroupTagFilter) WhereID added in v0.11.5

func (f *GroupTagFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*GroupTagFilter) WhereTagID added in v0.11.5

func (f *GroupTagFilter) WhereTagID(p entql.IntP)

WhereTagID applies the entql int predicate on the tag_id field.

type GroupTagGroupBy added in v0.11.5

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

GroupTagGroupBy is the group-by builder for GroupTag entities.

func (*GroupTagGroupBy) Aggregate added in v0.11.5

func (gtgb *GroupTagGroupBy) Aggregate(fns ...AggregateFunc) *GroupTagGroupBy

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

func (*GroupTagGroupBy) Bool added in v0.11.5

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

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

func (*GroupTagGroupBy) BoolX added in v0.11.5

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

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

func (*GroupTagGroupBy) Bools added in v0.11.5

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

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

func (*GroupTagGroupBy) BoolsX added in v0.11.5

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

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

func (*GroupTagGroupBy) Float64 added in v0.11.5

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

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

func (*GroupTagGroupBy) Float64X added in v0.11.5

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

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

func (*GroupTagGroupBy) Float64s added in v0.11.5

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

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

func (*GroupTagGroupBy) Float64sX added in v0.11.5

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

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

func (*GroupTagGroupBy) Int added in v0.11.5

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

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

func (*GroupTagGroupBy) IntX added in v0.11.5

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

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

func (*GroupTagGroupBy) Ints added in v0.11.5

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

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

func (*GroupTagGroupBy) IntsX added in v0.11.5

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

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

func (*GroupTagGroupBy) Scan added in v0.11.5

func (gtgb *GroupTagGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroupTagGroupBy) ScanX added in v0.11.5

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

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

func (*GroupTagGroupBy) String added in v0.11.5

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

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

func (*GroupTagGroupBy) StringX added in v0.11.5

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

StringX is like String, but panics if an error occurs.

func (*GroupTagGroupBy) Strings added in v0.11.5

func (s *GroupTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupTagGroupBy) StringsX added in v0.11.5

func (s *GroupTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupTagMutation added in v0.11.5

type GroupTagMutation struct {
	// contains filtered or unexported fields
}

GroupTagMutation represents an operation that mutates the GroupTag nodes in the graph.

func (*GroupTagMutation) AddField added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) AddedEdges added in v0.11.5

func (m *GroupTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupTagMutation) AddedField added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) AddedFields added in v0.11.5

func (m *GroupTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupTagMutation) AddedIDs added in v0.11.5

func (m *GroupTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupTagMutation) ClearEdge added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) ClearField added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) ClearGroup added in v0.11.5

func (m *GroupTagMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*GroupTagMutation) ClearTag added in v0.11.5

func (m *GroupTagMutation) ClearTag()

ClearTag clears the "tag" edge to the Tag entity.

func (*GroupTagMutation) ClearedEdges added in v0.11.5

func (m *GroupTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupTagMutation) ClearedFields added in v0.11.5

func (m *GroupTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupTagMutation) Client added in v0.11.5

func (m GroupTagMutation) 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 (*GroupTagMutation) EdgeCleared added in v0.11.5

func (m *GroupTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupTagMutation) Field added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) FieldCleared added in v0.11.5

func (m *GroupTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupTagMutation) Fields added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) Filter added in v0.11.5

func (m *GroupTagMutation) Filter() *GroupTagFilter

Filter returns an entql.Where implementation to apply filters on the GroupTagMutation builder.

func (*GroupTagMutation) GroupCleared added in v0.11.5

func (m *GroupTagMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*GroupTagMutation) GroupID added in v0.11.5

func (m *GroupTagMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*GroupTagMutation) GroupIDs added in v0.11.5

func (m *GroupTagMutation) GroupIDs() (ids []int)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*GroupTagMutation) ID added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) IDs added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) OldField added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) OldGroupID added in v0.11.5

func (m *GroupTagMutation) OldGroupID(ctx context.Context) (v int, err error)

OldGroupID returns the old "group_id" field's value of the GroupTag entity. If the GroupTag 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 (*GroupTagMutation) OldTagID added in v0.11.5

func (m *GroupTagMutation) OldTagID(ctx context.Context) (v int, err error)

OldTagID returns the old "tag_id" field's value of the GroupTag entity. If the GroupTag 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 (*GroupTagMutation) Op added in v0.11.5

func (m *GroupTagMutation) Op() Op

Op returns the operation name.

func (*GroupTagMutation) RemovedEdges added in v0.11.5

func (m *GroupTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupTagMutation) RemovedIDs added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) ResetEdge added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) ResetField added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) ResetGroup added in v0.11.5

func (m *GroupTagMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*GroupTagMutation) ResetGroupID added in v0.11.5

func (m *GroupTagMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*GroupTagMutation) ResetTag added in v0.11.5

func (m *GroupTagMutation) ResetTag()

ResetTag resets all changes to the "tag" edge.

func (*GroupTagMutation) ResetTagID added in v0.11.5

func (m *GroupTagMutation) ResetTagID()

ResetTagID resets all changes to the "tag_id" field.

func (*GroupTagMutation) SetField added in v0.11.5

func (m *GroupTagMutation) 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 (*GroupTagMutation) SetGroupID added in v0.11.5

func (m *GroupTagMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*GroupTagMutation) SetOp added in v0.11.5

func (m *GroupTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupTagMutation) SetTagID added in v0.11.5

func (m *GroupTagMutation) SetTagID(i int)

SetTagID sets the "tag_id" field.

func (*GroupTagMutation) TagCleared added in v0.11.5

func (m *GroupTagMutation) TagCleared() bool

TagCleared reports if the "tag" edge to the Tag entity was cleared.

func (*GroupTagMutation) TagID added in v0.11.5

func (m *GroupTagMutation) TagID() (r int, exists bool)

TagID returns the value of the "tag_id" field in the mutation.

func (*GroupTagMutation) TagIDs added in v0.11.5

func (m *GroupTagMutation) TagIDs() (ids []int)

TagIDs returns the "tag" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TagID instead. It exists only for internal usage by the builders.

func (GroupTagMutation) Tx added in v0.11.5

func (m GroupTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupTagMutation) Type added in v0.11.5

func (m *GroupTagMutation) Type() string

Type returns the node type of this mutation (GroupTag).

func (*GroupTagMutation) Where added in v0.11.5

func (m *GroupTagMutation) Where(ps ...predicate.GroupTag)

Where appends a list predicates to the GroupTagMutation builder.

func (*GroupTagMutation) WhereP added in v0.11.5

func (m *GroupTagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupTagQuery added in v0.11.5

type GroupTagQuery struct {
	// contains filtered or unexported fields
}

GroupTagQuery is the builder for querying GroupTag entities.

func (*GroupTagQuery) Aggregate added in v0.11.5

func (gtq *GroupTagQuery) Aggregate(fns ...AggregateFunc) *GroupTagSelect

Aggregate returns a GroupTagSelect configured with the given aggregations.

func (*GroupTagQuery) All added in v0.11.5

func (gtq *GroupTagQuery) All(ctx context.Context) ([]*GroupTag, error)

All executes the query and returns a list of GroupTags.

func (*GroupTagQuery) AllX added in v0.11.5

func (gtq *GroupTagQuery) AllX(ctx context.Context) []*GroupTag

AllX is like All, but panics if an error occurs.

func (*GroupTagQuery) Clone added in v0.11.5

func (gtq *GroupTagQuery) Clone() *GroupTagQuery

Clone returns a duplicate of the GroupTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupTagQuery) Count added in v0.11.5

func (gtq *GroupTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupTagQuery) CountX added in v0.11.5

func (gtq *GroupTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupTagQuery) Exist added in v0.11.5

func (gtq *GroupTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupTagQuery) ExistX added in v0.11.5

func (gtq *GroupTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupTagQuery) Filter added in v0.11.5

func (gtq *GroupTagQuery) Filter() *GroupTagFilter

Filter returns a Filter implementation to apply filters on the GroupTagQuery builder.

func (*GroupTagQuery) First added in v0.11.5

func (gtq *GroupTagQuery) First(ctx context.Context) (*GroupTag, error)

First returns the first GroupTag entity from the query. Returns a *NotFoundError when no GroupTag was found.

func (*GroupTagQuery) FirstID added in v0.11.5

func (gtq *GroupTagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GroupTag ID from the query. Returns a *NotFoundError when no GroupTag ID was found.

func (*GroupTagQuery) FirstIDX added in v0.11.5

func (gtq *GroupTagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupTagQuery) FirstX added in v0.11.5

func (gtq *GroupTagQuery) FirstX(ctx context.Context) *GroupTag

FirstX is like First, but panics if an error occurs.

func (*GroupTagQuery) GroupBy added in v0.11.5

func (gtq *GroupTagQuery) GroupBy(field string, fields ...string) *GroupTagGroupBy

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 {
	TagID int `json:"tag_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GroupTag.Query().
	GroupBy(grouptag.FieldTagID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupTagQuery) IDs added in v0.11.5

func (gtq *GroupTagQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GroupTag IDs.

func (*GroupTagQuery) IDsX added in v0.11.5

func (gtq *GroupTagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroupTagQuery) Limit added in v0.11.5

func (gtq *GroupTagQuery) Limit(limit int) *GroupTagQuery

Limit the number of records to be returned by this query.

func (*GroupTagQuery) Offset added in v0.11.5

func (gtq *GroupTagQuery) Offset(offset int) *GroupTagQuery

Offset to start from.

func (*GroupTagQuery) Only added in v0.11.5

func (gtq *GroupTagQuery) Only(ctx context.Context) (*GroupTag, error)

Only returns a single GroupTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroupTag entity is found. Returns a *NotFoundError when no GroupTag entities are found.

func (*GroupTagQuery) OnlyID added in v0.11.5

func (gtq *GroupTagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GroupTag ID in the query. Returns a *NotSingularError when more than one GroupTag ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupTagQuery) OnlyIDX added in v0.11.5

func (gtq *GroupTagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupTagQuery) OnlyX added in v0.11.5

func (gtq *GroupTagQuery) OnlyX(ctx context.Context) *GroupTag

OnlyX is like Only, but panics if an error occurs.

func (*GroupTagQuery) Order added in v0.11.5

func (gtq *GroupTagQuery) Order(o ...OrderFunc) *GroupTagQuery

Order specifies how the records should be ordered.

func (*GroupTagQuery) QueryGroup added in v0.11.5

func (gtq *GroupTagQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*GroupTagQuery) QueryTag added in v0.11.5

func (gtq *GroupTagQuery) QueryTag() *TagQuery

QueryTag chains the current query on the "tag" edge.

func (*GroupTagQuery) Select added in v0.11.5

func (gtq *GroupTagQuery) Select(fields ...string) *GroupTagSelect

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 {
	TagID int `json:"tag_id,omitempty"`
}

client.GroupTag.Query().
	Select(grouptag.FieldTagID).
	Scan(ctx, &v)

func (*GroupTagQuery) Unique added in v0.11.5

func (gtq *GroupTagQuery) Unique(unique bool) *GroupTagQuery

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 (*GroupTagQuery) Where added in v0.11.5

func (gtq *GroupTagQuery) Where(ps ...predicate.GroupTag) *GroupTagQuery

Where adds a new predicate for the GroupTagQuery builder.

func (*GroupTagQuery) WithGroup added in v0.11.5

func (gtq *GroupTagQuery) WithGroup(opts ...func(*GroupQuery)) *GroupTagQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupTagQuery) WithTag added in v0.11.5

func (gtq *GroupTagQuery) WithTag(opts ...func(*TagQuery)) *GroupTagQuery

WithTag tells the query-builder to eager-load the nodes that are connected to the "tag" edge. The optional arguments are used to configure the query builder of the edge.

type GroupTagSelect added in v0.11.5

type GroupTagSelect struct {
	*GroupTagQuery
	// contains filtered or unexported fields
}

GroupTagSelect is the builder for selecting fields of GroupTag entities.

func (*GroupTagSelect) Aggregate added in v0.11.5

func (gts *GroupTagSelect) Aggregate(fns ...AggregateFunc) *GroupTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupTagSelect) Bool added in v0.11.5

func (s *GroupTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) BoolX added in v0.11.5

func (s *GroupTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupTagSelect) Bools added in v0.11.5

func (s *GroupTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) BoolsX added in v0.11.5

func (s *GroupTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupTagSelect) Float64 added in v0.11.5

func (s *GroupTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) Float64X added in v0.11.5

func (s *GroupTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupTagSelect) Float64s added in v0.11.5

func (s *GroupTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) Float64sX added in v0.11.5

func (s *GroupTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupTagSelect) Int added in v0.11.5

func (s *GroupTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) IntX added in v0.11.5

func (s *GroupTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupTagSelect) Ints added in v0.11.5

func (s *GroupTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) IntsX added in v0.11.5

func (s *GroupTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupTagSelect) Scan added in v0.11.5

func (gts *GroupTagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupTagSelect) ScanX added in v0.11.5

func (s *GroupTagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupTagSelect) String added in v0.11.5

func (s *GroupTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) StringX added in v0.11.5

func (s *GroupTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupTagSelect) Strings added in v0.11.5

func (s *GroupTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupTagSelect) StringsX added in v0.11.5

func (s *GroupTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupTagUpdate added in v0.11.5

type GroupTagUpdate struct {
	// contains filtered or unexported fields
}

GroupTagUpdate is the builder for updating GroupTag entities.

func (*GroupTagUpdate) ClearGroup added in v0.11.5

func (gtu *GroupTagUpdate) ClearGroup() *GroupTagUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*GroupTagUpdate) ClearTag added in v0.11.5

func (gtu *GroupTagUpdate) ClearTag() *GroupTagUpdate

ClearTag clears the "tag" edge to the Tag entity.

func (*GroupTagUpdate) Exec added in v0.11.5

func (gtu *GroupTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupTagUpdate) ExecX added in v0.11.5

func (gtu *GroupTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupTagUpdate) Mutation added in v0.11.5

func (gtu *GroupTagUpdate) Mutation() *GroupTagMutation

Mutation returns the GroupTagMutation object of the builder.

func (*GroupTagUpdate) Save added in v0.11.5

func (gtu *GroupTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupTagUpdate) SaveX added in v0.11.5

func (gtu *GroupTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupTagUpdate) SetGroup added in v0.11.5

func (gtu *GroupTagUpdate) SetGroup(g *Group) *GroupTagUpdate

SetGroup sets the "group" edge to the Group entity.

func (*GroupTagUpdate) SetGroupID added in v0.11.5

func (gtu *GroupTagUpdate) SetGroupID(i int) *GroupTagUpdate

SetGroupID sets the "group_id" field.

func (*GroupTagUpdate) SetTag added in v0.11.5

func (gtu *GroupTagUpdate) SetTag(t *Tag) *GroupTagUpdate

SetTag sets the "tag" edge to the Tag entity.

func (*GroupTagUpdate) SetTagID added in v0.11.5

func (gtu *GroupTagUpdate) SetTagID(i int) *GroupTagUpdate

SetTagID sets the "tag_id" field.

func (*GroupTagUpdate) Where added in v0.11.5

func (gtu *GroupTagUpdate) Where(ps ...predicate.GroupTag) *GroupTagUpdate

Where appends a list predicates to the GroupTagUpdate builder.

type GroupTagUpdateOne added in v0.11.5

type GroupTagUpdateOne struct {
	// contains filtered or unexported fields
}

GroupTagUpdateOne is the builder for updating a single GroupTag entity.

func (*GroupTagUpdateOne) ClearGroup added in v0.11.5

func (gtuo *GroupTagUpdateOne) ClearGroup() *GroupTagUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*GroupTagUpdateOne) ClearTag added in v0.11.5

func (gtuo *GroupTagUpdateOne) ClearTag() *GroupTagUpdateOne

ClearTag clears the "tag" edge to the Tag entity.

func (*GroupTagUpdateOne) Exec added in v0.11.5

func (gtuo *GroupTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupTagUpdateOne) ExecX added in v0.11.5

func (gtuo *GroupTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupTagUpdateOne) Mutation added in v0.11.5

func (gtuo *GroupTagUpdateOne) Mutation() *GroupTagMutation

Mutation returns the GroupTagMutation object of the builder.

func (*GroupTagUpdateOne) Save added in v0.11.5

func (gtuo *GroupTagUpdateOne) Save(ctx context.Context) (*GroupTag, error)

Save executes the query and returns the updated GroupTag entity.

func (*GroupTagUpdateOne) SaveX added in v0.11.5

func (gtuo *GroupTagUpdateOne) SaveX(ctx context.Context) *GroupTag

SaveX is like Save, but panics if an error occurs.

func (*GroupTagUpdateOne) Select added in v0.11.5

func (gtuo *GroupTagUpdateOne) Select(field string, fields ...string) *GroupTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupTagUpdateOne) SetGroup added in v0.11.5

func (gtuo *GroupTagUpdateOne) SetGroup(g *Group) *GroupTagUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*GroupTagUpdateOne) SetGroupID added in v0.11.5

func (gtuo *GroupTagUpdateOne) SetGroupID(i int) *GroupTagUpdateOne

SetGroupID sets the "group_id" field.

func (*GroupTagUpdateOne) SetTag added in v0.11.5

func (gtuo *GroupTagUpdateOne) SetTag(t *Tag) *GroupTagUpdateOne

SetTag sets the "tag" edge to the Tag entity.

func (*GroupTagUpdateOne) SetTagID added in v0.11.5

func (gtuo *GroupTagUpdateOne) SetTagID(i int) *GroupTagUpdateOne

SetTagID sets the "tag_id" field.

func (*GroupTagUpdateOne) Where added in v0.11.8

Where appends a list predicates to the GroupTagUpdate builder.

type GroupTagUpsert added in v0.11.5

type GroupTagUpsert struct {
	*sql.UpdateSet
}

GroupTagUpsert is the "OnConflict" setter.

func (*GroupTagUpsert) SetGroupID added in v0.11.5

func (u *GroupTagUpsert) SetGroupID(v int) *GroupTagUpsert

SetGroupID sets the "group_id" field.

func (*GroupTagUpsert) SetTagID added in v0.11.5

func (u *GroupTagUpsert) SetTagID(v int) *GroupTagUpsert

SetTagID sets the "tag_id" field.

func (*GroupTagUpsert) UpdateGroupID added in v0.11.5

func (u *GroupTagUpsert) UpdateGroupID() *GroupTagUpsert

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*GroupTagUpsert) UpdateTagID added in v0.11.5

func (u *GroupTagUpsert) UpdateTagID() *GroupTagUpsert

UpdateTagID sets the "tag_id" field to the value that was provided on create.

type GroupTagUpsertBulk added in v0.11.5

type GroupTagUpsertBulk struct {
	// contains filtered or unexported fields
}

GroupTagUpsertBulk is the builder for "upsert"-ing a bulk of GroupTag nodes.

func (*GroupTagUpsertBulk) DoNothing added in v0.11.5

func (u *GroupTagUpsertBulk) DoNothing() *GroupTagUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupTagUpsertBulk) Exec added in v0.11.5

func (u *GroupTagUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupTagUpsertBulk) ExecX added in v0.11.5

func (u *GroupTagUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupTagUpsertBulk) Ignore added in v0.11.5

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GroupTag.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GroupTagUpsertBulk) SetGroupID added in v0.11.5

func (u *GroupTagUpsertBulk) SetGroupID(v int) *GroupTagUpsertBulk

SetGroupID sets the "group_id" field.

func (*GroupTagUpsertBulk) SetTagID added in v0.11.5

func (u *GroupTagUpsertBulk) SetTagID(v int) *GroupTagUpsertBulk

SetTagID sets the "tag_id" field.

func (*GroupTagUpsertBulk) Update added in v0.11.5

func (u *GroupTagUpsertBulk) Update(set func(*GroupTagUpsert)) *GroupTagUpsertBulk

Update allows overriding fields `UPDATE` values. See the GroupTagCreateBulk.OnConflict documentation for more info.

func (*GroupTagUpsertBulk) UpdateGroupID added in v0.11.5

func (u *GroupTagUpsertBulk) UpdateGroupID() *GroupTagUpsertBulk

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*GroupTagUpsertBulk) UpdateNewValues added in v0.11.5

func (u *GroupTagUpsertBulk) UpdateNewValues() *GroupTagUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GroupTag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupTagUpsertBulk) UpdateTagID added in v0.11.5

func (u *GroupTagUpsertBulk) UpdateTagID() *GroupTagUpsertBulk

UpdateTagID sets the "tag_id" field to the value that was provided on create.

type GroupTagUpsertOne added in v0.11.5

type GroupTagUpsertOne struct {
	// contains filtered or unexported fields
}

GroupTagUpsertOne is the builder for "upsert"-ing

one GroupTag node.

func (*GroupTagUpsertOne) DoNothing added in v0.11.5

func (u *GroupTagUpsertOne) DoNothing() *GroupTagUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupTagUpsertOne) Exec added in v0.11.5

func (u *GroupTagUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupTagUpsertOne) ExecX added in v0.11.5

func (u *GroupTagUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupTagUpsertOne) ID added in v0.11.5

func (u *GroupTagUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GroupTagUpsertOne) IDX added in v0.11.5

func (u *GroupTagUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*GroupTagUpsertOne) Ignore added in v0.11.5

func (u *GroupTagUpsertOne) Ignore() *GroupTagUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GroupTag.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GroupTagUpsertOne) SetGroupID added in v0.11.5

func (u *GroupTagUpsertOne) SetGroupID(v int) *GroupTagUpsertOne

SetGroupID sets the "group_id" field.

func (*GroupTagUpsertOne) SetTagID added in v0.11.5

func (u *GroupTagUpsertOne) SetTagID(v int) *GroupTagUpsertOne

SetTagID sets the "tag_id" field.

func (*GroupTagUpsertOne) Update added in v0.11.5

func (u *GroupTagUpsertOne) Update(set func(*GroupTagUpsert)) *GroupTagUpsertOne

Update allows overriding fields `UPDATE` values. See the GroupTagCreate.OnConflict documentation for more info.

func (*GroupTagUpsertOne) UpdateGroupID added in v0.11.5

func (u *GroupTagUpsertOne) UpdateGroupID() *GroupTagUpsertOne

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*GroupTagUpsertOne) UpdateNewValues added in v0.11.5

func (u *GroupTagUpsertOne) UpdateNewValues() *GroupTagUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GroupTag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupTagUpsertOne) UpdateTagID added in v0.11.5

func (u *GroupTagUpsertOne) UpdateTagID() *GroupTagUpsertOne

UpdateTagID sets the "tag_id" field to the value that was provided on create.

type GroupTags added in v0.11.5

type GroupTags []*GroupTag

GroupTags is a parsable slice of GroupTag.

type GroupUpdate

type GroupUpdate struct {
	// contains filtered or unexported fields
}

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddGroupTagIDs added in v0.11.5

func (gu *GroupUpdate) AddGroupTagIDs(ids ...int) *GroupUpdate

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by IDs.

func (*GroupUpdate) AddGroupTags added in v0.11.5

func (gu *GroupUpdate) AddGroupTags(g ...*GroupTag) *GroupUpdate

AddGroupTags adds the "group_tags" edges to the GroupTag entity.

func (*GroupUpdate) AddJoinedUserIDs

func (gu *GroupUpdate) AddJoinedUserIDs(ids ...int) *GroupUpdate

AddJoinedUserIDs adds the "joined_users" edge to the UserGroup entity by IDs.

func (*GroupUpdate) AddJoinedUsers

func (gu *GroupUpdate) AddJoinedUsers(u ...*UserGroup) *GroupUpdate

AddJoinedUsers adds the "joined_users" edges to the UserGroup entity.

func (*GroupUpdate) AddTagIDs added in v0.11.5

func (gu *GroupUpdate) AddTagIDs(ids ...int) *GroupUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*GroupUpdate) AddTags added in v0.11.5

func (gu *GroupUpdate) AddTags(t ...*Tag) *GroupUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*GroupUpdate) AddUserIDs

func (gu *GroupUpdate) AddUserIDs(ids ...int) *GroupUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdate) AddUsers

func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdate) ClearGroupTags added in v0.11.5

func (gu *GroupUpdate) ClearGroupTags() *GroupUpdate

ClearGroupTags clears all "group_tags" edges to the GroupTag entity.

func (*GroupUpdate) ClearJoinedUsers

func (gu *GroupUpdate) ClearJoinedUsers() *GroupUpdate

ClearJoinedUsers clears all "joined_users" edges to the UserGroup entity.

func (*GroupUpdate) ClearTags added in v0.11.5

func (gu *GroupUpdate) ClearTags() *GroupUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*GroupUpdate) ClearUsers

func (gu *GroupUpdate) ClearUsers() *GroupUpdate

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveGroupTagIDs added in v0.11.5

func (gu *GroupUpdate) RemoveGroupTagIDs(ids ...int) *GroupUpdate

RemoveGroupTagIDs removes the "group_tags" edge to GroupTag entities by IDs.

func (*GroupUpdate) RemoveGroupTags added in v0.11.5

func (gu *GroupUpdate) RemoveGroupTags(g ...*GroupTag) *GroupUpdate

RemoveGroupTags removes "group_tags" edges to GroupTag entities.

func (*GroupUpdate) RemoveJoinedUserIDs

func (gu *GroupUpdate) RemoveJoinedUserIDs(ids ...int) *GroupUpdate

RemoveJoinedUserIDs removes the "joined_users" edge to UserGroup entities by IDs.

func (*GroupUpdate) RemoveJoinedUsers

func (gu *GroupUpdate) RemoveJoinedUsers(u ...*UserGroup) *GroupUpdate

RemoveJoinedUsers removes "joined_users" edges to UserGroup entities.

func (*GroupUpdate) RemoveTagIDs added in v0.11.5

func (gu *GroupUpdate) RemoveTagIDs(ids ...int) *GroupUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*GroupUpdate) RemoveTags added in v0.11.5

func (gu *GroupUpdate) RemoveTags(t ...*Tag) *GroupUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*GroupUpdate) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...int) *GroupUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdate) RemoveUsers

func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdate) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetNillableName

func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

type GroupUpdateOne struct {
	// contains filtered or unexported fields
}

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddGroupTagIDs added in v0.11.5

func (guo *GroupUpdateOne) AddGroupTagIDs(ids ...int) *GroupUpdateOne

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by IDs.

func (*GroupUpdateOne) AddGroupTags added in v0.11.5

func (guo *GroupUpdateOne) AddGroupTags(g ...*GroupTag) *GroupUpdateOne

AddGroupTags adds the "group_tags" edges to the GroupTag entity.

func (*GroupUpdateOne) AddJoinedUserIDs

func (guo *GroupUpdateOne) AddJoinedUserIDs(ids ...int) *GroupUpdateOne

AddJoinedUserIDs adds the "joined_users" edge to the UserGroup entity by IDs.

func (*GroupUpdateOne) AddJoinedUsers

func (guo *GroupUpdateOne) AddJoinedUsers(u ...*UserGroup) *GroupUpdateOne

AddJoinedUsers adds the "joined_users" edges to the UserGroup entity.

func (*GroupUpdateOne) AddTagIDs added in v0.11.5

func (guo *GroupUpdateOne) AddTagIDs(ids ...int) *GroupUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*GroupUpdateOne) AddTags added in v0.11.5

func (guo *GroupUpdateOne) AddTags(t ...*Tag) *GroupUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*GroupUpdateOne) AddUserIDs

func (guo *GroupUpdateOne) AddUserIDs(ids ...int) *GroupUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdateOne) AddUsers

func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdateOne) ClearGroupTags added in v0.11.5

func (guo *GroupUpdateOne) ClearGroupTags() *GroupUpdateOne

ClearGroupTags clears all "group_tags" edges to the GroupTag entity.

func (*GroupUpdateOne) ClearJoinedUsers

func (guo *GroupUpdateOne) ClearJoinedUsers() *GroupUpdateOne

ClearJoinedUsers clears all "joined_users" edges to the UserGroup entity.

func (*GroupUpdateOne) ClearTags added in v0.11.5

func (guo *GroupUpdateOne) ClearTags() *GroupUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*GroupUpdateOne) ClearUsers

func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveGroupTagIDs added in v0.11.5

func (guo *GroupUpdateOne) RemoveGroupTagIDs(ids ...int) *GroupUpdateOne

RemoveGroupTagIDs removes the "group_tags" edge to GroupTag entities by IDs.

func (*GroupUpdateOne) RemoveGroupTags added in v0.11.5

func (guo *GroupUpdateOne) RemoveGroupTags(g ...*GroupTag) *GroupUpdateOne

RemoveGroupTags removes "group_tags" edges to GroupTag entities.

func (*GroupUpdateOne) RemoveJoinedUserIDs

func (guo *GroupUpdateOne) RemoveJoinedUserIDs(ids ...int) *GroupUpdateOne

RemoveJoinedUserIDs removes the "joined_users" edge to UserGroup entities by IDs.

func (*GroupUpdateOne) RemoveJoinedUsers

func (guo *GroupUpdateOne) RemoveJoinedUsers(u ...*UserGroup) *GroupUpdateOne

RemoveJoinedUsers removes "joined_users" edges to UserGroup entities.

func (*GroupUpdateOne) RemoveTagIDs added in v0.11.5

func (guo *GroupUpdateOne) RemoveTagIDs(ids ...int) *GroupUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*GroupUpdateOne) RemoveTags added in v0.11.5

func (guo *GroupUpdateOne) RemoveTags(t ...*Tag) *GroupUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*GroupUpdateOne) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...int) *GroupUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdateOne) RemoveUsers

func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupUpdateOne) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetNillableName

func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupUpdateOne) Where added in v0.11.8

func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne

Where appends a list predicates to the GroupUpdate builder.

type GroupUpsert

type GroupUpsert struct {
	*sql.UpdateSet
}

GroupUpsert is the "OnConflict" setter.

func (*GroupUpsert) SetName

func (u *GroupUpsert) SetName(v string) *GroupUpsert

SetName sets the "name" field.

func (*GroupUpsert) UpdateName

func (u *GroupUpsert) UpdateName() *GroupUpsert

UpdateName sets the "name" field to the value that was provided on create.

type GroupUpsertBulk

type GroupUpsertBulk struct {
	// contains filtered or unexported fields
}

GroupUpsertBulk is the builder for "upsert"-ing a bulk of Group nodes.

func (*GroupUpsertBulk) DoNothing

func (u *GroupUpsertBulk) DoNothing() *GroupUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupUpsertBulk) Exec

func (u *GroupUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpsertBulk) ExecX

func (u *GroupUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpsertBulk) Ignore

func (u *GroupUpsertBulk) Ignore() *GroupUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GroupUpsertBulk) SetName

func (u *GroupUpsertBulk) SetName(v string) *GroupUpsertBulk

SetName sets the "name" field.

func (*GroupUpsertBulk) Update

func (u *GroupUpsertBulk) Update(set func(*GroupUpsert)) *GroupUpsertBulk

Update allows overriding fields `UPDATE` values. See the GroupCreateBulk.OnConflict documentation for more info.

func (*GroupUpsertBulk) UpdateName

func (u *GroupUpsertBulk) UpdateName() *GroupUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*GroupUpsertBulk) UpdateNewValues

func (u *GroupUpsertBulk) UpdateNewValues() *GroupUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type GroupUpsertOne

type GroupUpsertOne struct {
	// contains filtered or unexported fields
}

GroupUpsertOne is the builder for "upsert"-ing

one Group node.

func (*GroupUpsertOne) DoNothing

func (u *GroupUpsertOne) DoNothing() *GroupUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupUpsertOne) Exec

func (u *GroupUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpsertOne) ExecX

func (u *GroupUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpsertOne) ID

func (u *GroupUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GroupUpsertOne) IDX

func (u *GroupUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*GroupUpsertOne) Ignore

func (u *GroupUpsertOne) Ignore() *GroupUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Group.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GroupUpsertOne) SetName

func (u *GroupUpsertOne) SetName(v string) *GroupUpsertOne

SetName sets the "name" field.

func (*GroupUpsertOne) Update

func (u *GroupUpsertOne) Update(set func(*GroupUpsert)) *GroupUpsertOne

Update allows overriding fields `UPDATE` values. See the GroupCreate.OnConflict documentation for more info.

func (*GroupUpsertOne) UpdateName

func (u *GroupUpsertOne) UpdateName() *GroupUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*GroupUpsertOne) UpdateNewValues

func (u *GroupUpsertOne) UpdateNewValues() *GroupUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc added in v0.11.5

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor added in v0.11.5

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Process added in v0.11.8

type Process struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProcessQuery when eager-loading is set.
	Edges ProcessEdges `json:"edges"`
	// contains filtered or unexported fields
}

Process is the model entity for the Process schema.

func (*Process) QueryAttachedFiles added in v0.11.8

func (pr *Process) QueryAttachedFiles() *AttachedFileQuery

QueryAttachedFiles queries the "attached_files" edge of the Process entity.

func (*Process) QueryFiles added in v0.11.8

func (pr *Process) QueryFiles() *FileQuery

QueryFiles queries the "files" edge of the Process entity.

func (*Process) String added in v0.11.8

func (pr *Process) String() string

String implements the fmt.Stringer.

func (*Process) Unwrap added in v0.11.8

func (pr *Process) Unwrap() *Process

Unwrap unwraps the Process 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 (*Process) Update added in v0.11.8

func (pr *Process) Update() *ProcessUpdateOne

Update returns a builder for updating this Process. Note that you need to call Process.Unwrap() before calling this method if this Process was returned from a transaction, and the transaction was committed or rolled back.

type ProcessClient added in v0.11.8

type ProcessClient struct {
	// contains filtered or unexported fields
}

ProcessClient is a client for the Process schema.

func NewProcessClient added in v0.11.8

func NewProcessClient(c config) *ProcessClient

NewProcessClient returns a client for the Process from the given config.

func (*ProcessClient) Create added in v0.11.8

func (c *ProcessClient) Create() *ProcessCreate

Create returns a builder for creating a Process entity.

func (*ProcessClient) CreateBulk added in v0.11.8

func (c *ProcessClient) CreateBulk(builders ...*ProcessCreate) *ProcessCreateBulk

CreateBulk returns a builder for creating a bulk of Process entities.

func (*ProcessClient) Delete added in v0.11.8

func (c *ProcessClient) Delete() *ProcessDelete

Delete returns a delete builder for Process.

func (*ProcessClient) DeleteOne added in v0.11.8

func (c *ProcessClient) DeleteOne(pr *Process) *ProcessDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProcessClient) DeleteOneID added in v0.11.8

func (c *ProcessClient) DeleteOneID(id int) *ProcessDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProcessClient) Get added in v0.11.8

func (c *ProcessClient) Get(ctx context.Context, id int) (*Process, error)

Get returns a Process entity by its id.

func (*ProcessClient) GetX added in v0.11.8

func (c *ProcessClient) GetX(ctx context.Context, id int) *Process

GetX is like Get, but panics if an error occurs.

func (*ProcessClient) Hooks added in v0.11.8

func (c *ProcessClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProcessClient) Intercept added in v0.11.8

func (c *ProcessClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `process.Intercept(f(g(h())))`.

func (*ProcessClient) Interceptors added in v0.11.8

func (c *ProcessClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProcessClient) Query added in v0.11.8

func (c *ProcessClient) Query() *ProcessQuery

Query returns a query builder for Process.

func (*ProcessClient) QueryAttachedFiles added in v0.11.8

func (c *ProcessClient) QueryAttachedFiles(pr *Process) *AttachedFileQuery

QueryAttachedFiles queries the attached_files edge of a Process.

func (*ProcessClient) QueryFiles added in v0.11.8

func (c *ProcessClient) QueryFiles(pr *Process) *FileQuery

QueryFiles queries the files edge of a Process.

func (*ProcessClient) Update added in v0.11.8

func (c *ProcessClient) Update() *ProcessUpdate

Update returns an update builder for Process.

func (*ProcessClient) UpdateOne added in v0.11.8

func (c *ProcessClient) UpdateOne(pr *Process) *ProcessUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProcessClient) UpdateOneID added in v0.11.8

func (c *ProcessClient) UpdateOneID(id int) *ProcessUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProcessClient) Use added in v0.11.8

func (c *ProcessClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `process.Hooks(f(g(h())))`.

type ProcessCreate added in v0.11.8

type ProcessCreate struct {
	// contains filtered or unexported fields
}

ProcessCreate is the builder for creating a Process entity.

func (*ProcessCreate) AddAttachedFileIDs added in v0.11.8

func (pc *ProcessCreate) AddAttachedFileIDs(ids ...int) *ProcessCreate

AddAttachedFileIDs adds the "attached_files" edge to the AttachedFile entity by IDs.

func (*ProcessCreate) AddAttachedFiles added in v0.11.8

func (pc *ProcessCreate) AddAttachedFiles(a ...*AttachedFile) *ProcessCreate

AddAttachedFiles adds the "attached_files" edges to the AttachedFile entity.

func (*ProcessCreate) AddFileIDs added in v0.11.8

func (pc *ProcessCreate) AddFileIDs(ids ...int) *ProcessCreate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*ProcessCreate) AddFiles added in v0.11.8

func (pc *ProcessCreate) AddFiles(f ...*File) *ProcessCreate

AddFiles adds the "files" edges to the File entity.

func (*ProcessCreate) Exec added in v0.11.8

func (pc *ProcessCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessCreate) ExecX added in v0.11.8

func (pc *ProcessCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessCreate) Mutation added in v0.11.8

func (pc *ProcessCreate) Mutation() *ProcessMutation

Mutation returns the ProcessMutation object of the builder.

func (*ProcessCreate) OnConflict added in v0.11.8

func (pc *ProcessCreate) OnConflict(opts ...sql.ConflictOption) *ProcessUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Process.Create().
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ProcessCreate) OnConflictColumns added in v0.11.8

func (pc *ProcessCreate) OnConflictColumns(columns ...string) *ProcessUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Process.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ProcessCreate) Save added in v0.11.8

func (pc *ProcessCreate) Save(ctx context.Context) (*Process, error)

Save creates the Process in the database.

func (*ProcessCreate) SaveX added in v0.11.8

func (pc *ProcessCreate) SaveX(ctx context.Context) *Process

SaveX calls Save and panics if Save returns an error.

type ProcessCreateBulk added in v0.11.8

type ProcessCreateBulk struct {
	// contains filtered or unexported fields
}

ProcessCreateBulk is the builder for creating many Process entities in bulk.

func (*ProcessCreateBulk) Exec added in v0.11.8

func (pcb *ProcessCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessCreateBulk) ExecX added in v0.11.8

func (pcb *ProcessCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessCreateBulk) OnConflict added in v0.11.8

func (pcb *ProcessCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProcessUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Process.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ProcessCreateBulk) OnConflictColumns added in v0.11.8

func (pcb *ProcessCreateBulk) OnConflictColumns(columns ...string) *ProcessUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Process.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ProcessCreateBulk) Save added in v0.11.8

func (pcb *ProcessCreateBulk) Save(ctx context.Context) ([]*Process, error)

Save creates the Process entities in the database.

func (*ProcessCreateBulk) SaveX added in v0.11.8

func (pcb *ProcessCreateBulk) SaveX(ctx context.Context) []*Process

SaveX is like Save, but panics if an error occurs.

type ProcessDelete added in v0.11.8

type ProcessDelete struct {
	// contains filtered or unexported fields
}

ProcessDelete is the builder for deleting a Process entity.

func (*ProcessDelete) Exec added in v0.11.8

func (pd *ProcessDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProcessDelete) ExecX added in v0.11.8

func (pd *ProcessDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProcessDelete) Where added in v0.11.8

func (pd *ProcessDelete) Where(ps ...predicate.Process) *ProcessDelete

Where appends a list predicates to the ProcessDelete builder.

type ProcessDeleteOne added in v0.11.8

type ProcessDeleteOne struct {
	// contains filtered or unexported fields
}

ProcessDeleteOne is the builder for deleting a single Process entity.

func (*ProcessDeleteOne) Exec added in v0.11.8

func (pdo *ProcessDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProcessDeleteOne) ExecX added in v0.11.8

func (pdo *ProcessDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessDeleteOne) Where added in v0.11.8

Where appends a list predicates to the ProcessDelete builder.

type ProcessEdges added in v0.11.8

type ProcessEdges struct {
	// Files that were attached by this process
	Files []*File `json:"files,omitempty"`
	// AttachedFiles holds the value of the attached_files edge.
	AttachedFiles []*AttachedFile `json:"attached_files,omitempty"`
	// contains filtered or unexported fields
}

ProcessEdges holds the relations/edges for other nodes in the graph.

func (ProcessEdges) AttachedFilesOrErr added in v0.11.8

func (e ProcessEdges) AttachedFilesOrErr() ([]*AttachedFile, error)

AttachedFilesOrErr returns the AttachedFiles value or an error if the edge was not loaded in eager-loading.

func (ProcessEdges) FilesOrErr added in v0.11.8

func (e ProcessEdges) FilesOrErr() ([]*File, error)

FilesOrErr returns the Files value or an error if the edge was not loaded in eager-loading.

type ProcessFilter added in v0.11.8

type ProcessFilter struct {
	// contains filtered or unexported fields
}

ProcessFilter provides a generic filtering capability at runtime for ProcessQuery.

func (*ProcessFilter) Where added in v0.11.8

func (f *ProcessFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ProcessFilter) WhereHasAttachedFiles added in v0.11.8

func (f *ProcessFilter) WhereHasAttachedFiles()

WhereHasAttachedFiles applies a predicate to check if query has an edge attached_files.

func (*ProcessFilter) WhereHasAttachedFilesWith added in v0.11.8

func (f *ProcessFilter) WhereHasAttachedFilesWith(preds ...predicate.AttachedFile)

WhereHasAttachedFilesWith applies a predicate to check if query has an edge attached_files with a given conditions (other predicates).

func (*ProcessFilter) WhereHasFiles added in v0.11.8

func (f *ProcessFilter) WhereHasFiles()

WhereHasFiles applies a predicate to check if query has an edge files.

func (*ProcessFilter) WhereHasFilesWith added in v0.11.8

func (f *ProcessFilter) WhereHasFilesWith(preds ...predicate.File)

WhereHasFilesWith applies a predicate to check if query has an edge files with a given conditions (other predicates).

func (*ProcessFilter) WhereID added in v0.11.8

func (f *ProcessFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

type ProcessGroupBy added in v0.11.8

type ProcessGroupBy struct {
	// contains filtered or unexported fields
}

ProcessGroupBy is the group-by builder for Process entities.

func (*ProcessGroupBy) Aggregate added in v0.11.8

func (pgb *ProcessGroupBy) Aggregate(fns ...AggregateFunc) *ProcessGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProcessGroupBy) Bool added in v0.11.8

func (s *ProcessGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) BoolX added in v0.11.8

func (s *ProcessGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProcessGroupBy) Bools added in v0.11.8

func (s *ProcessGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) BoolsX added in v0.11.8

func (s *ProcessGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProcessGroupBy) Float64 added in v0.11.8

func (s *ProcessGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) Float64X added in v0.11.8

func (s *ProcessGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProcessGroupBy) Float64s added in v0.11.8

func (s *ProcessGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) Float64sX added in v0.11.8

func (s *ProcessGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProcessGroupBy) Int added in v0.11.8

func (s *ProcessGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) IntX added in v0.11.8

func (s *ProcessGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProcessGroupBy) Ints added in v0.11.8

func (s *ProcessGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) IntsX added in v0.11.8

func (s *ProcessGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProcessGroupBy) Scan added in v0.11.8

func (pgb *ProcessGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProcessGroupBy) ScanX added in v0.11.8

func (s *ProcessGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProcessGroupBy) String added in v0.11.8

func (s *ProcessGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) StringX added in v0.11.8

func (s *ProcessGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProcessGroupBy) Strings added in v0.11.8

func (s *ProcessGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProcessGroupBy) StringsX added in v0.11.8

func (s *ProcessGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProcessMutation added in v0.11.8

type ProcessMutation struct {
	// contains filtered or unexported fields
}

ProcessMutation represents an operation that mutates the Process nodes in the graph.

func (*ProcessMutation) AddAttachedFileIDs added in v0.11.8

func (m *ProcessMutation) AddAttachedFileIDs(ids ...int)

AddAttachedFileIDs adds the "attached_files" edge to the AttachedFile entity by ids.

func (*ProcessMutation) AddField added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) AddFileIDs added in v0.11.8

func (m *ProcessMutation) AddFileIDs(ids ...int)

AddFileIDs adds the "files" edge to the File entity by ids.

func (*ProcessMutation) AddedEdges added in v0.11.8

func (m *ProcessMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProcessMutation) AddedField added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) AddedFields added in v0.11.8

func (m *ProcessMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProcessMutation) AddedIDs added in v0.11.8

func (m *ProcessMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProcessMutation) AttachedFilesCleared added in v0.11.8

func (m *ProcessMutation) AttachedFilesCleared() bool

AttachedFilesCleared reports if the "attached_files" edge to the AttachedFile entity was cleared.

func (*ProcessMutation) AttachedFilesIDs added in v0.11.8

func (m *ProcessMutation) AttachedFilesIDs() (ids []int)

AttachedFilesIDs returns the "attached_files" edge IDs in the mutation.

func (*ProcessMutation) ClearAttachedFiles added in v0.11.8

func (m *ProcessMutation) ClearAttachedFiles()

ClearAttachedFiles clears the "attached_files" edge to the AttachedFile entity.

func (*ProcessMutation) ClearEdge added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) ClearField added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) ClearFiles added in v0.11.8

func (m *ProcessMutation) ClearFiles()

ClearFiles clears the "files" edge to the File entity.

func (*ProcessMutation) ClearedEdges added in v0.11.8

func (m *ProcessMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProcessMutation) ClearedFields added in v0.11.8

func (m *ProcessMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProcessMutation) Client added in v0.11.8

func (m ProcessMutation) 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 (*ProcessMutation) EdgeCleared added in v0.11.8

func (m *ProcessMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProcessMutation) Field added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) FieldCleared added in v0.11.8

func (m *ProcessMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProcessMutation) Fields added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) FilesCleared added in v0.11.8

func (m *ProcessMutation) FilesCleared() bool

FilesCleared reports if the "files" edge to the File entity was cleared.

func (*ProcessMutation) FilesIDs added in v0.11.8

func (m *ProcessMutation) FilesIDs() (ids []int)

FilesIDs returns the "files" edge IDs in the mutation.

func (*ProcessMutation) Filter added in v0.11.8

func (m *ProcessMutation) Filter() *ProcessFilter

Filter returns an entql.Where implementation to apply filters on the ProcessMutation builder.

func (*ProcessMutation) ID added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) IDs added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) OldField added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) Op added in v0.11.8

func (m *ProcessMutation) Op() Op

Op returns the operation name.

func (*ProcessMutation) RemoveAttachedFileIDs added in v0.11.8

func (m *ProcessMutation) RemoveAttachedFileIDs(ids ...int)

RemoveAttachedFileIDs removes the "attached_files" edge to the AttachedFile entity by IDs.

func (*ProcessMutation) RemoveFileIDs added in v0.11.8

func (m *ProcessMutation) RemoveFileIDs(ids ...int)

RemoveFileIDs removes the "files" edge to the File entity by IDs.

func (*ProcessMutation) RemovedAttachedFilesIDs added in v0.11.8

func (m *ProcessMutation) RemovedAttachedFilesIDs() (ids []int)

RemovedAttachedFiles returns the removed IDs of the "attached_files" edge to the AttachedFile entity.

func (*ProcessMutation) RemovedEdges added in v0.11.8

func (m *ProcessMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProcessMutation) RemovedFilesIDs added in v0.11.8

func (m *ProcessMutation) RemovedFilesIDs() (ids []int)

RemovedFiles returns the removed IDs of the "files" edge to the File entity.

func (*ProcessMutation) RemovedIDs added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) ResetAttachedFiles added in v0.11.8

func (m *ProcessMutation) ResetAttachedFiles()

ResetAttachedFiles resets all changes to the "attached_files" edge.

func (*ProcessMutation) ResetEdge added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) ResetField added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) ResetFiles added in v0.11.8

func (m *ProcessMutation) ResetFiles()

ResetFiles resets all changes to the "files" edge.

func (*ProcessMutation) SetField added in v0.11.8

func (m *ProcessMutation) 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 (*ProcessMutation) SetOp added in v0.11.8

func (m *ProcessMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ProcessMutation) Tx added in v0.11.8

func (m ProcessMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProcessMutation) Type added in v0.11.8

func (m *ProcessMutation) Type() string

Type returns the node type of this mutation (Process).

func (*ProcessMutation) Where added in v0.11.8

func (m *ProcessMutation) Where(ps ...predicate.Process)

Where appends a list predicates to the ProcessMutation builder.

func (*ProcessMutation) WhereP added in v0.11.8

func (m *ProcessMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProcessMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProcessQuery added in v0.11.8

type ProcessQuery struct {
	// contains filtered or unexported fields
}

ProcessQuery is the builder for querying Process entities.

func (*ProcessQuery) Aggregate added in v0.11.8

func (pq *ProcessQuery) Aggregate(fns ...AggregateFunc) *ProcessSelect

Aggregate returns a ProcessSelect configured with the given aggregations.

func (*ProcessQuery) All added in v0.11.8

func (pq *ProcessQuery) All(ctx context.Context) ([]*Process, error)

All executes the query and returns a list of Processes.

func (*ProcessQuery) AllX added in v0.11.8

func (pq *ProcessQuery) AllX(ctx context.Context) []*Process

AllX is like All, but panics if an error occurs.

func (*ProcessQuery) Clone added in v0.11.8

func (pq *ProcessQuery) Clone() *ProcessQuery

Clone returns a duplicate of the ProcessQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProcessQuery) Count added in v0.11.8

func (pq *ProcessQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProcessQuery) CountX added in v0.11.8

func (pq *ProcessQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProcessQuery) Exist added in v0.11.8

func (pq *ProcessQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProcessQuery) ExistX added in v0.11.8

func (pq *ProcessQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProcessQuery) Filter added in v0.11.8

func (pq *ProcessQuery) Filter() *ProcessFilter

Filter returns a Filter implementation to apply filters on the ProcessQuery builder.

func (*ProcessQuery) First added in v0.11.8

func (pq *ProcessQuery) First(ctx context.Context) (*Process, error)

First returns the first Process entity from the query. Returns a *NotFoundError when no Process was found.

func (*ProcessQuery) FirstID added in v0.11.8

func (pq *ProcessQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Process ID from the query. Returns a *NotFoundError when no Process ID was found.

func (*ProcessQuery) FirstIDX added in v0.11.8

func (pq *ProcessQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProcessQuery) FirstX added in v0.11.8

func (pq *ProcessQuery) FirstX(ctx context.Context) *Process

FirstX is like First, but panics if an error occurs.

func (*ProcessQuery) GroupBy added in v0.11.8

func (pq *ProcessQuery) GroupBy(field string, fields ...string) *ProcessGroupBy

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 (*ProcessQuery) IDs added in v0.11.8

func (pq *ProcessQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Process IDs.

func (*ProcessQuery) IDsX added in v0.11.8

func (pq *ProcessQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ProcessQuery) Limit added in v0.11.8

func (pq *ProcessQuery) Limit(limit int) *ProcessQuery

Limit the number of records to be returned by this query.

func (*ProcessQuery) Offset added in v0.11.8

func (pq *ProcessQuery) Offset(offset int) *ProcessQuery

Offset to start from.

func (*ProcessQuery) Only added in v0.11.8

func (pq *ProcessQuery) Only(ctx context.Context) (*Process, error)

Only returns a single Process entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Process entity is found. Returns a *NotFoundError when no Process entities are found.

func (*ProcessQuery) OnlyID added in v0.11.8

func (pq *ProcessQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Process ID in the query. Returns a *NotSingularError when more than one Process ID is found. Returns a *NotFoundError when no entities are found.

func (*ProcessQuery) OnlyIDX added in v0.11.8

func (pq *ProcessQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProcessQuery) OnlyX added in v0.11.8

func (pq *ProcessQuery) OnlyX(ctx context.Context) *Process

OnlyX is like Only, but panics if an error occurs.

func (*ProcessQuery) Order added in v0.11.8

func (pq *ProcessQuery) Order(o ...OrderFunc) *ProcessQuery

Order specifies how the records should be ordered.

func (*ProcessQuery) QueryAttachedFiles added in v0.11.8

func (pq *ProcessQuery) QueryAttachedFiles() *AttachedFileQuery

QueryAttachedFiles chains the current query on the "attached_files" edge.

func (*ProcessQuery) QueryFiles added in v0.11.8

func (pq *ProcessQuery) QueryFiles() *FileQuery

QueryFiles chains the current query on the "files" edge.

func (*ProcessQuery) Select added in v0.11.8

func (pq *ProcessQuery) Select(fields ...string) *ProcessSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*ProcessQuery) Unique added in v0.11.8

func (pq *ProcessQuery) Unique(unique bool) *ProcessQuery

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 (*ProcessQuery) Where added in v0.11.8

func (pq *ProcessQuery) Where(ps ...predicate.Process) *ProcessQuery

Where adds a new predicate for the ProcessQuery builder.

func (*ProcessQuery) WithAttachedFiles added in v0.11.8

func (pq *ProcessQuery) WithAttachedFiles(opts ...func(*AttachedFileQuery)) *ProcessQuery

WithAttachedFiles tells the query-builder to eager-load the nodes that are connected to the "attached_files" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProcessQuery) WithFiles added in v0.11.8

func (pq *ProcessQuery) WithFiles(opts ...func(*FileQuery)) *ProcessQuery

WithFiles tells the query-builder to eager-load the nodes that are connected to the "files" edge. The optional arguments are used to configure the query builder of the edge.

type ProcessSelect added in v0.11.8

type ProcessSelect struct {
	*ProcessQuery
	// contains filtered or unexported fields
}

ProcessSelect is the builder for selecting fields of Process entities.

func (*ProcessSelect) Aggregate added in v0.11.8

func (ps *ProcessSelect) Aggregate(fns ...AggregateFunc) *ProcessSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProcessSelect) Bool added in v0.11.8

func (s *ProcessSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) BoolX added in v0.11.8

func (s *ProcessSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProcessSelect) Bools added in v0.11.8

func (s *ProcessSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) BoolsX added in v0.11.8

func (s *ProcessSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProcessSelect) Float64 added in v0.11.8

func (s *ProcessSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) Float64X added in v0.11.8

func (s *ProcessSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProcessSelect) Float64s added in v0.11.8

func (s *ProcessSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) Float64sX added in v0.11.8

func (s *ProcessSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProcessSelect) Int added in v0.11.8

func (s *ProcessSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) IntX added in v0.11.8

func (s *ProcessSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProcessSelect) Ints added in v0.11.8

func (s *ProcessSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) IntsX added in v0.11.8

func (s *ProcessSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProcessSelect) Scan added in v0.11.8

func (ps *ProcessSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProcessSelect) ScanX added in v0.11.8

func (s *ProcessSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProcessSelect) String added in v0.11.8

func (s *ProcessSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) StringX added in v0.11.8

func (s *ProcessSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProcessSelect) Strings added in v0.11.8

func (s *ProcessSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProcessSelect) StringsX added in v0.11.8

func (s *ProcessSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProcessUpdate added in v0.11.8

type ProcessUpdate struct {
	// contains filtered or unexported fields
}

ProcessUpdate is the builder for updating Process entities.

func (*ProcessUpdate) AddAttachedFileIDs added in v0.11.8

func (pu *ProcessUpdate) AddAttachedFileIDs(ids ...int) *ProcessUpdate

AddAttachedFileIDs adds the "attached_files" edge to the AttachedFile entity by IDs.

func (*ProcessUpdate) AddAttachedFiles added in v0.11.8

func (pu *ProcessUpdate) AddAttachedFiles(a ...*AttachedFile) *ProcessUpdate

AddAttachedFiles adds the "attached_files" edges to the AttachedFile entity.

func (*ProcessUpdate) AddFileIDs added in v0.11.8

func (pu *ProcessUpdate) AddFileIDs(ids ...int) *ProcessUpdate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*ProcessUpdate) AddFiles added in v0.11.8

func (pu *ProcessUpdate) AddFiles(f ...*File) *ProcessUpdate

AddFiles adds the "files" edges to the File entity.

func (*ProcessUpdate) ClearAttachedFiles added in v0.11.8

func (pu *ProcessUpdate) ClearAttachedFiles() *ProcessUpdate

ClearAttachedFiles clears all "attached_files" edges to the AttachedFile entity.

func (*ProcessUpdate) ClearFiles added in v0.11.8

func (pu *ProcessUpdate) ClearFiles() *ProcessUpdate

ClearFiles clears all "files" edges to the File entity.

func (*ProcessUpdate) Exec added in v0.11.8

func (pu *ProcessUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessUpdate) ExecX added in v0.11.8

func (pu *ProcessUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessUpdate) Mutation added in v0.11.8

func (pu *ProcessUpdate) Mutation() *ProcessMutation

Mutation returns the ProcessMutation object of the builder.

func (*ProcessUpdate) RemoveAttachedFileIDs added in v0.11.8

func (pu *ProcessUpdate) RemoveAttachedFileIDs(ids ...int) *ProcessUpdate

RemoveAttachedFileIDs removes the "attached_files" edge to AttachedFile entities by IDs.

func (*ProcessUpdate) RemoveAttachedFiles added in v0.11.8

func (pu *ProcessUpdate) RemoveAttachedFiles(a ...*AttachedFile) *ProcessUpdate

RemoveAttachedFiles removes "attached_files" edges to AttachedFile entities.

func (*ProcessUpdate) RemoveFileIDs added in v0.11.8

func (pu *ProcessUpdate) RemoveFileIDs(ids ...int) *ProcessUpdate

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*ProcessUpdate) RemoveFiles added in v0.11.8

func (pu *ProcessUpdate) RemoveFiles(f ...*File) *ProcessUpdate

RemoveFiles removes "files" edges to File entities.

func (*ProcessUpdate) Save added in v0.11.8

func (pu *ProcessUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProcessUpdate) SaveX added in v0.11.8

func (pu *ProcessUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProcessUpdate) Where added in v0.11.8

func (pu *ProcessUpdate) Where(ps ...predicate.Process) *ProcessUpdate

Where appends a list predicates to the ProcessUpdate builder.

type ProcessUpdateOne added in v0.11.8

type ProcessUpdateOne struct {
	// contains filtered or unexported fields
}

ProcessUpdateOne is the builder for updating a single Process entity.

func (*ProcessUpdateOne) AddAttachedFileIDs added in v0.11.8

func (puo *ProcessUpdateOne) AddAttachedFileIDs(ids ...int) *ProcessUpdateOne

AddAttachedFileIDs adds the "attached_files" edge to the AttachedFile entity by IDs.

func (*ProcessUpdateOne) AddAttachedFiles added in v0.11.8

func (puo *ProcessUpdateOne) AddAttachedFiles(a ...*AttachedFile) *ProcessUpdateOne

AddAttachedFiles adds the "attached_files" edges to the AttachedFile entity.

func (*ProcessUpdateOne) AddFileIDs added in v0.11.8

func (puo *ProcessUpdateOne) AddFileIDs(ids ...int) *ProcessUpdateOne

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*ProcessUpdateOne) AddFiles added in v0.11.8

func (puo *ProcessUpdateOne) AddFiles(f ...*File) *ProcessUpdateOne

AddFiles adds the "files" edges to the File entity.

func (*ProcessUpdateOne) ClearAttachedFiles added in v0.11.8

func (puo *ProcessUpdateOne) ClearAttachedFiles() *ProcessUpdateOne

ClearAttachedFiles clears all "attached_files" edges to the AttachedFile entity.

func (*ProcessUpdateOne) ClearFiles added in v0.11.8

func (puo *ProcessUpdateOne) ClearFiles() *ProcessUpdateOne

ClearFiles clears all "files" edges to the File entity.

func (*ProcessUpdateOne) Exec added in v0.11.8

func (puo *ProcessUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProcessUpdateOne) ExecX added in v0.11.8

func (puo *ProcessUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessUpdateOne) Mutation added in v0.11.8

func (puo *ProcessUpdateOne) Mutation() *ProcessMutation

Mutation returns the ProcessMutation object of the builder.

func (*ProcessUpdateOne) RemoveAttachedFileIDs added in v0.11.8

func (puo *ProcessUpdateOne) RemoveAttachedFileIDs(ids ...int) *ProcessUpdateOne

RemoveAttachedFileIDs removes the "attached_files" edge to AttachedFile entities by IDs.

func (*ProcessUpdateOne) RemoveAttachedFiles added in v0.11.8

func (puo *ProcessUpdateOne) RemoveAttachedFiles(a ...*AttachedFile) *ProcessUpdateOne

RemoveAttachedFiles removes "attached_files" edges to AttachedFile entities.

func (*ProcessUpdateOne) RemoveFileIDs added in v0.11.8

func (puo *ProcessUpdateOne) RemoveFileIDs(ids ...int) *ProcessUpdateOne

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*ProcessUpdateOne) RemoveFiles added in v0.11.8

func (puo *ProcessUpdateOne) RemoveFiles(f ...*File) *ProcessUpdateOne

RemoveFiles removes "files" edges to File entities.

func (*ProcessUpdateOne) Save added in v0.11.8

func (puo *ProcessUpdateOne) Save(ctx context.Context) (*Process, error)

Save executes the query and returns the updated Process entity.

func (*ProcessUpdateOne) SaveX added in v0.11.8

func (puo *ProcessUpdateOne) SaveX(ctx context.Context) *Process

SaveX is like Save, but panics if an error occurs.

func (*ProcessUpdateOne) Select added in v0.11.8

func (puo *ProcessUpdateOne) Select(field string, fields ...string) *ProcessUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProcessUpdateOne) Where added in v0.11.8

Where appends a list predicates to the ProcessUpdate builder.

type ProcessUpsert added in v0.11.8

type ProcessUpsert struct {
	*sql.UpdateSet
}

ProcessUpsert is the "OnConflict" setter.

type ProcessUpsertBulk added in v0.11.8

type ProcessUpsertBulk struct {
	// contains filtered or unexported fields
}

ProcessUpsertBulk is the builder for "upsert"-ing a bulk of Process nodes.

func (*ProcessUpsertBulk) DoNothing added in v0.11.8

func (u *ProcessUpsertBulk) DoNothing() *ProcessUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ProcessUpsertBulk) Exec added in v0.11.8

func (u *ProcessUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessUpsertBulk) ExecX added in v0.11.8

func (u *ProcessUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessUpsertBulk) Ignore added in v0.11.8

func (u *ProcessUpsertBulk) Ignore() *ProcessUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Process.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ProcessUpsertBulk) Update added in v0.11.8

func (u *ProcessUpsertBulk) Update(set func(*ProcessUpsert)) *ProcessUpsertBulk

Update allows overriding fields `UPDATE` values. See the ProcessCreateBulk.OnConflict documentation for more info.

func (*ProcessUpsertBulk) UpdateNewValues added in v0.11.8

func (u *ProcessUpsertBulk) UpdateNewValues() *ProcessUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Process.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type ProcessUpsertOne added in v0.11.8

type ProcessUpsertOne struct {
	// contains filtered or unexported fields
}

ProcessUpsertOne is the builder for "upsert"-ing

one Process node.

func (*ProcessUpsertOne) DoNothing added in v0.11.8

func (u *ProcessUpsertOne) DoNothing() *ProcessUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ProcessUpsertOne) Exec added in v0.11.8

func (u *ProcessUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessUpsertOne) ExecX added in v0.11.8

func (u *ProcessUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProcessUpsertOne) ID added in v0.11.8

func (u *ProcessUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ProcessUpsertOne) IDX added in v0.11.8

func (u *ProcessUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ProcessUpsertOne) Ignore added in v0.11.8

func (u *ProcessUpsertOne) Ignore() *ProcessUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Process.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ProcessUpsertOne) Update added in v0.11.8

func (u *ProcessUpsertOne) Update(set func(*ProcessUpsert)) *ProcessUpsertOne

Update allows overriding fields `UPDATE` values. See the ProcessCreate.OnConflict documentation for more info.

func (*ProcessUpsertOne) UpdateNewValues added in v0.11.8

func (u *ProcessUpsertOne) UpdateNewValues() *ProcessUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Process.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Processes added in v0.11.8

type Processes []*Process

Processes is a parsable slice of Process.

type Querier added in v0.11.5

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc added in v0.11.5

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 added in v0.11.6

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Relationship

type Relationship struct {

	// Weight holds the value of the "weight" field.
	Weight int `json:"weight,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// RelativeID holds the value of the "relative_id" field.
	RelativeID int `json:"relative_id,omitempty"`
	// InfoID holds the value of the "info_id" field.
	InfoID int `json:"info_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RelationshipQuery when eager-loading is set.
	Edges RelationshipEdges `json:"edges"`
	// contains filtered or unexported fields
}

Relationship is the model entity for the Relationship schema.

func (*Relationship) QueryInfo

func (r *Relationship) QueryInfo() *RelationshipInfoQuery

QueryInfo queries the "info" edge of the Relationship entity.

func (*Relationship) QueryRelative

func (r *Relationship) QueryRelative() *UserQuery

QueryRelative queries the "relative" edge of the Relationship entity.

func (*Relationship) QueryUser

func (r *Relationship) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Relationship entity.

func (*Relationship) String

func (r *Relationship) String() string

String implements the fmt.Stringer.

func (*Relationship) Unwrap

func (r *Relationship) Unwrap() *Relationship

Unwrap unwraps the Relationship 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 (*Relationship) Update

func (r *Relationship) Update() *RelationshipUpdateOne

Update returns a builder for updating this Relationship. Note that you need to call Relationship.Unwrap() before calling this method if this Relationship was returned from a transaction, and the transaction was committed or rolled back.

type RelationshipClient

type RelationshipClient struct {
	// contains filtered or unexported fields
}

RelationshipClient is a client for the Relationship schema.

func NewRelationshipClient

func NewRelationshipClient(c config) *RelationshipClient

NewRelationshipClient returns a client for the Relationship from the given config.

func (*RelationshipClient) Create

Create returns a builder for creating a Relationship entity.

func (*RelationshipClient) CreateBulk

func (c *RelationshipClient) CreateBulk(builders ...*RelationshipCreate) *RelationshipCreateBulk

CreateBulk returns a builder for creating a bulk of Relationship entities.

func (*RelationshipClient) Delete

Delete returns a delete builder for Relationship.

func (*RelationshipClient) Hooks

func (c *RelationshipClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RelationshipClient) Intercept added in v0.11.5

func (c *RelationshipClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `relationship.Intercept(f(g(h())))`.

func (*RelationshipClient) Interceptors added in v0.11.5

func (c *RelationshipClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RelationshipClient) Query

Query returns a query builder for Relationship.

func (*RelationshipClient) QueryInfo

QueryInfo queries the info edge of a Relationship.

func (*RelationshipClient) QueryRelative

func (c *RelationshipClient) QueryRelative(r *Relationship) *UserQuery

QueryRelative queries the relative edge of a Relationship.

func (*RelationshipClient) QueryUser

func (c *RelationshipClient) QueryUser(r *Relationship) *UserQuery

QueryUser queries the user edge of a Relationship.

func (*RelationshipClient) Update

Update returns an update builder for Relationship.

func (*RelationshipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RelationshipClient) Use

func (c *RelationshipClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `relationship.Hooks(f(g(h())))`.

type RelationshipCreate

type RelationshipCreate struct {
	// contains filtered or unexported fields
}

RelationshipCreate is the builder for creating a Relationship entity.

func (*RelationshipCreate) Exec

func (rc *RelationshipCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RelationshipCreate) ExecX

func (rc *RelationshipCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipCreate) Mutation

func (rc *RelationshipCreate) Mutation() *RelationshipMutation

Mutation returns the RelationshipMutation object of the builder.

func (*RelationshipCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Relationship.Create().
	SetWeight(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RelationshipUpsert) {
		SetWeight(v+v).
	}).
	Exec(ctx)

func (*RelationshipCreate) OnConflictColumns

func (rc *RelationshipCreate) OnConflictColumns(columns ...string) *RelationshipUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Relationship.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RelationshipCreate) Save

Save creates the Relationship in the database.

func (*RelationshipCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RelationshipCreate) SetInfo

SetInfo sets the "info" edge to the RelationshipInfo entity.

func (*RelationshipCreate) SetInfoID

func (rc *RelationshipCreate) SetInfoID(i int) *RelationshipCreate

SetInfoID sets the "info_id" field.

func (*RelationshipCreate) SetNillableInfoID

func (rc *RelationshipCreate) SetNillableInfoID(i *int) *RelationshipCreate

SetNillableInfoID sets the "info_id" field if the given value is not nil.

func (*RelationshipCreate) SetNillableWeight

func (rc *RelationshipCreate) SetNillableWeight(i *int) *RelationshipCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*RelationshipCreate) SetRelative

func (rc *RelationshipCreate) SetRelative(u *User) *RelationshipCreate

SetRelative sets the "relative" edge to the User entity.

func (*RelationshipCreate) SetRelativeID

func (rc *RelationshipCreate) SetRelativeID(i int) *RelationshipCreate

SetRelativeID sets the "relative_id" field.

func (*RelationshipCreate) SetUser

func (rc *RelationshipCreate) SetUser(u *User) *RelationshipCreate

SetUser sets the "user" edge to the User entity.

func (*RelationshipCreate) SetUserID

func (rc *RelationshipCreate) SetUserID(i int) *RelationshipCreate

SetUserID sets the "user_id" field.

func (*RelationshipCreate) SetWeight

func (rc *RelationshipCreate) SetWeight(i int) *RelationshipCreate

SetWeight sets the "weight" field.

type RelationshipCreateBulk

type RelationshipCreateBulk struct {
	// contains filtered or unexported fields
}

RelationshipCreateBulk is the builder for creating many Relationship entities in bulk.

func (*RelationshipCreateBulk) Exec

Exec executes the query.

func (*RelationshipCreateBulk) ExecX

func (rcb *RelationshipCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Relationship.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RelationshipUpsert) {
		SetWeight(v+v).
	}).
	Exec(ctx)

func (*RelationshipCreateBulk) OnConflictColumns

func (rcb *RelationshipCreateBulk) OnConflictColumns(columns ...string) *RelationshipUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Relationship.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RelationshipCreateBulk) Save

Save creates the Relationship entities in the database.

func (*RelationshipCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type RelationshipDelete

type RelationshipDelete struct {
	// contains filtered or unexported fields
}

RelationshipDelete is the builder for deleting a Relationship entity.

func (*RelationshipDelete) Exec

func (rd *RelationshipDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RelationshipDelete) ExecX

func (rd *RelationshipDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipDelete) Where

Where appends a list predicates to the RelationshipDelete builder.

type RelationshipDeleteOne

type RelationshipDeleteOne struct {
	// contains filtered or unexported fields
}

RelationshipDeleteOne is the builder for deleting a single Relationship entity.

func (*RelationshipDeleteOne) Exec

func (rdo *RelationshipDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RelationshipDeleteOne) ExecX

func (rdo *RelationshipDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipDeleteOne) Where added in v0.11.7

Where appends a list predicates to the RelationshipDelete builder.

type RelationshipEdges

type RelationshipEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Relative holds the value of the relative edge.
	Relative *User `json:"relative,omitempty"`
	// Info holds the value of the info edge.
	Info *RelationshipInfo `json:"info,omitempty"`
	// contains filtered or unexported fields
}

RelationshipEdges holds the relations/edges for other nodes in the graph.

func (RelationshipEdges) InfoOrErr

func (e RelationshipEdges) InfoOrErr() (*RelationshipInfo, error)

InfoOrErr returns the Info value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RelationshipEdges) RelativeOrErr

func (e RelationshipEdges) RelativeOrErr() (*User, error)

RelativeOrErr returns the Relative value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RelationshipEdges) UserOrErr

func (e RelationshipEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RelationshipFilter added in v0.11.2

type RelationshipFilter struct {
	// contains filtered or unexported fields
}

RelationshipFilter provides a generic filtering capability at runtime for RelationshipQuery.

func (*RelationshipFilter) Where added in v0.11.2

func (f *RelationshipFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*RelationshipFilter) WhereHasInfo added in v0.11.2

func (f *RelationshipFilter) WhereHasInfo()

WhereHasInfo applies a predicate to check if query has an edge info.

func (*RelationshipFilter) WhereHasInfoWith added in v0.11.2

func (f *RelationshipFilter) WhereHasInfoWith(preds ...predicate.RelationshipInfo)

WhereHasInfoWith applies a predicate to check if query has an edge info with a given conditions (other predicates).

func (*RelationshipFilter) WhereHasRelative added in v0.11.2

func (f *RelationshipFilter) WhereHasRelative()

WhereHasRelative applies a predicate to check if query has an edge relative.

func (*RelationshipFilter) WhereHasRelativeWith added in v0.11.2

func (f *RelationshipFilter) WhereHasRelativeWith(preds ...predicate.User)

WhereHasRelativeWith applies a predicate to check if query has an edge relative with a given conditions (other predicates).

func (*RelationshipFilter) WhereHasUser added in v0.11.2

func (f *RelationshipFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*RelationshipFilter) WhereHasUserWith added in v0.11.2

func (f *RelationshipFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*RelationshipFilter) WhereInfoID added in v0.11.2

func (f *RelationshipFilter) WhereInfoID(p entql.IntP)

WhereInfoID applies the entql int predicate on the info_id field.

func (*RelationshipFilter) WhereRelativeID added in v0.11.2

func (f *RelationshipFilter) WhereRelativeID(p entql.IntP)

WhereRelativeID applies the entql int predicate on the relative_id field.

func (*RelationshipFilter) WhereUserID added in v0.11.2

func (f *RelationshipFilter) WhereUserID(p entql.IntP)

WhereUserID applies the entql int predicate on the user_id field.

func (*RelationshipFilter) WhereWeight added in v0.11.2

func (f *RelationshipFilter) WhereWeight(p entql.IntP)

WhereWeight applies the entql int predicate on the weight field.

type RelationshipGroupBy

type RelationshipGroupBy struct {
	// contains filtered or unexported fields
}

RelationshipGroupBy is the group-by builder for Relationship entities.

func (*RelationshipGroupBy) Aggregate

func (rgb *RelationshipGroupBy) Aggregate(fns ...AggregateFunc) *RelationshipGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RelationshipGroupBy) Bool

func (s *RelationshipGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) BoolX

func (s *RelationshipGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RelationshipGroupBy) Bools

func (s *RelationshipGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) BoolsX

func (s *RelationshipGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RelationshipGroupBy) Float64

func (s *RelationshipGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) Float64X

func (s *RelationshipGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RelationshipGroupBy) Float64s

func (s *RelationshipGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) Float64sX

func (s *RelationshipGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RelationshipGroupBy) Int

func (s *RelationshipGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) IntX

func (s *RelationshipGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RelationshipGroupBy) Ints

func (s *RelationshipGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) IntsX

func (s *RelationshipGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RelationshipGroupBy) Scan

func (rgb *RelationshipGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RelationshipGroupBy) ScanX

func (s *RelationshipGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RelationshipGroupBy) String

func (s *RelationshipGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) StringX

func (s *RelationshipGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RelationshipGroupBy) Strings

func (s *RelationshipGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RelationshipGroupBy) StringsX

func (s *RelationshipGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RelationshipInfo

type RelationshipInfo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// contains filtered or unexported fields
}

RelationshipInfo is the model entity for the RelationshipInfo schema.

func (*RelationshipInfo) String

func (ri *RelationshipInfo) String() string

String implements the fmt.Stringer.

func (*RelationshipInfo) Unwrap

func (ri *RelationshipInfo) Unwrap() *RelationshipInfo

Unwrap unwraps the RelationshipInfo 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 (*RelationshipInfo) Update

Update returns a builder for updating this RelationshipInfo. Note that you need to call RelationshipInfo.Unwrap() before calling this method if this RelationshipInfo was returned from a transaction, and the transaction was committed or rolled back.

type RelationshipInfoClient

type RelationshipInfoClient struct {
	// contains filtered or unexported fields
}

RelationshipInfoClient is a client for the RelationshipInfo schema.

func NewRelationshipInfoClient

func NewRelationshipInfoClient(c config) *RelationshipInfoClient

NewRelationshipInfoClient returns a client for the RelationshipInfo from the given config.

func (*RelationshipInfoClient) Create

Create returns a builder for creating a RelationshipInfo entity.

func (*RelationshipInfoClient) CreateBulk

CreateBulk returns a builder for creating a bulk of RelationshipInfo entities.

func (*RelationshipInfoClient) Delete

Delete returns a delete builder for RelationshipInfo.

func (*RelationshipInfoClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RelationshipInfoClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RelationshipInfoClient) Get

Get returns a RelationshipInfo entity by its id.

func (*RelationshipInfoClient) GetX

GetX is like Get, but panics if an error occurs.

func (*RelationshipInfoClient) Hooks

func (c *RelationshipInfoClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RelationshipInfoClient) Intercept added in v0.11.5

func (c *RelationshipInfoClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `relationshipinfo.Intercept(f(g(h())))`.

func (*RelationshipInfoClient) Interceptors added in v0.11.5

func (c *RelationshipInfoClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RelationshipInfoClient) Query

Query returns a query builder for RelationshipInfo.

func (*RelationshipInfoClient) Update

Update returns an update builder for RelationshipInfo.

func (*RelationshipInfoClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RelationshipInfoClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RelationshipInfoClient) Use

func (c *RelationshipInfoClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `relationshipinfo.Hooks(f(g(h())))`.

type RelationshipInfoCreate

type RelationshipInfoCreate struct {
	// contains filtered or unexported fields
}

RelationshipInfoCreate is the builder for creating a RelationshipInfo entity.

func (*RelationshipInfoCreate) Exec

Exec executes the query.

func (*RelationshipInfoCreate) ExecX

func (ric *RelationshipInfoCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoCreate) Mutation

Mutation returns the RelationshipInfoMutation object of the builder.

func (*RelationshipInfoCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.RelationshipInfo.Create().
	SetText(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RelationshipInfoUpsert) {
		SetText(v+v).
	}).
	Exec(ctx)

func (*RelationshipInfoCreate) OnConflictColumns

func (ric *RelationshipInfoCreate) OnConflictColumns(columns ...string) *RelationshipInfoUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.RelationshipInfo.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RelationshipInfoCreate) Save

Save creates the RelationshipInfo in the database.

func (*RelationshipInfoCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RelationshipInfoCreate) SetText

SetText sets the "text" field.

type RelationshipInfoCreateBulk

type RelationshipInfoCreateBulk struct {
	// contains filtered or unexported fields
}

RelationshipInfoCreateBulk is the builder for creating many RelationshipInfo entities in bulk.

func (*RelationshipInfoCreateBulk) Exec

Exec executes the query.

func (*RelationshipInfoCreateBulk) ExecX

func (ricb *RelationshipInfoCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.RelationshipInfo.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RelationshipInfoUpsert) {
		SetText(v+v).
	}).
	Exec(ctx)

func (*RelationshipInfoCreateBulk) OnConflictColumns

func (ricb *RelationshipInfoCreateBulk) OnConflictColumns(columns ...string) *RelationshipInfoUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.RelationshipInfo.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RelationshipInfoCreateBulk) Save

Save creates the RelationshipInfo entities in the database.

func (*RelationshipInfoCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type RelationshipInfoDelete

type RelationshipInfoDelete struct {
	// contains filtered or unexported fields
}

RelationshipInfoDelete is the builder for deleting a RelationshipInfo entity.

func (*RelationshipInfoDelete) Exec

func (rid *RelationshipInfoDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RelationshipInfoDelete) ExecX

func (rid *RelationshipInfoDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoDelete) Where

Where appends a list predicates to the RelationshipInfoDelete builder.

type RelationshipInfoDeleteOne

type RelationshipInfoDeleteOne struct {
	// contains filtered or unexported fields
}

RelationshipInfoDeleteOne is the builder for deleting a single RelationshipInfo entity.

func (*RelationshipInfoDeleteOne) Exec

Exec executes the deletion query.

func (*RelationshipInfoDeleteOne) ExecX

func (rido *RelationshipInfoDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoDeleteOne) Where added in v0.11.7

Where appends a list predicates to the RelationshipInfoDelete builder.

type RelationshipInfoFilter added in v0.11.2

type RelationshipInfoFilter struct {
	// contains filtered or unexported fields
}

RelationshipInfoFilter provides a generic filtering capability at runtime for RelationshipInfoQuery.

func (*RelationshipInfoFilter) Where added in v0.11.2

func (f *RelationshipInfoFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*RelationshipInfoFilter) WhereID added in v0.11.2

func (f *RelationshipInfoFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*RelationshipInfoFilter) WhereText added in v0.11.2

func (f *RelationshipInfoFilter) WhereText(p entql.StringP)

WhereText applies the entql string predicate on the text field.

type RelationshipInfoGroupBy

type RelationshipInfoGroupBy struct {
	// contains filtered or unexported fields
}

RelationshipInfoGroupBy is the group-by builder for RelationshipInfo entities.

func (*RelationshipInfoGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*RelationshipInfoGroupBy) Bool

func (s *RelationshipInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) BoolX

func (s *RelationshipInfoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Bools

func (s *RelationshipInfoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) BoolsX

func (s *RelationshipInfoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Float64

func (s *RelationshipInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) Float64X

func (s *RelationshipInfoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Float64s

func (s *RelationshipInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) Float64sX

func (s *RelationshipInfoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Int

func (s *RelationshipInfoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) IntX

func (s *RelationshipInfoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Ints

func (s *RelationshipInfoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) IntsX

func (s *RelationshipInfoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Scan

func (rigb *RelationshipInfoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RelationshipInfoGroupBy) ScanX

func (s *RelationshipInfoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RelationshipInfoGroupBy) String

func (s *RelationshipInfoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) StringX

func (s *RelationshipInfoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RelationshipInfoGroupBy) Strings

func (s *RelationshipInfoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoGroupBy) StringsX

func (s *RelationshipInfoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RelationshipInfoMutation

type RelationshipInfoMutation struct {
	// contains filtered or unexported fields
}

RelationshipInfoMutation represents an operation that mutates the RelationshipInfo nodes in the graph.

func (*RelationshipInfoMutation) AddField

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) AddedEdges

func (m *RelationshipInfoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RelationshipInfoMutation) AddedField

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) AddedFields

func (m *RelationshipInfoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RelationshipInfoMutation) AddedIDs

func (m *RelationshipInfoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RelationshipInfoMutation) ClearEdge

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) ClearField

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) ClearedEdges

func (m *RelationshipInfoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RelationshipInfoMutation) ClearedFields

func (m *RelationshipInfoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RelationshipInfoMutation) Client

func (m RelationshipInfoMutation) 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 (*RelationshipInfoMutation) EdgeCleared

func (m *RelationshipInfoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RelationshipInfoMutation) Field

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) FieldCleared

func (m *RelationshipInfoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RelationshipInfoMutation) Fields

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) Filter added in v0.11.2

Filter returns an entql.Where implementation to apply filters on the RelationshipInfoMutation builder.

func (*RelationshipInfoMutation) ID

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*RelationshipInfoMutation) OldField

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) OldText

func (m *RelationshipInfoMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the RelationshipInfo entity. If the RelationshipInfo 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 (*RelationshipInfoMutation) Op

func (m *RelationshipInfoMutation) Op() Op

Op returns the operation name.

func (*RelationshipInfoMutation) RemovedEdges

func (m *RelationshipInfoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RelationshipInfoMutation) RemovedIDs

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) ResetEdge

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) ResetField

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) ResetText

func (m *RelationshipInfoMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*RelationshipInfoMutation) SetField

func (m *RelationshipInfoMutation) 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 (*RelationshipInfoMutation) SetOp added in v0.11.5

func (m *RelationshipInfoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RelationshipInfoMutation) SetText

func (m *RelationshipInfoMutation) SetText(s string)

SetText sets the "text" field.

func (*RelationshipInfoMutation) Text

func (m *RelationshipInfoMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (RelationshipInfoMutation) Tx

func (m RelationshipInfoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RelationshipInfoMutation) Type

func (m *RelationshipInfoMutation) Type() string

Type returns the node type of this mutation (RelationshipInfo).

func (*RelationshipInfoMutation) Where

Where appends a list predicates to the RelationshipInfoMutation builder.

func (*RelationshipInfoMutation) WhereP added in v0.11.5

func (m *RelationshipInfoMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RelationshipInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RelationshipInfoQuery

type RelationshipInfoQuery struct {
	// contains filtered or unexported fields
}

RelationshipInfoQuery is the builder for querying RelationshipInfo entities.

func (*RelationshipInfoQuery) Aggregate added in v0.11.4

Aggregate returns a RelationshipInfoSelect configured with the given aggregations.

func (*RelationshipInfoQuery) All

All executes the query and returns a list of RelationshipInfos.

func (*RelationshipInfoQuery) AllX

AllX is like All, but panics if an error occurs.

func (*RelationshipInfoQuery) Clone

Clone returns a duplicate of the RelationshipInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RelationshipInfoQuery) Count

func (riq *RelationshipInfoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RelationshipInfoQuery) CountX

func (riq *RelationshipInfoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RelationshipInfoQuery) Exist

func (riq *RelationshipInfoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RelationshipInfoQuery) ExistX

func (riq *RelationshipInfoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RelationshipInfoQuery) Filter added in v0.11.2

Filter returns a Filter implementation to apply filters on the RelationshipInfoQuery builder.

func (*RelationshipInfoQuery) First

First returns the first RelationshipInfo entity from the query. Returns a *NotFoundError when no RelationshipInfo was found.

func (*RelationshipInfoQuery) FirstID

func (riq *RelationshipInfoQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first RelationshipInfo ID from the query. Returns a *NotFoundError when no RelationshipInfo ID was found.

func (*RelationshipInfoQuery) FirstIDX

func (riq *RelationshipInfoQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RelationshipInfoQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*RelationshipInfoQuery) GroupBy

func (riq *RelationshipInfoQuery) GroupBy(field string, fields ...string) *RelationshipInfoGroupBy

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.RelationshipInfo.Query().
	GroupBy(relationshipinfo.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RelationshipInfoQuery) IDs

func (riq *RelationshipInfoQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of RelationshipInfo IDs.

func (*RelationshipInfoQuery) IDsX

func (riq *RelationshipInfoQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RelationshipInfoQuery) Limit

func (riq *RelationshipInfoQuery) Limit(limit int) *RelationshipInfoQuery

Limit the number of records to be returned by this query.

func (*RelationshipInfoQuery) Offset

func (riq *RelationshipInfoQuery) Offset(offset int) *RelationshipInfoQuery

Offset to start from.

func (*RelationshipInfoQuery) Only

Only returns a single RelationshipInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RelationshipInfo entity is found. Returns a *NotFoundError when no RelationshipInfo entities are found.

func (*RelationshipInfoQuery) OnlyID

func (riq *RelationshipInfoQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only RelationshipInfo ID in the query. Returns a *NotSingularError when more than one RelationshipInfo ID is found. Returns a *NotFoundError when no entities are found.

func (*RelationshipInfoQuery) OnlyIDX

func (riq *RelationshipInfoQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RelationshipInfoQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*RelationshipInfoQuery) Order

Order specifies how the records should be ordered.

func (*RelationshipInfoQuery) Select

func (riq *RelationshipInfoQuery) Select(fields ...string) *RelationshipInfoSelect

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.RelationshipInfo.Query().
	Select(relationshipinfo.FieldText).
	Scan(ctx, &v)

func (*RelationshipInfoQuery) Unique

func (riq *RelationshipInfoQuery) Unique(unique bool) *RelationshipInfoQuery

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 (*RelationshipInfoQuery) Where

Where adds a new predicate for the RelationshipInfoQuery builder.

type RelationshipInfoSelect

type RelationshipInfoSelect struct {
	*RelationshipInfoQuery
	// contains filtered or unexported fields
}

RelationshipInfoSelect is the builder for selecting fields of RelationshipInfo entities.

func (*RelationshipInfoSelect) Aggregate added in v0.11.4

Aggregate adds the given aggregation functions to the selector query.

func (*RelationshipInfoSelect) Bool

func (s *RelationshipInfoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) BoolX

func (s *RelationshipInfoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RelationshipInfoSelect) Bools

func (s *RelationshipInfoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) BoolsX

func (s *RelationshipInfoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RelationshipInfoSelect) Float64

func (s *RelationshipInfoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) Float64X

func (s *RelationshipInfoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RelationshipInfoSelect) Float64s

func (s *RelationshipInfoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) Float64sX

func (s *RelationshipInfoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RelationshipInfoSelect) Int

func (s *RelationshipInfoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) IntX

func (s *RelationshipInfoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RelationshipInfoSelect) Ints

func (s *RelationshipInfoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) IntsX

func (s *RelationshipInfoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RelationshipInfoSelect) Scan

func (ris *RelationshipInfoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RelationshipInfoSelect) ScanX

func (s *RelationshipInfoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RelationshipInfoSelect) String

func (s *RelationshipInfoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) StringX

func (s *RelationshipInfoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RelationshipInfoSelect) Strings

func (s *RelationshipInfoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RelationshipInfoSelect) StringsX

func (s *RelationshipInfoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RelationshipInfoUpdate

type RelationshipInfoUpdate struct {
	// contains filtered or unexported fields
}

RelationshipInfoUpdate is the builder for updating RelationshipInfo entities.

func (*RelationshipInfoUpdate) Exec

Exec executes the query.

func (*RelationshipInfoUpdate) ExecX

func (riu *RelationshipInfoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoUpdate) Mutation

Mutation returns the RelationshipInfoMutation object of the builder.

func (*RelationshipInfoUpdate) Save

func (riu *RelationshipInfoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RelationshipInfoUpdate) SaveX

func (riu *RelationshipInfoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RelationshipInfoUpdate) SetText

SetText sets the "text" field.

func (*RelationshipInfoUpdate) Where

Where appends a list predicates to the RelationshipInfoUpdate builder.

type RelationshipInfoUpdateOne

type RelationshipInfoUpdateOne struct {
	// contains filtered or unexported fields
}

RelationshipInfoUpdateOne is the builder for updating a single RelationshipInfo entity.

func (*RelationshipInfoUpdateOne) Exec

Exec executes the query on the entity.

func (*RelationshipInfoUpdateOne) ExecX

func (riuo *RelationshipInfoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoUpdateOne) Mutation

Mutation returns the RelationshipInfoMutation object of the builder.

func (*RelationshipInfoUpdateOne) Save

Save executes the query and returns the updated RelationshipInfo entity.

func (*RelationshipInfoUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*RelationshipInfoUpdateOne) Select

func (riuo *RelationshipInfoUpdateOne) Select(field string, fields ...string) *RelationshipInfoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RelationshipInfoUpdateOne) SetText

SetText sets the "text" field.

func (*RelationshipInfoUpdateOne) Where added in v0.11.8

Where appends a list predicates to the RelationshipInfoUpdate builder.

type RelationshipInfoUpsert

type RelationshipInfoUpsert struct {
	*sql.UpdateSet
}

RelationshipInfoUpsert is the "OnConflict" setter.

func (*RelationshipInfoUpsert) SetText

SetText sets the "text" field.

func (*RelationshipInfoUpsert) UpdateText

UpdateText sets the "text" field to the value that was provided on create.

type RelationshipInfoUpsertBulk

type RelationshipInfoUpsertBulk struct {
	// contains filtered or unexported fields
}

RelationshipInfoUpsertBulk is the builder for "upsert"-ing a bulk of RelationshipInfo nodes.

func (*RelationshipInfoUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RelationshipInfoUpsertBulk) Exec

Exec executes the query.

func (*RelationshipInfoUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.RelationshipInfo.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RelationshipInfoUpsertBulk) SetText

SetText sets the "text" field.

func (*RelationshipInfoUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the RelationshipInfoCreateBulk.OnConflict documentation for more info.

func (*RelationshipInfoUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.RelationshipInfo.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RelationshipInfoUpsertBulk) UpdateText

UpdateText sets the "text" field to the value that was provided on create.

type RelationshipInfoUpsertOne

type RelationshipInfoUpsertOne struct {
	// contains filtered or unexported fields
}

RelationshipInfoUpsertOne is the builder for "upsert"-ing

one RelationshipInfo node.

func (*RelationshipInfoUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RelationshipInfoUpsertOne) Exec

Exec executes the query.

func (*RelationshipInfoUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipInfoUpsertOne) ID

func (u *RelationshipInfoUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*RelationshipInfoUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*RelationshipInfoUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.RelationshipInfo.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RelationshipInfoUpsertOne) SetText

SetText sets the "text" field.

func (*RelationshipInfoUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the RelationshipInfoCreate.OnConflict documentation for more info.

func (*RelationshipInfoUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.RelationshipInfo.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RelationshipInfoUpsertOne) UpdateText

UpdateText sets the "text" field to the value that was provided on create.

type RelationshipInfos

type RelationshipInfos []*RelationshipInfo

RelationshipInfos is a parsable slice of RelationshipInfo.

type RelationshipMutation

type RelationshipMutation struct {
	// contains filtered or unexported fields
}

RelationshipMutation represents an operation that mutates the Relationship nodes in the graph.

func (*RelationshipMutation) AddField

func (m *RelationshipMutation) 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 (*RelationshipMutation) AddWeight

func (m *RelationshipMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*RelationshipMutation) AddedEdges

func (m *RelationshipMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RelationshipMutation) AddedField

func (m *RelationshipMutation) 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 (*RelationshipMutation) AddedFields

func (m *RelationshipMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RelationshipMutation) AddedIDs

func (m *RelationshipMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RelationshipMutation) AddedWeight

func (m *RelationshipMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*RelationshipMutation) ClearEdge

func (m *RelationshipMutation) 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 (*RelationshipMutation) ClearField

func (m *RelationshipMutation) 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 (*RelationshipMutation) ClearInfo

func (m *RelationshipMutation) ClearInfo()

ClearInfo clears the "info" edge to the RelationshipInfo entity.

func (*RelationshipMutation) ClearInfoID

func (m *RelationshipMutation) ClearInfoID()

ClearInfoID clears the value of the "info_id" field.

func (*RelationshipMutation) ClearRelative

func (m *RelationshipMutation) ClearRelative()

ClearRelative clears the "relative" edge to the User entity.

func (*RelationshipMutation) ClearUser

func (m *RelationshipMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*RelationshipMutation) ClearedEdges

func (m *RelationshipMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RelationshipMutation) ClearedFields

func (m *RelationshipMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RelationshipMutation) Client

func (m RelationshipMutation) 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 (*RelationshipMutation) EdgeCleared

func (m *RelationshipMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RelationshipMutation) Field

func (m *RelationshipMutation) 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 (*RelationshipMutation) FieldCleared

func (m *RelationshipMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RelationshipMutation) Fields

func (m *RelationshipMutation) 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 (*RelationshipMutation) Filter added in v0.11.2

Filter returns an entql.Where implementation to apply filters on the RelationshipMutation builder.

func (*RelationshipMutation) InfoCleared

func (m *RelationshipMutation) InfoCleared() bool

InfoCleared reports if the "info" edge to the RelationshipInfo entity was cleared.

func (*RelationshipMutation) InfoID

func (m *RelationshipMutation) InfoID() (r int, exists bool)

InfoID returns the value of the "info_id" field in the mutation.

func (*RelationshipMutation) InfoIDCleared

func (m *RelationshipMutation) InfoIDCleared() bool

InfoIDCleared returns if the "info_id" field was cleared in this mutation.

func (*RelationshipMutation) InfoIDs

func (m *RelationshipMutation) InfoIDs() (ids []int)

InfoIDs returns the "info" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InfoID instead. It exists only for internal usage by the builders.

func (*RelationshipMutation) OldField

func (m *RelationshipMutation) 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 (*RelationshipMutation) Op

func (m *RelationshipMutation) Op() Op

Op returns the operation name.

func (*RelationshipMutation) RelativeCleared

func (m *RelationshipMutation) RelativeCleared() bool

RelativeCleared reports if the "relative" edge to the User entity was cleared.

func (*RelationshipMutation) RelativeID

func (m *RelationshipMutation) RelativeID() (r int, exists bool)

RelativeID returns the value of the "relative_id" field in the mutation.

func (*RelationshipMutation) RelativeIDs

func (m *RelationshipMutation) RelativeIDs() (ids []int)

RelativeIDs returns the "relative" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RelativeID instead. It exists only for internal usage by the builders.

func (*RelationshipMutation) RemovedEdges

func (m *RelationshipMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RelationshipMutation) RemovedIDs

func (m *RelationshipMutation) 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 (*RelationshipMutation) ResetEdge

func (m *RelationshipMutation) 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 (*RelationshipMutation) ResetField

func (m *RelationshipMutation) 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 (*RelationshipMutation) ResetInfo

func (m *RelationshipMutation) ResetInfo()

ResetInfo resets all changes to the "info" edge.

func (*RelationshipMutation) ResetInfoID

func (m *RelationshipMutation) ResetInfoID()

ResetInfoID resets all changes to the "info_id" field.

func (*RelationshipMutation) ResetRelative

func (m *RelationshipMutation) ResetRelative()

ResetRelative resets all changes to the "relative" edge.

func (*RelationshipMutation) ResetRelativeID

func (m *RelationshipMutation) ResetRelativeID()

ResetRelativeID resets all changes to the "relative_id" field.

func (*RelationshipMutation) ResetUser

func (m *RelationshipMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*RelationshipMutation) ResetUserID

func (m *RelationshipMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*RelationshipMutation) ResetWeight

func (m *RelationshipMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*RelationshipMutation) SetField

func (m *RelationshipMutation) 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 (*RelationshipMutation) SetInfoID

func (m *RelationshipMutation) SetInfoID(i int)

SetInfoID sets the "info_id" field.

func (*RelationshipMutation) SetOp added in v0.11.5

func (m *RelationshipMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RelationshipMutation) SetRelativeID

func (m *RelationshipMutation) SetRelativeID(i int)

SetRelativeID sets the "relative_id" field.

func (*RelationshipMutation) SetUserID

func (m *RelationshipMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*RelationshipMutation) SetWeight

func (m *RelationshipMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (RelationshipMutation) Tx

func (m RelationshipMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RelationshipMutation) Type

func (m *RelationshipMutation) Type() string

Type returns the node type of this mutation (Relationship).

func (*RelationshipMutation) UserCleared

func (m *RelationshipMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*RelationshipMutation) UserID

func (m *RelationshipMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*RelationshipMutation) UserIDs

func (m *RelationshipMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*RelationshipMutation) Weight

func (m *RelationshipMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*RelationshipMutation) Where

Where appends a list predicates to the RelationshipMutation builder.

func (*RelationshipMutation) WhereP added in v0.11.5

func (m *RelationshipMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RelationshipMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RelationshipQuery

type RelationshipQuery struct {
	// contains filtered or unexported fields
}

RelationshipQuery is the builder for querying Relationship entities.

func (*RelationshipQuery) Aggregate added in v0.11.4

func (rq *RelationshipQuery) Aggregate(fns ...AggregateFunc) *RelationshipSelect

Aggregate returns a RelationshipSelect configured with the given aggregations.

func (*RelationshipQuery) All

func (rq *RelationshipQuery) All(ctx context.Context) ([]*Relationship, error)

All executes the query and returns a list of Relationships.

func (*RelationshipQuery) AllX

func (rq *RelationshipQuery) AllX(ctx context.Context) []*Relationship

AllX is like All, but panics if an error occurs.

func (*RelationshipQuery) Clone

func (rq *RelationshipQuery) Clone() *RelationshipQuery

Clone returns a duplicate of the RelationshipQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RelationshipQuery) Count

func (rq *RelationshipQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RelationshipQuery) CountX

func (rq *RelationshipQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RelationshipQuery) Exist

func (rq *RelationshipQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RelationshipQuery) ExistX

func (rq *RelationshipQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RelationshipQuery) Filter added in v0.11.2

func (rq *RelationshipQuery) Filter() *RelationshipFilter

Filter returns a Filter implementation to apply filters on the RelationshipQuery builder.

func (*RelationshipQuery) First

func (rq *RelationshipQuery) First(ctx context.Context) (*Relationship, error)

First returns the first Relationship entity from the query. Returns a *NotFoundError when no Relationship was found.

func (*RelationshipQuery) FirstX

func (rq *RelationshipQuery) FirstX(ctx context.Context) *Relationship

FirstX is like First, but panics if an error occurs.

func (*RelationshipQuery) GroupBy

func (rq *RelationshipQuery) GroupBy(field string, fields ...string) *RelationshipGroupBy

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 {
	Weight int `json:"weight,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Relationship.Query().
	GroupBy(relationship.FieldWeight).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RelationshipQuery) Limit

func (rq *RelationshipQuery) Limit(limit int) *RelationshipQuery

Limit the number of records to be returned by this query.

func (*RelationshipQuery) Offset

func (rq *RelationshipQuery) Offset(offset int) *RelationshipQuery

Offset to start from.

func (*RelationshipQuery) Only

Only returns a single Relationship entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Relationship entity is found. Returns a *NotFoundError when no Relationship entities are found.

func (*RelationshipQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*RelationshipQuery) Order

Order specifies how the records should be ordered.

func (*RelationshipQuery) QueryInfo

func (rq *RelationshipQuery) QueryInfo() *RelationshipInfoQuery

QueryInfo chains the current query on the "info" edge.

func (*RelationshipQuery) QueryRelative

func (rq *RelationshipQuery) QueryRelative() *UserQuery

QueryRelative chains the current query on the "relative" edge.

func (*RelationshipQuery) QueryUser

func (rq *RelationshipQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*RelationshipQuery) Select

func (rq *RelationshipQuery) Select(fields ...string) *RelationshipSelect

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 {
	Weight int `json:"weight,omitempty"`
}

client.Relationship.Query().
	Select(relationship.FieldWeight).
	Scan(ctx, &v)

func (*RelationshipQuery) Unique

func (rq *RelationshipQuery) Unique(unique bool) *RelationshipQuery

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 (*RelationshipQuery) Where

Where adds a new predicate for the RelationshipQuery builder.

func (*RelationshipQuery) WithInfo

func (rq *RelationshipQuery) WithInfo(opts ...func(*RelationshipInfoQuery)) *RelationshipQuery

WithInfo tells the query-builder to eager-load the nodes that are connected to the "info" edge. The optional arguments are used to configure the query builder of the edge.

func (*RelationshipQuery) WithRelative

func (rq *RelationshipQuery) WithRelative(opts ...func(*UserQuery)) *RelationshipQuery

WithRelative tells the query-builder to eager-load the nodes that are connected to the "relative" edge. The optional arguments are used to configure the query builder of the edge.

func (*RelationshipQuery) WithUser

func (rq *RelationshipQuery) WithUser(opts ...func(*UserQuery)) *RelationshipQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type RelationshipSelect

type RelationshipSelect struct {
	*RelationshipQuery
	// contains filtered or unexported fields
}

RelationshipSelect is the builder for selecting fields of Relationship entities.

func (*RelationshipSelect) Aggregate added in v0.11.4

func (rs *RelationshipSelect) Aggregate(fns ...AggregateFunc) *RelationshipSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RelationshipSelect) Bool

func (s *RelationshipSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) BoolX

func (s *RelationshipSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RelationshipSelect) Bools

func (s *RelationshipSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) BoolsX

func (s *RelationshipSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RelationshipSelect) Float64

func (s *RelationshipSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) Float64X

func (s *RelationshipSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RelationshipSelect) Float64s

func (s *RelationshipSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) Float64sX

func (s *RelationshipSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RelationshipSelect) Int

func (s *RelationshipSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) IntX

func (s *RelationshipSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RelationshipSelect) Ints

func (s *RelationshipSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) IntsX

func (s *RelationshipSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RelationshipSelect) Scan

func (rs *RelationshipSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RelationshipSelect) ScanX

func (s *RelationshipSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RelationshipSelect) String

func (s *RelationshipSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) StringX

func (s *RelationshipSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RelationshipSelect) Strings

func (s *RelationshipSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RelationshipSelect) StringsX

func (s *RelationshipSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RelationshipUpdate

type RelationshipUpdate struct {
	// contains filtered or unexported fields
}

RelationshipUpdate is the builder for updating Relationship entities.

func (*RelationshipUpdate) AddWeight

func (ru *RelationshipUpdate) AddWeight(i int) *RelationshipUpdate

AddWeight adds i to the "weight" field.

func (*RelationshipUpdate) ClearInfo

func (ru *RelationshipUpdate) ClearInfo() *RelationshipUpdate

ClearInfo clears the "info" edge to the RelationshipInfo entity.

func (*RelationshipUpdate) ClearInfoID

func (ru *RelationshipUpdate) ClearInfoID() *RelationshipUpdate

ClearInfoID clears the value of the "info_id" field.

func (*RelationshipUpdate) ClearRelative

func (ru *RelationshipUpdate) ClearRelative() *RelationshipUpdate

ClearRelative clears the "relative" edge to the User entity.

func (*RelationshipUpdate) ClearUser

func (ru *RelationshipUpdate) ClearUser() *RelationshipUpdate

ClearUser clears the "user" edge to the User entity.

func (*RelationshipUpdate) Exec

func (ru *RelationshipUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RelationshipUpdate) ExecX

func (ru *RelationshipUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipUpdate) Mutation

func (ru *RelationshipUpdate) Mutation() *RelationshipMutation

Mutation returns the RelationshipMutation object of the builder.

func (*RelationshipUpdate) Save

func (ru *RelationshipUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RelationshipUpdate) SaveX

func (ru *RelationshipUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RelationshipUpdate) SetInfo

SetInfo sets the "info" edge to the RelationshipInfo entity.

func (*RelationshipUpdate) SetInfoID

func (ru *RelationshipUpdate) SetInfoID(i int) *RelationshipUpdate

SetInfoID sets the "info_id" field.

func (*RelationshipUpdate) SetNillableInfoID

func (ru *RelationshipUpdate) SetNillableInfoID(i *int) *RelationshipUpdate

SetNillableInfoID sets the "info_id" field if the given value is not nil.

func (*RelationshipUpdate) SetNillableWeight

func (ru *RelationshipUpdate) SetNillableWeight(i *int) *RelationshipUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*RelationshipUpdate) SetRelative

func (ru *RelationshipUpdate) SetRelative(u *User) *RelationshipUpdate

SetRelative sets the "relative" edge to the User entity.

func (*RelationshipUpdate) SetRelativeID

func (ru *RelationshipUpdate) SetRelativeID(i int) *RelationshipUpdate

SetRelativeID sets the "relative_id" field.

func (*RelationshipUpdate) SetUser

func (ru *RelationshipUpdate) SetUser(u *User) *RelationshipUpdate

SetUser sets the "user" edge to the User entity.

func (*RelationshipUpdate) SetUserID

func (ru *RelationshipUpdate) SetUserID(i int) *RelationshipUpdate

SetUserID sets the "user_id" field.

func (*RelationshipUpdate) SetWeight

func (ru *RelationshipUpdate) SetWeight(i int) *RelationshipUpdate

SetWeight sets the "weight" field.

func (*RelationshipUpdate) Where

Where appends a list predicates to the RelationshipUpdate builder.

type RelationshipUpdateOne

type RelationshipUpdateOne struct {
	// contains filtered or unexported fields
}

RelationshipUpdateOne is the builder for updating a single Relationship entity.

func (*RelationshipUpdateOne) AddWeight

func (ruo *RelationshipUpdateOne) AddWeight(i int) *RelationshipUpdateOne

AddWeight adds i to the "weight" field.

func (*RelationshipUpdateOne) ClearInfo

func (ruo *RelationshipUpdateOne) ClearInfo() *RelationshipUpdateOne

ClearInfo clears the "info" edge to the RelationshipInfo entity.

func (*RelationshipUpdateOne) ClearInfoID

func (ruo *RelationshipUpdateOne) ClearInfoID() *RelationshipUpdateOne

ClearInfoID clears the value of the "info_id" field.

func (*RelationshipUpdateOne) ClearRelative

func (ruo *RelationshipUpdateOne) ClearRelative() *RelationshipUpdateOne

ClearRelative clears the "relative" edge to the User entity.

func (*RelationshipUpdateOne) ClearUser

func (ruo *RelationshipUpdateOne) ClearUser() *RelationshipUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*RelationshipUpdateOne) Exec

func (ruo *RelationshipUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RelationshipUpdateOne) ExecX

func (ruo *RelationshipUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipUpdateOne) Mutation

Mutation returns the RelationshipMutation object of the builder.

func (*RelationshipUpdateOne) Save

Save executes the query and returns the updated Relationship entity.

func (*RelationshipUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*RelationshipUpdateOne) Select

func (ruo *RelationshipUpdateOne) Select(field string, fields ...string) *RelationshipUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RelationshipUpdateOne) SetInfo

SetInfo sets the "info" edge to the RelationshipInfo entity.

func (*RelationshipUpdateOne) SetInfoID

func (ruo *RelationshipUpdateOne) SetInfoID(i int) *RelationshipUpdateOne

SetInfoID sets the "info_id" field.

func (*RelationshipUpdateOne) SetNillableInfoID

func (ruo *RelationshipUpdateOne) SetNillableInfoID(i *int) *RelationshipUpdateOne

SetNillableInfoID sets the "info_id" field if the given value is not nil.

func (*RelationshipUpdateOne) SetNillableWeight

func (ruo *RelationshipUpdateOne) SetNillableWeight(i *int) *RelationshipUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*RelationshipUpdateOne) SetRelative

func (ruo *RelationshipUpdateOne) SetRelative(u *User) *RelationshipUpdateOne

SetRelative sets the "relative" edge to the User entity.

func (*RelationshipUpdateOne) SetRelativeID

func (ruo *RelationshipUpdateOne) SetRelativeID(i int) *RelationshipUpdateOne

SetRelativeID sets the "relative_id" field.

func (*RelationshipUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*RelationshipUpdateOne) SetUserID

func (ruo *RelationshipUpdateOne) SetUserID(i int) *RelationshipUpdateOne

SetUserID sets the "user_id" field.

func (*RelationshipUpdateOne) SetWeight

func (ruo *RelationshipUpdateOne) SetWeight(i int) *RelationshipUpdateOne

SetWeight sets the "weight" field.

func (*RelationshipUpdateOne) Where added in v0.11.8

Where appends a list predicates to the RelationshipUpdate builder.

type RelationshipUpsert

type RelationshipUpsert struct {
	*sql.UpdateSet
}

RelationshipUpsert is the "OnConflict" setter.

func (*RelationshipUpsert) AddWeight

func (u *RelationshipUpsert) AddWeight(v int) *RelationshipUpsert

AddWeight adds v to the "weight" field.

func (*RelationshipUpsert) ClearInfoID

func (u *RelationshipUpsert) ClearInfoID() *RelationshipUpsert

ClearInfoID clears the value of the "info_id" field.

func (*RelationshipUpsert) SetInfoID

func (u *RelationshipUpsert) SetInfoID(v int) *RelationshipUpsert

SetInfoID sets the "info_id" field.

func (*RelationshipUpsert) SetRelativeID

func (u *RelationshipUpsert) SetRelativeID(v int) *RelationshipUpsert

SetRelativeID sets the "relative_id" field.

func (*RelationshipUpsert) SetUserID

func (u *RelationshipUpsert) SetUserID(v int) *RelationshipUpsert

SetUserID sets the "user_id" field.

func (*RelationshipUpsert) SetWeight

func (u *RelationshipUpsert) SetWeight(v int) *RelationshipUpsert

SetWeight sets the "weight" field.

func (*RelationshipUpsert) UpdateInfoID

func (u *RelationshipUpsert) UpdateInfoID() *RelationshipUpsert

UpdateInfoID sets the "info_id" field to the value that was provided on create.

func (*RelationshipUpsert) UpdateRelativeID

func (u *RelationshipUpsert) UpdateRelativeID() *RelationshipUpsert

UpdateRelativeID sets the "relative_id" field to the value that was provided on create.

func (*RelationshipUpsert) UpdateUserID

func (u *RelationshipUpsert) UpdateUserID() *RelationshipUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*RelationshipUpsert) UpdateWeight

func (u *RelationshipUpsert) UpdateWeight() *RelationshipUpsert

UpdateWeight sets the "weight" field to the value that was provided on create.

type RelationshipUpsertBulk

type RelationshipUpsertBulk struct {
	// contains filtered or unexported fields
}

RelationshipUpsertBulk is the builder for "upsert"-ing a bulk of Relationship nodes.

func (*RelationshipUpsertBulk) AddWeight

AddWeight adds v to the "weight" field.

func (*RelationshipUpsertBulk) ClearInfoID

ClearInfoID clears the value of the "info_id" field.

func (*RelationshipUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RelationshipUpsertBulk) Exec

Exec executes the query.

func (*RelationshipUpsertBulk) ExecX

func (u *RelationshipUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Relationship.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RelationshipUpsertBulk) SetInfoID

SetInfoID sets the "info_id" field.

func (*RelationshipUpsertBulk) SetRelativeID

func (u *RelationshipUpsertBulk) SetRelativeID(v int) *RelationshipUpsertBulk

SetRelativeID sets the "relative_id" field.

func (*RelationshipUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*RelationshipUpsertBulk) SetWeight

SetWeight sets the "weight" field.

func (*RelationshipUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the RelationshipCreateBulk.OnConflict documentation for more info.

func (*RelationshipUpsertBulk) UpdateInfoID

UpdateInfoID sets the "info_id" field to the value that was provided on create.

func (*RelationshipUpsertBulk) UpdateNewValues

func (u *RelationshipUpsertBulk) UpdateNewValues() *RelationshipUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Relationship.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RelationshipUpsertBulk) UpdateRelativeID

func (u *RelationshipUpsertBulk) UpdateRelativeID() *RelationshipUpsertBulk

UpdateRelativeID sets the "relative_id" field to the value that was provided on create.

func (*RelationshipUpsertBulk) UpdateUserID

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*RelationshipUpsertBulk) UpdateWeight

UpdateWeight sets the "weight" field to the value that was provided on create.

type RelationshipUpsertOne

type RelationshipUpsertOne struct {
	// contains filtered or unexported fields
}

RelationshipUpsertOne is the builder for "upsert"-ing

one Relationship node.

func (*RelationshipUpsertOne) AddWeight

AddWeight adds v to the "weight" field.

func (*RelationshipUpsertOne) ClearInfoID

func (u *RelationshipUpsertOne) ClearInfoID() *RelationshipUpsertOne

ClearInfoID clears the value of the "info_id" field.

func (*RelationshipUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RelationshipUpsertOne) Exec

Exec executes the query.

func (*RelationshipUpsertOne) ExecX

func (u *RelationshipUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RelationshipUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Relationship.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RelationshipUpsertOne) SetInfoID

SetInfoID sets the "info_id" field.

func (*RelationshipUpsertOne) SetRelativeID

func (u *RelationshipUpsertOne) SetRelativeID(v int) *RelationshipUpsertOne

SetRelativeID sets the "relative_id" field.

func (*RelationshipUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*RelationshipUpsertOne) SetWeight

SetWeight sets the "weight" field.

func (*RelationshipUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the RelationshipCreate.OnConflict documentation for more info.

func (*RelationshipUpsertOne) UpdateInfoID

func (u *RelationshipUpsertOne) UpdateInfoID() *RelationshipUpsertOne

UpdateInfoID sets the "info_id" field to the value that was provided on create.

func (*RelationshipUpsertOne) UpdateNewValues

func (u *RelationshipUpsertOne) UpdateNewValues() *RelationshipUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Relationship.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RelationshipUpsertOne) UpdateRelativeID

func (u *RelationshipUpsertOne) UpdateRelativeID() *RelationshipUpsertOne

UpdateRelativeID sets the "relative_id" field to the value that was provided on create.

func (*RelationshipUpsertOne) UpdateUserID

func (u *RelationshipUpsertOne) UpdateUserID() *RelationshipUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*RelationshipUpsertOne) UpdateWeight

func (u *RelationshipUpsertOne) UpdateWeight() *RelationshipUpsertOne

UpdateWeight sets the "weight" field to the value that was provided on create.

type Relationships

type Relationships []*Relationship

Relationships is a parsable slice of Relationship.

type Role added in v0.11.1

type Role struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleQuery when eager-loading is set.
	Edges RoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) QueryRolesUsers added in v0.11.1

func (r *Role) QueryRolesUsers() *RoleUserQuery

QueryRolesUsers queries the "roles_users" edge of the Role entity.

func (*Role) QueryUser added in v0.11.1

func (r *Role) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Role entity.

func (*Role) String added in v0.11.1

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) Unwrap added in v0.11.1

func (r *Role) Unwrap() *Role

Unwrap unwraps the Role 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 (*Role) Update added in v0.11.1

func (r *Role) Update() *RoleUpdateOne

Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.

type RoleClient added in v0.11.1

type RoleClient struct {
	// contains filtered or unexported fields
}

RoleClient is a client for the Role schema.

func NewRoleClient added in v0.11.1

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create added in v0.11.1

func (c *RoleClient) Create() *RoleCreate

Create returns a builder for creating a Role entity.

func (*RoleClient) CreateBulk added in v0.11.1

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

CreateBulk returns a builder for creating a bulk of Role entities.

func (*RoleClient) Delete added in v0.11.1

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne added in v0.11.1

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleClient) DeleteOneID added in v0.11.1

func (c *RoleClient) DeleteOneID(id int) *RoleDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoleClient) Get added in v0.11.1

func (c *RoleClient) Get(ctx context.Context, id int) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX added in v0.11.1

func (c *RoleClient) GetX(ctx context.Context, id int) *Role

GetX is like Get, but panics if an error occurs.

func (*RoleClient) Hooks added in v0.11.1

func (c *RoleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoleClient) Intercept added in v0.11.5

func (c *RoleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`.

func (*RoleClient) Interceptors added in v0.11.5

func (c *RoleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RoleClient) Query added in v0.11.1

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) QueryRolesUsers added in v0.11.1

func (c *RoleClient) QueryRolesUsers(r *Role) *RoleUserQuery

QueryRolesUsers queries the roles_users edge of a Role.

func (*RoleClient) QueryUser added in v0.11.1

func (c *RoleClient) QueryUser(r *Role) *UserQuery

QueryUser queries the user edge of a Role.

func (*RoleClient) Update added in v0.11.1

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne added in v0.11.1

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID added in v0.11.1

func (c *RoleClient) UpdateOneID(id int) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use added in v0.11.1

func (c *RoleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`.

type RoleCreate added in v0.11.1

type RoleCreate struct {
	// contains filtered or unexported fields
}

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) AddUser added in v0.11.1

func (rc *RoleCreate) AddUser(u ...*User) *RoleCreate

AddUser adds the "user" edges to the User entity.

func (*RoleCreate) AddUserIDs added in v0.11.1

func (rc *RoleCreate) AddUserIDs(ids ...int) *RoleCreate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*RoleCreate) Exec added in v0.11.1

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecX added in v0.11.1

func (rc *RoleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreate) Mutation added in v0.11.1

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) OnConflict added in v0.11.1

func (rc *RoleCreate) OnConflict(opts ...sql.ConflictOption) *RoleUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Role.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*RoleCreate) OnConflictColumns added in v0.11.1

func (rc *RoleCreate) OnConflictColumns(columns ...string) *RoleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RoleCreate) Save added in v0.11.1

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX added in v0.11.1

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

func (*RoleCreate) SetCreatedAt added in v0.11.1

func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate

SetCreatedAt sets the "created_at" field.

func (*RoleCreate) SetName added in v0.11.1

func (rc *RoleCreate) SetName(s string) *RoleCreate

SetName sets the "name" field.

func (*RoleCreate) SetNillableCreatedAt added in v0.11.1

func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

type RoleCreateBulk added in v0.11.1

type RoleCreateBulk struct {
	// contains filtered or unexported fields
}

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec added in v0.11.1

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecX added in v0.11.1

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreateBulk) OnConflict added in v0.11.1

func (rcb *RoleCreateBulk) OnConflict(opts ...sql.ConflictOption) *RoleUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Role.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*RoleCreateBulk) OnConflictColumns added in v0.11.1

func (rcb *RoleCreateBulk) OnConflictColumns(columns ...string) *RoleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RoleCreateBulk) Save added in v0.11.1

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX added in v0.11.1

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

SaveX is like Save, but panics if an error occurs.

type RoleDelete added in v0.11.1

type RoleDelete struct {
	// contains filtered or unexported fields
}

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec added in v0.11.1

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoleDelete) ExecX added in v0.11.1

func (rd *RoleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoleDelete) Where added in v0.11.1

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne added in v0.11.1

type RoleDeleteOne struct {
	// contains filtered or unexported fields
}

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec added in v0.11.1

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX added in v0.11.1

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleDeleteOne) Where added in v0.11.7

func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne

Where appends a list predicates to the RoleDelete builder.

type RoleEdges added in v0.11.1

type RoleEdges struct {
	// User holds the value of the user edge.
	User []*User `json:"user,omitempty"`
	// RolesUsers holds the value of the roles_users edge.
	RolesUsers []*RoleUser `json:"roles_users,omitempty"`
	// contains filtered or unexported fields
}

RoleEdges holds the relations/edges for other nodes in the graph.

func (RoleEdges) RolesUsersOrErr added in v0.11.1

func (e RoleEdges) RolesUsersOrErr() ([]*RoleUser, error)

RolesUsersOrErr returns the RolesUsers value or an error if the edge was not loaded in eager-loading.

func (RoleEdges) UserOrErr added in v0.11.1

func (e RoleEdges) UserOrErr() ([]*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.

type RoleFilter added in v0.11.2

type RoleFilter struct {
	// contains filtered or unexported fields
}

RoleFilter provides a generic filtering capability at runtime for RoleQuery.

func (*RoleFilter) Where added in v0.11.2

func (f *RoleFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*RoleFilter) WhereCreatedAt added in v0.11.2

func (f *RoleFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*RoleFilter) WhereHasRolesUsers added in v0.11.2

func (f *RoleFilter) WhereHasRolesUsers()

WhereHasRolesUsers applies a predicate to check if query has an edge roles_users.

func (*RoleFilter) WhereHasRolesUsersWith added in v0.11.2

func (f *RoleFilter) WhereHasRolesUsersWith(preds ...predicate.RoleUser)

WhereHasRolesUsersWith applies a predicate to check if query has an edge roles_users with a given conditions (other predicates).

func (*RoleFilter) WhereHasUser added in v0.11.2

func (f *RoleFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*RoleFilter) WhereHasUserWith added in v0.11.2

func (f *RoleFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*RoleFilter) WhereID added in v0.11.2

func (f *RoleFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*RoleFilter) WhereName added in v0.11.2

func (f *RoleFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

type RoleGroupBy added in v0.11.1

type RoleGroupBy struct {
	// contains filtered or unexported fields
}

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate added in v0.11.1

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoleGroupBy) Bool added in v0.11.1

func (s *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolX added in v0.11.1

func (s *RoleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleGroupBy) Bools added in v0.11.1

func (s *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolsX added in v0.11.1

func (s *RoleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleGroupBy) Float64 added in v0.11.1

func (s *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64X added in v0.11.1

func (s *RoleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleGroupBy) Float64s added in v0.11.1

func (s *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64sX added in v0.11.1

func (s *RoleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleGroupBy) Int added in v0.11.1

func (s *RoleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntX added in v0.11.1

func (s *RoleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleGroupBy) Ints added in v0.11.1

func (s *RoleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntsX added in v0.11.1

func (s *RoleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleGroupBy) Scan added in v0.11.1

func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleGroupBy) ScanX added in v0.11.1

func (s *RoleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleGroupBy) String added in v0.11.1

func (s *RoleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringX added in v0.11.1

func (s *RoleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleGroupBy) Strings added in v0.11.1

func (s *RoleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringsX added in v0.11.1

func (s *RoleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleMutation added in v0.11.1

type RoleMutation struct {
	// contains filtered or unexported fields
}

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddField added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) AddUserIDs added in v0.11.1

func (m *RoleMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "user" edge to the User entity by ids.

func (*RoleMutation) AddedEdges added in v0.11.1

func (m *RoleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoleMutation) AddedField added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) AddedFields added in v0.11.1

func (m *RoleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoleMutation) AddedIDs added in v0.11.1

func (m *RoleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoleMutation) ClearEdge added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) ClearField added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) ClearUser added in v0.11.1

func (m *RoleMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*RoleMutation) ClearedEdges added in v0.11.1

func (m *RoleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoleMutation) ClearedFields added in v0.11.1

func (m *RoleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoleMutation) Client added in v0.11.1

func (m RoleMutation) 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 (*RoleMutation) CreatedAt added in v0.11.1

func (m *RoleMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RoleMutation) EdgeCleared added in v0.11.1

func (m *RoleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoleMutation) Field added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) FieldCleared added in v0.11.1

func (m *RoleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoleMutation) Fields added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) Filter added in v0.11.2

func (m *RoleMutation) Filter() *RoleFilter

Filter returns an entql.Where implementation to apply filters on the RoleMutation builder.

func (*RoleMutation) ID added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) IDs added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) Name added in v0.11.1

func (m *RoleMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*RoleMutation) OldCreatedAt added in v0.11.1

func (m *RoleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Role entity. If the Role 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 (*RoleMutation) OldField added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) OldName added in v0.11.1

func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Role entity. If the Role 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 (*RoleMutation) Op added in v0.11.1

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) RemoveUserIDs added in v0.11.1

func (m *RoleMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "user" edge to the User entity by IDs.

func (*RoleMutation) RemovedEdges added in v0.11.1

func (m *RoleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoleMutation) RemovedIDs added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) RemovedUserIDs added in v0.11.1

func (m *RoleMutation) RemovedUserIDs() (ids []int)

RemovedUser returns the removed IDs of the "user" edge to the User entity.

func (*RoleMutation) ResetCreatedAt added in v0.11.1

func (m *RoleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoleMutation) ResetEdge added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) ResetField added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) ResetName added in v0.11.1

func (m *RoleMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RoleMutation) ResetUser added in v0.11.1

func (m *RoleMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*RoleMutation) SetCreatedAt added in v0.11.1

func (m *RoleMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RoleMutation) SetField added in v0.11.1

func (m *RoleMutation) 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 (*RoleMutation) SetName added in v0.11.1

func (m *RoleMutation) SetName(s string)

SetName sets the "name" field.

func (*RoleMutation) SetOp added in v0.11.5

func (m *RoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (RoleMutation) Tx added in v0.11.1

func (m RoleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoleMutation) Type added in v0.11.1

func (m *RoleMutation) Type() string

Type returns the node type of this mutation (Role).

func (*RoleMutation) UserCleared added in v0.11.1

func (m *RoleMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*RoleMutation) UserIDs added in v0.11.1

func (m *RoleMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation.

func (*RoleMutation) Where added in v0.11.1

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

func (*RoleMutation) WhereP added in v0.11.5

func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RoleQuery added in v0.11.1

type RoleQuery struct {
	// contains filtered or unexported fields
}

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) Aggregate added in v0.11.4

func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate returns a RoleSelect configured with the given aggregations.

func (*RoleQuery) All added in v0.11.1

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX added in v0.11.1

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

AllX is like All, but panics if an error occurs.

func (*RoleQuery) Clone added in v0.11.1

func (rq *RoleQuery) Clone() *RoleQuery

Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoleQuery) Count added in v0.11.1

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX added in v0.11.1

func (rq *RoleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoleQuery) Exist added in v0.11.1

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoleQuery) ExistX added in v0.11.1

func (rq *RoleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoleQuery) Filter added in v0.11.2

func (rq *RoleQuery) Filter() *RoleFilter

Filter returns a Filter implementation to apply filters on the RoleQuery builder.

func (*RoleQuery) First added in v0.11.1

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.

func (*RoleQuery) FirstID added in v0.11.1

func (rq *RoleQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.

func (*RoleQuery) FirstIDX added in v0.11.1

func (rq *RoleQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoleQuery) FirstX added in v0.11.1

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

FirstX is like First, but panics if an error occurs.

func (*RoleQuery) GroupBy added in v0.11.1

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

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 {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Role.Query().
	GroupBy(role.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoleQuery) IDs added in v0.11.1

func (rq *RoleQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Role IDs.

func (*RoleQuery) IDsX added in v0.11.1

func (rq *RoleQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RoleQuery) Limit added in v0.11.1

func (rq *RoleQuery) Limit(limit int) *RoleQuery

Limit the number of records to be returned by this query.

func (*RoleQuery) Offset added in v0.11.1

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset to start from.

func (*RoleQuery) Only added in v0.11.1

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.

func (*RoleQuery) OnlyID added in v0.11.1

func (rq *RoleQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.

func (*RoleQuery) OnlyIDX added in v0.11.1

func (rq *RoleQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoleQuery) OnlyX added in v0.11.1

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

OnlyX is like Only, but panics if an error occurs.

func (*RoleQuery) Order added in v0.11.1

func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery

Order specifies how the records should be ordered.

func (*RoleQuery) QueryRolesUsers added in v0.11.1

func (rq *RoleQuery) QueryRolesUsers() *RoleUserQuery

QueryRolesUsers chains the current query on the "roles_users" edge.

func (*RoleQuery) QueryUser added in v0.11.1

func (rq *RoleQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*RoleQuery) Select added in v0.11.1

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

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 {
	Name string `json:"name,omitempty"`
}

client.Role.Query().
	Select(role.FieldName).
	Scan(ctx, &v)

func (*RoleQuery) Unique added in v0.11.1

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

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 (*RoleQuery) Where added in v0.11.1

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

func (*RoleQuery) WithRolesUsers added in v0.11.1

func (rq *RoleQuery) WithRolesUsers(opts ...func(*RoleUserQuery)) *RoleQuery

WithRolesUsers tells the query-builder to eager-load the nodes that are connected to the "roles_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoleQuery) WithUser added in v0.11.1

func (rq *RoleQuery) WithUser(opts ...func(*UserQuery)) *RoleQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type RoleSelect added in v0.11.1

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Aggregate added in v0.11.4

func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleSelect) Bool added in v0.11.1

func (s *RoleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolX added in v0.11.1

func (s *RoleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleSelect) Bools added in v0.11.1

func (s *RoleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolsX added in v0.11.1

func (s *RoleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleSelect) Float64 added in v0.11.1

func (s *RoleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64X added in v0.11.1

func (s *RoleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleSelect) Float64s added in v0.11.1

func (s *RoleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64sX added in v0.11.1

func (s *RoleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleSelect) Int added in v0.11.1

func (s *RoleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntX added in v0.11.1

func (s *RoleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleSelect) Ints added in v0.11.1

func (s *RoleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntsX added in v0.11.1

func (s *RoleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleSelect) Scan added in v0.11.1

func (rs *RoleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleSelect) ScanX added in v0.11.1

func (s *RoleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleSelect) String added in v0.11.1

func (s *RoleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringX added in v0.11.1

func (s *RoleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleSelect) Strings added in v0.11.1

func (s *RoleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringsX added in v0.11.1

func (s *RoleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleUpdate added in v0.11.1

type RoleUpdate struct {
	// contains filtered or unexported fields
}

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) AddUser added in v0.11.1

func (ru *RoleUpdate) AddUser(u ...*User) *RoleUpdate

AddUser adds the "user" edges to the User entity.

func (*RoleUpdate) AddUserIDs added in v0.11.1

func (ru *RoleUpdate) AddUserIDs(ids ...int) *RoleUpdate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*RoleUpdate) ClearUser added in v0.11.1

func (ru *RoleUpdate) ClearUser() *RoleUpdate

ClearUser clears all "user" edges to the User entity.

func (*RoleUpdate) Exec added in v0.11.1

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecX added in v0.11.1

func (ru *RoleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdate) Mutation added in v0.11.1

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) RemoveUser added in v0.11.1

func (ru *RoleUpdate) RemoveUser(u ...*User) *RoleUpdate

RemoveUser removes "user" edges to User entities.

func (*RoleUpdate) RemoveUserIDs added in v0.11.1

func (ru *RoleUpdate) RemoveUserIDs(ids ...int) *RoleUpdate

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*RoleUpdate) Save added in v0.11.1

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoleUpdate) SaveX added in v0.11.1

func (ru *RoleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdate) SetCreatedAt added in v0.11.1

func (ru *RoleUpdate) SetCreatedAt(t time.Time) *RoleUpdate

SetCreatedAt sets the "created_at" field.

func (*RoleUpdate) SetName added in v0.11.1

func (ru *RoleUpdate) SetName(s string) *RoleUpdate

SetName sets the "name" field.

func (*RoleUpdate) SetNillableCreatedAt added in v0.11.1

func (ru *RoleUpdate) SetNillableCreatedAt(t *time.Time) *RoleUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleUpdate) Where added in v0.11.1

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne added in v0.11.1

type RoleUpdateOne struct {
	// contains filtered or unexported fields
}

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) AddUser added in v0.11.1

func (ruo *RoleUpdateOne) AddUser(u ...*User) *RoleUpdateOne

AddUser adds the "user" edges to the User entity.

func (*RoleUpdateOne) AddUserIDs added in v0.11.1

func (ruo *RoleUpdateOne) AddUserIDs(ids ...int) *RoleUpdateOne

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*RoleUpdateOne) ClearUser added in v0.11.1

func (ruo *RoleUpdateOne) ClearUser() *RoleUpdateOne

ClearUser clears all "user" edges to the User entity.

func (*RoleUpdateOne) Exec added in v0.11.1

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecX added in v0.11.1

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdateOne) Mutation added in v0.11.1

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) RemoveUser added in v0.11.1

func (ruo *RoleUpdateOne) RemoveUser(u ...*User) *RoleUpdateOne

RemoveUser removes "user" edges to User entities.

func (*RoleUpdateOne) RemoveUserIDs added in v0.11.1

func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...int) *RoleUpdateOne

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*RoleUpdateOne) Save added in v0.11.1

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX added in v0.11.1

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdateOne) Select added in v0.11.1

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoleUpdateOne) SetCreatedAt added in v0.11.1

func (ruo *RoleUpdateOne) SetCreatedAt(t time.Time) *RoleUpdateOne

SetCreatedAt sets the "created_at" field.

func (*RoleUpdateOne) SetName added in v0.11.1

func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne

SetName sets the "name" field.

func (*RoleUpdateOne) SetNillableCreatedAt added in v0.11.1

func (ruo *RoleUpdateOne) SetNillableCreatedAt(t *time.Time) *RoleUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleUpdateOne) Where added in v0.11.8

func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne

Where appends a list predicates to the RoleUpdate builder.

type RoleUpsert added in v0.11.1

type RoleUpsert struct {
	*sql.UpdateSet
}

RoleUpsert is the "OnConflict" setter.

func (*RoleUpsert) SetCreatedAt added in v0.11.1

func (u *RoleUpsert) SetCreatedAt(v time.Time) *RoleUpsert

SetCreatedAt sets the "created_at" field.

func (*RoleUpsert) SetName added in v0.11.1

func (u *RoleUpsert) SetName(v string) *RoleUpsert

SetName sets the "name" field.

func (*RoleUpsert) UpdateCreatedAt added in v0.11.1

func (u *RoleUpsert) UpdateCreatedAt() *RoleUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*RoleUpsert) UpdateName added in v0.11.1

func (u *RoleUpsert) UpdateName() *RoleUpsert

UpdateName sets the "name" field to the value that was provided on create.

type RoleUpsertBulk added in v0.11.1

type RoleUpsertBulk struct {
	// contains filtered or unexported fields
}

RoleUpsertBulk is the builder for "upsert"-ing a bulk of Role nodes.

func (*RoleUpsertBulk) DoNothing added in v0.11.1

func (u *RoleUpsertBulk) DoNothing() *RoleUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUpsertBulk) Exec added in v0.11.1

func (u *RoleUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpsertBulk) ExecX added in v0.11.1

func (u *RoleUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpsertBulk) Ignore added in v0.11.1

func (u *RoleUpsertBulk) Ignore() *RoleUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RoleUpsertBulk) SetCreatedAt added in v0.11.1

func (u *RoleUpsertBulk) SetCreatedAt(v time.Time) *RoleUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*RoleUpsertBulk) SetName added in v0.11.1

func (u *RoleUpsertBulk) SetName(v string) *RoleUpsertBulk

SetName sets the "name" field.

func (*RoleUpsertBulk) Update added in v0.11.1

func (u *RoleUpsertBulk) Update(set func(*RoleUpsert)) *RoleUpsertBulk

Update allows overriding fields `UPDATE` values. See the RoleCreateBulk.OnConflict documentation for more info.

func (*RoleUpsertBulk) UpdateCreatedAt added in v0.11.1

func (u *RoleUpsertBulk) UpdateCreatedAt() *RoleUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateName added in v0.11.1

func (u *RoleUpsertBulk) UpdateName() *RoleUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateNewValues added in v0.11.1

func (u *RoleUpsertBulk) UpdateNewValues() *RoleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type RoleUpsertOne added in v0.11.1

type RoleUpsertOne struct {
	// contains filtered or unexported fields
}

RoleUpsertOne is the builder for "upsert"-ing

one Role node.

func (*RoleUpsertOne) DoNothing added in v0.11.1

func (u *RoleUpsertOne) DoNothing() *RoleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUpsertOne) Exec added in v0.11.1

func (u *RoleUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpsertOne) ExecX added in v0.11.1

func (u *RoleUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpsertOne) ID added in v0.11.1

func (u *RoleUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*RoleUpsertOne) IDX added in v0.11.1

func (u *RoleUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*RoleUpsertOne) Ignore added in v0.11.1

func (u *RoleUpsertOne) Ignore() *RoleUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Role.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RoleUpsertOne) SetCreatedAt added in v0.11.1

func (u *RoleUpsertOne) SetCreatedAt(v time.Time) *RoleUpsertOne

SetCreatedAt sets the "created_at" field.

func (*RoleUpsertOne) SetName added in v0.11.1

func (u *RoleUpsertOne) SetName(v string) *RoleUpsertOne

SetName sets the "name" field.

func (*RoleUpsertOne) Update added in v0.11.1

func (u *RoleUpsertOne) Update(set func(*RoleUpsert)) *RoleUpsertOne

Update allows overriding fields `UPDATE` values. See the RoleCreate.OnConflict documentation for more info.

func (*RoleUpsertOne) UpdateCreatedAt added in v0.11.1

func (u *RoleUpsertOne) UpdateCreatedAt() *RoleUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateName added in v0.11.1

func (u *RoleUpsertOne) UpdateName() *RoleUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateNewValues added in v0.11.1

func (u *RoleUpsertOne) UpdateNewValues() *RoleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type RoleUser added in v0.11.1

type RoleUser struct {

	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// RoleID holds the value of the "role_id" field.
	RoleID int `json:"role_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleUserQuery when eager-loading is set.
	Edges RoleUserEdges `json:"edges"`
	// contains filtered or unexported fields
}

RoleUser is the model entity for the RoleUser schema.

func (*RoleUser) QueryRole added in v0.11.1

func (ru *RoleUser) QueryRole() *RoleQuery

QueryRole queries the "role" edge of the RoleUser entity.

func (*RoleUser) QueryUser added in v0.11.1

func (ru *RoleUser) QueryUser() *UserQuery

QueryUser queries the "user" edge of the RoleUser entity.

func (*RoleUser) String added in v0.11.1

func (ru *RoleUser) String() string

String implements the fmt.Stringer.

func (*RoleUser) Unwrap added in v0.11.1

func (ru *RoleUser) Unwrap() *RoleUser

Unwrap unwraps the RoleUser 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 (*RoleUser) Update added in v0.11.1

func (ru *RoleUser) Update() *RoleUserUpdateOne

Update returns a builder for updating this RoleUser. Note that you need to call RoleUser.Unwrap() before calling this method if this RoleUser was returned from a transaction, and the transaction was committed or rolled back.

type RoleUserClient added in v0.11.1

type RoleUserClient struct {
	// contains filtered or unexported fields
}

RoleUserClient is a client for the RoleUser schema.

func NewRoleUserClient added in v0.11.1

func NewRoleUserClient(c config) *RoleUserClient

NewRoleUserClient returns a client for the RoleUser from the given config.

func (*RoleUserClient) Create added in v0.11.1

func (c *RoleUserClient) Create() *RoleUserCreate

Create returns a builder for creating a RoleUser entity.

func (*RoleUserClient) CreateBulk added in v0.11.1

func (c *RoleUserClient) CreateBulk(builders ...*RoleUserCreate) *RoleUserCreateBulk

CreateBulk returns a builder for creating a bulk of RoleUser entities.

func (*RoleUserClient) Delete added in v0.11.1

func (c *RoleUserClient) Delete() *RoleUserDelete

Delete returns a delete builder for RoleUser.

func (*RoleUserClient) Hooks added in v0.11.1

func (c *RoleUserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoleUserClient) Intercept added in v0.11.5

func (c *RoleUserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `roleuser.Intercept(f(g(h())))`.

func (*RoleUserClient) Interceptors added in v0.11.5

func (c *RoleUserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RoleUserClient) Query added in v0.11.1

func (c *RoleUserClient) Query() *RoleUserQuery

Query returns a query builder for RoleUser.

func (*RoleUserClient) QueryRole added in v0.11.1

func (c *RoleUserClient) QueryRole(ru *RoleUser) *RoleQuery

QueryRole queries the role edge of a RoleUser.

func (*RoleUserClient) QueryUser added in v0.11.1

func (c *RoleUserClient) QueryUser(ru *RoleUser) *UserQuery

QueryUser queries the user edge of a RoleUser.

func (*RoleUserClient) Update added in v0.11.1

func (c *RoleUserClient) Update() *RoleUserUpdate

Update returns an update builder for RoleUser.

func (*RoleUserClient) UpdateOne added in v0.11.1

func (c *RoleUserClient) UpdateOne(ru *RoleUser) *RoleUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleUserClient) Use added in v0.11.1

func (c *RoleUserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `roleuser.Hooks(f(g(h())))`.

type RoleUserCreate added in v0.11.1

type RoleUserCreate struct {
	// contains filtered or unexported fields
}

RoleUserCreate is the builder for creating a RoleUser entity.

func (*RoleUserCreate) Exec added in v0.11.1

func (ruc *RoleUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUserCreate) ExecX added in v0.11.1

func (ruc *RoleUserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserCreate) Mutation added in v0.11.1

func (ruc *RoleUserCreate) Mutation() *RoleUserMutation

Mutation returns the RoleUserMutation object of the builder.

func (*RoleUserCreate) OnConflict added in v0.11.1

func (ruc *RoleUserCreate) OnConflict(opts ...sql.ConflictOption) *RoleUserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.RoleUser.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUserUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*RoleUserCreate) OnConflictColumns added in v0.11.1

func (ruc *RoleUserCreate) OnConflictColumns(columns ...string) *RoleUserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.RoleUser.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RoleUserCreate) Save added in v0.11.1

func (ruc *RoleUserCreate) Save(ctx context.Context) (*RoleUser, error)

Save creates the RoleUser in the database.

func (*RoleUserCreate) SaveX added in v0.11.1

func (ruc *RoleUserCreate) SaveX(ctx context.Context) *RoleUser

SaveX calls Save and panics if Save returns an error.

func (*RoleUserCreate) SetCreatedAt added in v0.11.1

func (ruc *RoleUserCreate) SetCreatedAt(t time.Time) *RoleUserCreate

SetCreatedAt sets the "created_at" field.

func (*RoleUserCreate) SetNillableCreatedAt added in v0.11.1

func (ruc *RoleUserCreate) SetNillableCreatedAt(t *time.Time) *RoleUserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleUserCreate) SetRole added in v0.11.1

func (ruc *RoleUserCreate) SetRole(r *Role) *RoleUserCreate

SetRole sets the "role" edge to the Role entity.

func (*RoleUserCreate) SetRoleID added in v0.11.1

func (ruc *RoleUserCreate) SetRoleID(i int) *RoleUserCreate

SetRoleID sets the "role_id" field.

func (*RoleUserCreate) SetUser added in v0.11.1

func (ruc *RoleUserCreate) SetUser(u *User) *RoleUserCreate

SetUser sets the "user" edge to the User entity.

func (*RoleUserCreate) SetUserID added in v0.11.1

func (ruc *RoleUserCreate) SetUserID(i int) *RoleUserCreate

SetUserID sets the "user_id" field.

type RoleUserCreateBulk added in v0.11.1

type RoleUserCreateBulk struct {
	// contains filtered or unexported fields
}

RoleUserCreateBulk is the builder for creating many RoleUser entities in bulk.

func (*RoleUserCreateBulk) Exec added in v0.11.1

func (rucb *RoleUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUserCreateBulk) ExecX added in v0.11.1

func (rucb *RoleUserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserCreateBulk) OnConflict added in v0.11.1

func (rucb *RoleUserCreateBulk) OnConflict(opts ...sql.ConflictOption) *RoleUserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.RoleUser.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUserUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*RoleUserCreateBulk) OnConflictColumns added in v0.11.1

func (rucb *RoleUserCreateBulk) OnConflictColumns(columns ...string) *RoleUserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.RoleUser.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RoleUserCreateBulk) Save added in v0.11.1

func (rucb *RoleUserCreateBulk) Save(ctx context.Context) ([]*RoleUser, error)

Save creates the RoleUser entities in the database.

func (*RoleUserCreateBulk) SaveX added in v0.11.1

func (rucb *RoleUserCreateBulk) SaveX(ctx context.Context) []*RoleUser

SaveX is like Save, but panics if an error occurs.

type RoleUserDelete added in v0.11.1

type RoleUserDelete struct {
	// contains filtered or unexported fields
}

RoleUserDelete is the builder for deleting a RoleUser entity.

func (*RoleUserDelete) Exec added in v0.11.1

func (rud *RoleUserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoleUserDelete) ExecX added in v0.11.1

func (rud *RoleUserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserDelete) Where added in v0.11.1

func (rud *RoleUserDelete) Where(ps ...predicate.RoleUser) *RoleUserDelete

Where appends a list predicates to the RoleUserDelete builder.

type RoleUserDeleteOne added in v0.11.1

type RoleUserDeleteOne struct {
	// contains filtered or unexported fields
}

RoleUserDeleteOne is the builder for deleting a single RoleUser entity.

func (*RoleUserDeleteOne) Exec added in v0.11.1

func (rudo *RoleUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleUserDeleteOne) ExecX added in v0.11.1

func (rudo *RoleUserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserDeleteOne) Where added in v0.11.7

Where appends a list predicates to the RoleUserDelete builder.

type RoleUserEdges added in v0.11.1

type RoleUserEdges struct {
	// Role holds the value of the role edge.
	Role *Role `json:"role,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

RoleUserEdges holds the relations/edges for other nodes in the graph.

func (RoleUserEdges) RoleOrErr added in v0.11.1

func (e RoleUserEdges) RoleOrErr() (*Role, error)

RoleOrErr returns the Role value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RoleUserEdges) UserOrErr added in v0.11.1

func (e RoleUserEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RoleUserFilter added in v0.11.2

type RoleUserFilter struct {
	// contains filtered or unexported fields
}

RoleUserFilter provides a generic filtering capability at runtime for RoleUserQuery.

func (*RoleUserFilter) Where added in v0.11.2

func (f *RoleUserFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*RoleUserFilter) WhereCreatedAt added in v0.11.2

func (f *RoleUserFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*RoleUserFilter) WhereHasRole added in v0.11.2

func (f *RoleUserFilter) WhereHasRole()

WhereHasRole applies a predicate to check if query has an edge role.

func (*RoleUserFilter) WhereHasRoleWith added in v0.11.2

func (f *RoleUserFilter) WhereHasRoleWith(preds ...predicate.Role)

WhereHasRoleWith applies a predicate to check if query has an edge role with a given conditions (other predicates).

func (*RoleUserFilter) WhereHasUser added in v0.11.2

func (f *RoleUserFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*RoleUserFilter) WhereHasUserWith added in v0.11.2

func (f *RoleUserFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*RoleUserFilter) WhereRoleID added in v0.11.2

func (f *RoleUserFilter) WhereRoleID(p entql.IntP)

WhereRoleID applies the entql int predicate on the role_id field.

func (*RoleUserFilter) WhereUserID added in v0.11.2

func (f *RoleUserFilter) WhereUserID(p entql.IntP)

WhereUserID applies the entql int predicate on the user_id field.

type RoleUserGroupBy added in v0.11.1

type RoleUserGroupBy struct {
	// contains filtered or unexported fields
}

RoleUserGroupBy is the group-by builder for RoleUser entities.

func (*RoleUserGroupBy) Aggregate added in v0.11.1

func (rugb *RoleUserGroupBy) Aggregate(fns ...AggregateFunc) *RoleUserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoleUserGroupBy) Bool added in v0.11.1

func (s *RoleUserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) BoolX added in v0.11.1

func (s *RoleUserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleUserGroupBy) Bools added in v0.11.1

func (s *RoleUserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) BoolsX added in v0.11.1

func (s *RoleUserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleUserGroupBy) Float64 added in v0.11.1

func (s *RoleUserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) Float64X added in v0.11.1

func (s *RoleUserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleUserGroupBy) Float64s added in v0.11.1

func (s *RoleUserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) Float64sX added in v0.11.1

func (s *RoleUserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleUserGroupBy) Int added in v0.11.1

func (s *RoleUserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) IntX added in v0.11.1

func (s *RoleUserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleUserGroupBy) Ints added in v0.11.1

func (s *RoleUserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) IntsX added in v0.11.1

func (s *RoleUserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleUserGroupBy) Scan added in v0.11.1

func (rugb *RoleUserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleUserGroupBy) ScanX added in v0.11.1

func (s *RoleUserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleUserGroupBy) String added in v0.11.1

func (s *RoleUserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) StringX added in v0.11.1

func (s *RoleUserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleUserGroupBy) Strings added in v0.11.1

func (s *RoleUserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleUserGroupBy) StringsX added in v0.11.1

func (s *RoleUserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleUserMutation added in v0.11.1

type RoleUserMutation struct {
	// contains filtered or unexported fields
}

RoleUserMutation represents an operation that mutates the RoleUser nodes in the graph.

func (*RoleUserMutation) AddField added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) AddedEdges added in v0.11.1

func (m *RoleUserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoleUserMutation) AddedField added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) AddedFields added in v0.11.1

func (m *RoleUserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoleUserMutation) AddedIDs added in v0.11.1

func (m *RoleUserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoleUserMutation) ClearEdge added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) ClearField added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) ClearRole added in v0.11.1

func (m *RoleUserMutation) ClearRole()

ClearRole clears the "role" edge to the Role entity.

func (*RoleUserMutation) ClearUser added in v0.11.1

func (m *RoleUserMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*RoleUserMutation) ClearedEdges added in v0.11.1

func (m *RoleUserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoleUserMutation) ClearedFields added in v0.11.1

func (m *RoleUserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoleUserMutation) Client added in v0.11.1

func (m RoleUserMutation) 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 (*RoleUserMutation) CreatedAt added in v0.11.1

func (m *RoleUserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RoleUserMutation) EdgeCleared added in v0.11.1

func (m *RoleUserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoleUserMutation) Field added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) FieldCleared added in v0.11.1

func (m *RoleUserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoleUserMutation) Fields added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) Filter added in v0.11.2

func (m *RoleUserMutation) Filter() *RoleUserFilter

Filter returns an entql.Where implementation to apply filters on the RoleUserMutation builder.

func (*RoleUserMutation) OldField added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) Op added in v0.11.1

func (m *RoleUserMutation) Op() Op

Op returns the operation name.

func (*RoleUserMutation) RemovedEdges added in v0.11.1

func (m *RoleUserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoleUserMutation) RemovedIDs added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) ResetCreatedAt added in v0.11.1

func (m *RoleUserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoleUserMutation) ResetEdge added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) ResetField added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) ResetRole added in v0.11.1

func (m *RoleUserMutation) ResetRole()

ResetRole resets all changes to the "role" edge.

func (*RoleUserMutation) ResetRoleID added in v0.11.1

func (m *RoleUserMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*RoleUserMutation) ResetUser added in v0.11.1

func (m *RoleUserMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*RoleUserMutation) ResetUserID added in v0.11.1

func (m *RoleUserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*RoleUserMutation) RoleCleared added in v0.11.1

func (m *RoleUserMutation) RoleCleared() bool

RoleCleared reports if the "role" edge to the Role entity was cleared.

func (*RoleUserMutation) RoleID added in v0.11.1

func (m *RoleUserMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*RoleUserMutation) RoleIDs added in v0.11.1

func (m *RoleUserMutation) RoleIDs() (ids []int)

RoleIDs returns the "role" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoleID instead. It exists only for internal usage by the builders.

func (*RoleUserMutation) SetCreatedAt added in v0.11.1

func (m *RoleUserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RoleUserMutation) SetField added in v0.11.1

func (m *RoleUserMutation) 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 (*RoleUserMutation) SetOp added in v0.11.5

func (m *RoleUserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RoleUserMutation) SetRoleID added in v0.11.1

func (m *RoleUserMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*RoleUserMutation) SetUserID added in v0.11.1

func (m *RoleUserMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (RoleUserMutation) Tx added in v0.11.1

func (m RoleUserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoleUserMutation) Type added in v0.11.1

func (m *RoleUserMutation) Type() string

Type returns the node type of this mutation (RoleUser).

func (*RoleUserMutation) UserCleared added in v0.11.1

func (m *RoleUserMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*RoleUserMutation) UserID added in v0.11.1

func (m *RoleUserMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*RoleUserMutation) UserIDs added in v0.11.1

func (m *RoleUserMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*RoleUserMutation) Where added in v0.11.1

func (m *RoleUserMutation) Where(ps ...predicate.RoleUser)

Where appends a list predicates to the RoleUserMutation builder.

func (*RoleUserMutation) WhereP added in v0.11.5

func (m *RoleUserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RoleUserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RoleUserQuery added in v0.11.1

type RoleUserQuery struct {
	// contains filtered or unexported fields
}

RoleUserQuery is the builder for querying RoleUser entities.

func (*RoleUserQuery) Aggregate added in v0.11.4

func (ruq *RoleUserQuery) Aggregate(fns ...AggregateFunc) *RoleUserSelect

Aggregate returns a RoleUserSelect configured with the given aggregations.

func (*RoleUserQuery) All added in v0.11.1

func (ruq *RoleUserQuery) All(ctx context.Context) ([]*RoleUser, error)

All executes the query and returns a list of RoleUsers.

func (*RoleUserQuery) AllX added in v0.11.1

func (ruq *RoleUserQuery) AllX(ctx context.Context) []*RoleUser

AllX is like All, but panics if an error occurs.

func (*RoleUserQuery) Clone added in v0.11.1

func (ruq *RoleUserQuery) Clone() *RoleUserQuery

Clone returns a duplicate of the RoleUserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoleUserQuery) Count added in v0.11.1

func (ruq *RoleUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleUserQuery) CountX added in v0.11.1

func (ruq *RoleUserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoleUserQuery) Exist added in v0.11.1

func (ruq *RoleUserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoleUserQuery) ExistX added in v0.11.1

func (ruq *RoleUserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoleUserQuery) Filter added in v0.11.2

func (ruq *RoleUserQuery) Filter() *RoleUserFilter

Filter returns a Filter implementation to apply filters on the RoleUserQuery builder.

func (*RoleUserQuery) First added in v0.11.1

func (ruq *RoleUserQuery) First(ctx context.Context) (*RoleUser, error)

First returns the first RoleUser entity from the query. Returns a *NotFoundError when no RoleUser was found.

func (*RoleUserQuery) FirstX added in v0.11.1

func (ruq *RoleUserQuery) FirstX(ctx context.Context) *RoleUser

FirstX is like First, but panics if an error occurs.

func (*RoleUserQuery) GroupBy added in v0.11.1

func (ruq *RoleUserQuery) GroupBy(field string, fields ...string) *RoleUserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RoleUser.Query().
	GroupBy(roleuser.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoleUserQuery) Limit added in v0.11.1

func (ruq *RoleUserQuery) Limit(limit int) *RoleUserQuery

Limit the number of records to be returned by this query.

func (*RoleUserQuery) Offset added in v0.11.1

func (ruq *RoleUserQuery) Offset(offset int) *RoleUserQuery

Offset to start from.

func (*RoleUserQuery) Only added in v0.11.1

func (ruq *RoleUserQuery) Only(ctx context.Context) (*RoleUser, error)

Only returns a single RoleUser entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RoleUser entity is found. Returns a *NotFoundError when no RoleUser entities are found.

func (*RoleUserQuery) OnlyX added in v0.11.1

func (ruq *RoleUserQuery) OnlyX(ctx context.Context) *RoleUser

OnlyX is like Only, but panics if an error occurs.

func (*RoleUserQuery) Order added in v0.11.1

func (ruq *RoleUserQuery) Order(o ...OrderFunc) *RoleUserQuery

Order specifies how the records should be ordered.

func (*RoleUserQuery) QueryRole added in v0.11.1

func (ruq *RoleUserQuery) QueryRole() *RoleQuery

QueryRole chains the current query on the "role" edge.

func (*RoleUserQuery) QueryUser added in v0.11.1

func (ruq *RoleUserQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*RoleUserQuery) Select added in v0.11.1

func (ruq *RoleUserQuery) Select(fields ...string) *RoleUserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.RoleUser.Query().
	Select(roleuser.FieldCreatedAt).
	Scan(ctx, &v)

func (*RoleUserQuery) Unique added in v0.11.1

func (ruq *RoleUserQuery) Unique(unique bool) *RoleUserQuery

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 (*RoleUserQuery) Where added in v0.11.1

func (ruq *RoleUserQuery) Where(ps ...predicate.RoleUser) *RoleUserQuery

Where adds a new predicate for the RoleUserQuery builder.

func (*RoleUserQuery) WithRole added in v0.11.1

func (ruq *RoleUserQuery) WithRole(opts ...func(*RoleQuery)) *RoleUserQuery

WithRole tells the query-builder to eager-load the nodes that are connected to the "role" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoleUserQuery) WithUser added in v0.11.1

func (ruq *RoleUserQuery) WithUser(opts ...func(*UserQuery)) *RoleUserQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type RoleUserSelect added in v0.11.1

type RoleUserSelect struct {
	*RoleUserQuery
	// contains filtered or unexported fields
}

RoleUserSelect is the builder for selecting fields of RoleUser entities.

func (*RoleUserSelect) Aggregate added in v0.11.4

func (rus *RoleUserSelect) Aggregate(fns ...AggregateFunc) *RoleUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleUserSelect) Bool added in v0.11.1

func (s *RoleUserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) BoolX added in v0.11.1

func (s *RoleUserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleUserSelect) Bools added in v0.11.1

func (s *RoleUserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) BoolsX added in v0.11.1

func (s *RoleUserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleUserSelect) Float64 added in v0.11.1

func (s *RoleUserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) Float64X added in v0.11.1

func (s *RoleUserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleUserSelect) Float64s added in v0.11.1

func (s *RoleUserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) Float64sX added in v0.11.1

func (s *RoleUserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleUserSelect) Int added in v0.11.1

func (s *RoleUserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) IntX added in v0.11.1

func (s *RoleUserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleUserSelect) Ints added in v0.11.1

func (s *RoleUserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) IntsX added in v0.11.1

func (s *RoleUserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleUserSelect) Scan added in v0.11.1

func (rus *RoleUserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleUserSelect) ScanX added in v0.11.1

func (s *RoleUserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleUserSelect) String added in v0.11.1

func (s *RoleUserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) StringX added in v0.11.1

func (s *RoleUserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleUserSelect) Strings added in v0.11.1

func (s *RoleUserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleUserSelect) StringsX added in v0.11.1

func (s *RoleUserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleUserUpdate added in v0.11.1

type RoleUserUpdate struct {
	// contains filtered or unexported fields
}

RoleUserUpdate is the builder for updating RoleUser entities.

func (*RoleUserUpdate) ClearRole added in v0.11.1

func (ruu *RoleUserUpdate) ClearRole() *RoleUserUpdate

ClearRole clears the "role" edge to the Role entity.

func (*RoleUserUpdate) ClearUser added in v0.11.1

func (ruu *RoleUserUpdate) ClearUser() *RoleUserUpdate

ClearUser clears the "user" edge to the User entity.

func (*RoleUserUpdate) Exec added in v0.11.1

func (ruu *RoleUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUserUpdate) ExecX added in v0.11.1

func (ruu *RoleUserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserUpdate) Mutation added in v0.11.1

func (ruu *RoleUserUpdate) Mutation() *RoleUserMutation

Mutation returns the RoleUserMutation object of the builder.

func (*RoleUserUpdate) Save added in v0.11.1

func (ruu *RoleUserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoleUserUpdate) SaveX added in v0.11.1

func (ruu *RoleUserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoleUserUpdate) SetCreatedAt added in v0.11.1

func (ruu *RoleUserUpdate) SetCreatedAt(t time.Time) *RoleUserUpdate

SetCreatedAt sets the "created_at" field.

func (*RoleUserUpdate) SetNillableCreatedAt added in v0.11.1

func (ruu *RoleUserUpdate) SetNillableCreatedAt(t *time.Time) *RoleUserUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleUserUpdate) SetRole added in v0.11.1

func (ruu *RoleUserUpdate) SetRole(r *Role) *RoleUserUpdate

SetRole sets the "role" edge to the Role entity.

func (*RoleUserUpdate) SetRoleID added in v0.11.1

func (ruu *RoleUserUpdate) SetRoleID(i int) *RoleUserUpdate

SetRoleID sets the "role_id" field.

func (*RoleUserUpdate) SetUser added in v0.11.1

func (ruu *RoleUserUpdate) SetUser(u *User) *RoleUserUpdate

SetUser sets the "user" edge to the User entity.

func (*RoleUserUpdate) SetUserID added in v0.11.1

func (ruu *RoleUserUpdate) SetUserID(i int) *RoleUserUpdate

SetUserID sets the "user_id" field.

func (*RoleUserUpdate) Where added in v0.11.1

func (ruu *RoleUserUpdate) Where(ps ...predicate.RoleUser) *RoleUserUpdate

Where appends a list predicates to the RoleUserUpdate builder.

type RoleUserUpdateOne added in v0.11.1

type RoleUserUpdateOne struct {
	// contains filtered or unexported fields
}

RoleUserUpdateOne is the builder for updating a single RoleUser entity.

func (*RoleUserUpdateOne) ClearRole added in v0.11.1

func (ruuo *RoleUserUpdateOne) ClearRole() *RoleUserUpdateOne

ClearRole clears the "role" edge to the Role entity.

func (*RoleUserUpdateOne) ClearUser added in v0.11.1

func (ruuo *RoleUserUpdateOne) ClearUser() *RoleUserUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*RoleUserUpdateOne) Exec added in v0.11.1

func (ruuo *RoleUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUserUpdateOne) ExecX added in v0.11.1

func (ruuo *RoleUserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserUpdateOne) Mutation added in v0.11.1

func (ruuo *RoleUserUpdateOne) Mutation() *RoleUserMutation

Mutation returns the RoleUserMutation object of the builder.

func (*RoleUserUpdateOne) Save added in v0.11.1

func (ruuo *RoleUserUpdateOne) Save(ctx context.Context) (*RoleUser, error)

Save executes the query and returns the updated RoleUser entity.

func (*RoleUserUpdateOne) SaveX added in v0.11.1

func (ruuo *RoleUserUpdateOne) SaveX(ctx context.Context) *RoleUser

SaveX is like Save, but panics if an error occurs.

func (*RoleUserUpdateOne) Select added in v0.11.1

func (ruuo *RoleUserUpdateOne) Select(field string, fields ...string) *RoleUserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoleUserUpdateOne) SetCreatedAt added in v0.11.1

func (ruuo *RoleUserUpdateOne) SetCreatedAt(t time.Time) *RoleUserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*RoleUserUpdateOne) SetNillableCreatedAt added in v0.11.1

func (ruuo *RoleUserUpdateOne) SetNillableCreatedAt(t *time.Time) *RoleUserUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleUserUpdateOne) SetRole added in v0.11.1

func (ruuo *RoleUserUpdateOne) SetRole(r *Role) *RoleUserUpdateOne

SetRole sets the "role" edge to the Role entity.

func (*RoleUserUpdateOne) SetRoleID added in v0.11.1

func (ruuo *RoleUserUpdateOne) SetRoleID(i int) *RoleUserUpdateOne

SetRoleID sets the "role_id" field.

func (*RoleUserUpdateOne) SetUser added in v0.11.1

func (ruuo *RoleUserUpdateOne) SetUser(u *User) *RoleUserUpdateOne

SetUser sets the "user" edge to the User entity.

func (*RoleUserUpdateOne) SetUserID added in v0.11.1

func (ruuo *RoleUserUpdateOne) SetUserID(i int) *RoleUserUpdateOne

SetUserID sets the "user_id" field.

func (*RoleUserUpdateOne) Where added in v0.11.8

Where appends a list predicates to the RoleUserUpdate builder.

type RoleUserUpsert added in v0.11.1

type RoleUserUpsert struct {
	*sql.UpdateSet
}

RoleUserUpsert is the "OnConflict" setter.

func (*RoleUserUpsert) SetCreatedAt added in v0.11.1

func (u *RoleUserUpsert) SetCreatedAt(v time.Time) *RoleUserUpsert

SetCreatedAt sets the "created_at" field.

func (*RoleUserUpsert) SetRoleID added in v0.11.1

func (u *RoleUserUpsert) SetRoleID(v int) *RoleUserUpsert

SetRoleID sets the "role_id" field.

func (*RoleUserUpsert) SetUserID added in v0.11.1

func (u *RoleUserUpsert) SetUserID(v int) *RoleUserUpsert

SetUserID sets the "user_id" field.

func (*RoleUserUpsert) UpdateCreatedAt added in v0.11.1

func (u *RoleUserUpsert) UpdateCreatedAt() *RoleUserUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*RoleUserUpsert) UpdateRoleID added in v0.11.1

func (u *RoleUserUpsert) UpdateRoleID() *RoleUserUpsert

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*RoleUserUpsert) UpdateUserID added in v0.11.1

func (u *RoleUserUpsert) UpdateUserID() *RoleUserUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type RoleUserUpsertBulk added in v0.11.1

type RoleUserUpsertBulk struct {
	// contains filtered or unexported fields
}

RoleUserUpsertBulk is the builder for "upsert"-ing a bulk of RoleUser nodes.

func (*RoleUserUpsertBulk) DoNothing added in v0.11.1

func (u *RoleUserUpsertBulk) DoNothing() *RoleUserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUserUpsertBulk) Exec added in v0.11.1

func (u *RoleUserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUserUpsertBulk) ExecX added in v0.11.1

func (u *RoleUserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserUpsertBulk) Ignore added in v0.11.1

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.RoleUser.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RoleUserUpsertBulk) SetCreatedAt added in v0.11.1

func (u *RoleUserUpsertBulk) SetCreatedAt(v time.Time) *RoleUserUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*RoleUserUpsertBulk) SetRoleID added in v0.11.1

func (u *RoleUserUpsertBulk) SetRoleID(v int) *RoleUserUpsertBulk

SetRoleID sets the "role_id" field.

func (*RoleUserUpsertBulk) SetUserID added in v0.11.1

func (u *RoleUserUpsertBulk) SetUserID(v int) *RoleUserUpsertBulk

SetUserID sets the "user_id" field.

func (*RoleUserUpsertBulk) Update added in v0.11.1

func (u *RoleUserUpsertBulk) Update(set func(*RoleUserUpsert)) *RoleUserUpsertBulk

Update allows overriding fields `UPDATE` values. See the RoleUserCreateBulk.OnConflict documentation for more info.

func (*RoleUserUpsertBulk) UpdateCreatedAt added in v0.11.1

func (u *RoleUserUpsertBulk) UpdateCreatedAt() *RoleUserUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*RoleUserUpsertBulk) UpdateNewValues added in v0.11.1

func (u *RoleUserUpsertBulk) UpdateNewValues() *RoleUserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.RoleUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RoleUserUpsertBulk) UpdateRoleID added in v0.11.1

func (u *RoleUserUpsertBulk) UpdateRoleID() *RoleUserUpsertBulk

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*RoleUserUpsertBulk) UpdateUserID added in v0.11.1

func (u *RoleUserUpsertBulk) UpdateUserID() *RoleUserUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type RoleUserUpsertOne added in v0.11.1

type RoleUserUpsertOne struct {
	// contains filtered or unexported fields
}

RoleUserUpsertOne is the builder for "upsert"-ing

one RoleUser node.

func (*RoleUserUpsertOne) DoNothing added in v0.11.1

func (u *RoleUserUpsertOne) DoNothing() *RoleUserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUserUpsertOne) Exec added in v0.11.1

func (u *RoleUserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUserUpsertOne) ExecX added in v0.11.1

func (u *RoleUserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUserUpsertOne) Ignore added in v0.11.1

func (u *RoleUserUpsertOne) Ignore() *RoleUserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.RoleUser.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RoleUserUpsertOne) SetCreatedAt added in v0.11.1

func (u *RoleUserUpsertOne) SetCreatedAt(v time.Time) *RoleUserUpsertOne

SetCreatedAt sets the "created_at" field.

func (*RoleUserUpsertOne) SetRoleID added in v0.11.1

func (u *RoleUserUpsertOne) SetRoleID(v int) *RoleUserUpsertOne

SetRoleID sets the "role_id" field.

func (*RoleUserUpsertOne) SetUserID added in v0.11.1

func (u *RoleUserUpsertOne) SetUserID(v int) *RoleUserUpsertOne

SetUserID sets the "user_id" field.

func (*RoleUserUpsertOne) Update added in v0.11.1

func (u *RoleUserUpsertOne) Update(set func(*RoleUserUpsert)) *RoleUserUpsertOne

Update allows overriding fields `UPDATE` values. See the RoleUserCreate.OnConflict documentation for more info.

func (*RoleUserUpsertOne) UpdateCreatedAt added in v0.11.1

func (u *RoleUserUpsertOne) UpdateCreatedAt() *RoleUserUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*RoleUserUpsertOne) UpdateNewValues added in v0.11.1

func (u *RoleUserUpsertOne) UpdateNewValues() *RoleUserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.RoleUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RoleUserUpsertOne) UpdateRoleID added in v0.11.1

func (u *RoleUserUpsertOne) UpdateRoleID() *RoleUserUpsertOne

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*RoleUserUpsertOne) UpdateUserID added in v0.11.1

func (u *RoleUserUpsertOne) UpdateUserID() *RoleUserUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type RoleUsers added in v0.11.1

type RoleUsers []*RoleUser

RoleUsers is a parsable slice of RoleUser.

type Roles added in v0.11.1

type Roles []*Role

Roles is a parsable slice of Role.

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 Tag

type Tag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryGroupTags added in v0.11.5

func (t *Tag) QueryGroupTags() *GroupTagQuery

QueryGroupTags queries the "group_tags" edge of the Tag entity.

func (*Tag) QueryGroups added in v0.11.5

func (t *Tag) QueryGroups() *GroupQuery

QueryGroups queries the "groups" edge of the Tag entity.

func (*Tag) QueryTweetTags

func (t *Tag) QueryTweetTags() *TweetTagQuery

QueryTweetTags queries the "tweet_tags" edge of the Tag entity.

func (*Tag) QueryTweets

func (t *Tag) QueryTweets() *TweetQuery

QueryTweets queries the "tweets" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

Unwrap unwraps the Tag 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 (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.

type TagClient

type TagClient struct {
	// contains filtered or unexported fields
}

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

CreateBulk returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int) *TagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

GetX is like Get, but panics if an error occurs.

func (*TagClient) Hooks

func (c *TagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TagClient) Intercept added in v0.11.5

func (c *TagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.

func (*TagClient) Interceptors added in v0.11.5

func (c *TagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryGroupTags added in v0.11.5

func (c *TagClient) QueryGroupTags(t *Tag) *GroupTagQuery

QueryGroupTags queries the group_tags edge of a Tag.

func (*TagClient) QueryGroups added in v0.11.5

func (c *TagClient) QueryGroups(t *Tag) *GroupQuery

QueryGroups queries the groups edge of a Tag.

func (*TagClient) QueryTweetTags

func (c *TagClient) QueryTweetTags(t *Tag) *TweetTagQuery

QueryTweetTags queries the tweet_tags edge of a Tag.

func (*TagClient) QueryTweets

func (c *TagClient) QueryTweets(t *Tag) *TweetQuery

QueryTweets queries the tweets edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

func (c *TagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.

type TagCreate

type TagCreate struct {
	// contains filtered or unexported fields
}

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddGroupIDs added in v0.11.5

func (tc *TagCreate) AddGroupIDs(ids ...int) *TagCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*TagCreate) AddGroupTagIDs added in v0.11.5

func (tc *TagCreate) AddGroupTagIDs(ids ...int) *TagCreate

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by IDs.

func (*TagCreate) AddGroupTags added in v0.11.5

func (tc *TagCreate) AddGroupTags(g ...*GroupTag) *TagCreate

AddGroupTags adds the "group_tags" edges to the GroupTag entity.

func (*TagCreate) AddGroups added in v0.11.5

func (tc *TagCreate) AddGroups(g ...*Group) *TagCreate

AddGroups adds the "groups" edges to the Group entity.

func (*TagCreate) AddTweetIDs

func (tc *TagCreate) AddTweetIDs(ids ...int) *TagCreate

AddTweetIDs adds the "tweets" edge to the Tweet entity by IDs.

func (*TagCreate) AddTweetTagIDs

func (tc *TagCreate) AddTweetTagIDs(ids ...uuid.UUID) *TagCreate

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TagCreate) AddTweetTags

func (tc *TagCreate) AddTweetTags(t ...*TweetTag) *TagCreate

AddTweetTags adds the "tweet_tags" edges to the TweetTag entity.

func (*TagCreate) AddTweets

func (tc *TagCreate) AddTweets(t ...*Tweet) *TagCreate

AddTweets adds the "tweets" edges to the Tweet entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) OnConflict

func (tc *TagCreate) OnConflict(opts ...sql.ConflictOption) *TagUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tag.Create().
	SetValue(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TagUpsert) {
		SetValue(v+v).
	}).
	Exec(ctx)

func (*TagCreate) OnConflictColumns

func (tc *TagCreate) OnConflictColumns(columns ...string) *TagUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetValue

func (tc *TagCreate) SetValue(s string) *TagCreate

SetValue sets the "value" field.

type TagCreateBulk

type TagCreateBulk struct {
	// contains filtered or unexported fields
}

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreateBulk) OnConflict

func (tcb *TagCreateBulk) OnConflict(opts ...sql.ConflictOption) *TagUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tag.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TagUpsert) {
		SetValue(v+v).
	}).
	Exec(ctx)

func (*TagCreateBulk) OnConflictColumns

func (tcb *TagCreateBulk) OnConflictColumns(columns ...string) *TagUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX is like Save, but panics if an error occurs.

type TagDelete

type TagDelete struct {
	// contains filtered or unexported fields
}

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

type TagDeleteOne struct {
	// contains filtered or unexported fields
}

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagDeleteOne) Where added in v0.11.7

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Tweets holds the value of the tweets edge.
	Tweets []*Tweet `json:"tweets,omitempty"`
	// Groups holds the value of the groups edge.
	Groups []*Group `json:"groups,omitempty"`
	// TweetTags holds the value of the tweet_tags edge.
	TweetTags []*TweetTag `json:"tweet_tags,omitempty"`
	// GroupTags holds the value of the group_tags edge.
	GroupTags []*GroupTag `json:"group_tags,omitempty"`
	// contains filtered or unexported fields
}

TagEdges holds the relations/edges for other nodes in the graph.

func (TagEdges) GroupTagsOrErr added in v0.11.5

func (e TagEdges) GroupTagsOrErr() ([]*GroupTag, error)

GroupTagsOrErr returns the GroupTags value or an error if the edge was not loaded in eager-loading.

func (TagEdges) GroupsOrErr added in v0.11.5

func (e TagEdges) GroupsOrErr() ([]*Group, error)

GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.

func (TagEdges) TweetTagsOrErr

func (e TagEdges) TweetTagsOrErr() ([]*TweetTag, error)

TweetTagsOrErr returns the TweetTags value or an error if the edge was not loaded in eager-loading.

func (TagEdges) TweetsOrErr

func (e TagEdges) TweetsOrErr() ([]*Tweet, error)

TweetsOrErr returns the Tweets value or an error if the edge was not loaded in eager-loading.

type TagFilter added in v0.11.2

type TagFilter struct {
	// contains filtered or unexported fields
}

TagFilter provides a generic filtering capability at runtime for TagQuery.

func (*TagFilter) Where added in v0.11.2

func (f *TagFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*TagFilter) WhereHasGroupTags added in v0.11.5

func (f *TagFilter) WhereHasGroupTags()

WhereHasGroupTags applies a predicate to check if query has an edge group_tags.

func (*TagFilter) WhereHasGroupTagsWith added in v0.11.5

func (f *TagFilter) WhereHasGroupTagsWith(preds ...predicate.GroupTag)

WhereHasGroupTagsWith applies a predicate to check if query has an edge group_tags with a given conditions (other predicates).

func (*TagFilter) WhereHasGroups added in v0.11.5

func (f *TagFilter) WhereHasGroups()

WhereHasGroups applies a predicate to check if query has an edge groups.

func (*TagFilter) WhereHasGroupsWith added in v0.11.5

func (f *TagFilter) WhereHasGroupsWith(preds ...predicate.Group)

WhereHasGroupsWith applies a predicate to check if query has an edge groups with a given conditions (other predicates).

func (*TagFilter) WhereHasTweetTags added in v0.11.2

func (f *TagFilter) WhereHasTweetTags()

WhereHasTweetTags applies a predicate to check if query has an edge tweet_tags.

func (*TagFilter) WhereHasTweetTagsWith added in v0.11.2

func (f *TagFilter) WhereHasTweetTagsWith(preds ...predicate.TweetTag)

WhereHasTweetTagsWith applies a predicate to check if query has an edge tweet_tags with a given conditions (other predicates).

func (*TagFilter) WhereHasTweets added in v0.11.2

func (f *TagFilter) WhereHasTweets()

WhereHasTweets applies a predicate to check if query has an edge tweets.

func (*TagFilter) WhereHasTweetsWith added in v0.11.2

func (f *TagFilter) WhereHasTweetsWith(preds ...predicate.Tweet)

WhereHasTweetsWith applies a predicate to check if query has an edge tweets with a given conditions (other predicates).

func (*TagFilter) WhereID added in v0.11.2

func (f *TagFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*TagFilter) WhereValue added in v0.11.2

func (f *TagFilter) WhereValue(p entql.StringP)

WhereValue applies the entql string predicate on the value field.

type TagGroupBy

type TagGroupBy struct {
	// contains filtered or unexported fields
}

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TagGroupBy) Bool

func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolX

func (s *TagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagGroupBy) Bools

func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolsX

func (s *TagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagGroupBy) Float64

func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64X

func (s *TagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagGroupBy) Float64s

func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64sX

func (s *TagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagGroupBy) Int

func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntX

func (s *TagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagGroupBy) Ints

func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntsX

func (s *TagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagGroupBy) String

func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringX

func (s *TagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagGroupBy) Strings

func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringsX

func (s *TagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagMutation

type TagMutation struct {
	// contains filtered or unexported fields
}

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) 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 (*TagMutation) AddGroupIDs added in v0.11.5

func (m *TagMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the "groups" edge to the Group entity by ids.

func (*TagMutation) AddGroupTagIDs added in v0.11.5

func (m *TagMutation) AddGroupTagIDs(ids ...int)

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by ids.

func (*TagMutation) AddTweetIDs

func (m *TagMutation) AddTweetIDs(ids ...int)

AddTweetIDs adds the "tweets" edge to the Tweet entity by ids.

func (*TagMutation) AddTweetTagIDs

func (m *TagMutation) AddTweetTagIDs(ids ...uuid.UUID)

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by ids.

func (*TagMutation) AddedEdges

func (m *TagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TagMutation) AddedField

func (m *TagMutation) 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 (*TagMutation) AddedFields

func (m *TagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TagMutation) AddedIDs

func (m *TagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TagMutation) ClearEdge

func (m *TagMutation) 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 (*TagMutation) ClearField

func (m *TagMutation) 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 (*TagMutation) ClearGroupTags added in v0.11.5

func (m *TagMutation) ClearGroupTags()

ClearGroupTags clears the "group_tags" edge to the GroupTag entity.

func (*TagMutation) ClearGroups added in v0.11.5

func (m *TagMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*TagMutation) ClearTweetTags

func (m *TagMutation) ClearTweetTags()

ClearTweetTags clears the "tweet_tags" edge to the TweetTag entity.

func (*TagMutation) ClearTweets

func (m *TagMutation) ClearTweets()

ClearTweets clears the "tweets" edge to the Tweet entity.

func (*TagMutation) ClearedEdges

func (m *TagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TagMutation) ClearedFields

func (m *TagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TagMutation) Client

func (m TagMutation) 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 (*TagMutation) EdgeCleared

func (m *TagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TagMutation) Field

func (m *TagMutation) 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 (*TagMutation) FieldCleared

func (m *TagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TagMutation) Fields

func (m *TagMutation) 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 (*TagMutation) Filter added in v0.11.2

func (m *TagMutation) Filter() *TagFilter

Filter returns an entql.Where implementation to apply filters on the TagMutation builder.

func (*TagMutation) GroupTagsCleared added in v0.11.5

func (m *TagMutation) GroupTagsCleared() bool

GroupTagsCleared reports if the "group_tags" edge to the GroupTag entity was cleared.

func (*TagMutation) GroupTagsIDs added in v0.11.5

func (m *TagMutation) GroupTagsIDs() (ids []int)

GroupTagsIDs returns the "group_tags" edge IDs in the mutation.

func (*TagMutation) GroupsCleared added in v0.11.5

func (m *TagMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Group entity was cleared.

func (*TagMutation) GroupsIDs added in v0.11.5

func (m *TagMutation) GroupsIDs() (ids []int)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*TagMutation) ID

func (m *TagMutation) 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 (*TagMutation) IDs

func (m *TagMutation) 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 (*TagMutation) OldField

func (m *TagMutation) 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 (*TagMutation) OldValue

func (m *TagMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the Tag entity. If the Tag 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 (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) RemoveGroupIDs added in v0.11.5

func (m *TagMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.

func (*TagMutation) RemoveGroupTagIDs added in v0.11.5

func (m *TagMutation) RemoveGroupTagIDs(ids ...int)

RemoveGroupTagIDs removes the "group_tags" edge to the GroupTag entity by IDs.

func (*TagMutation) RemoveTweetIDs

func (m *TagMutation) RemoveTweetIDs(ids ...int)

RemoveTweetIDs removes the "tweets" edge to the Tweet entity by IDs.

func (*TagMutation) RemoveTweetTagIDs

func (m *TagMutation) RemoveTweetTagIDs(ids ...uuid.UUID)

RemoveTweetTagIDs removes the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TagMutation) RemovedEdges

func (m *TagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TagMutation) RemovedGroupTagsIDs added in v0.11.5

func (m *TagMutation) RemovedGroupTagsIDs() (ids []int)

RemovedGroupTags returns the removed IDs of the "group_tags" edge to the GroupTag entity.

func (*TagMutation) RemovedGroupsIDs added in v0.11.5

func (m *TagMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) RemovedTweetTagsIDs

func (m *TagMutation) RemovedTweetTagsIDs() (ids []uuid.UUID)

RemovedTweetTags returns the removed IDs of the "tweet_tags" edge to the TweetTag entity.

func (*TagMutation) RemovedTweetsIDs

func (m *TagMutation) RemovedTweetsIDs() (ids []int)

RemovedTweets returns the removed IDs of the "tweets" edge to the Tweet entity.

func (*TagMutation) ResetEdge

func (m *TagMutation) 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 (*TagMutation) ResetField

func (m *TagMutation) 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 (*TagMutation) ResetGroupTags added in v0.11.5

func (m *TagMutation) ResetGroupTags()

ResetGroupTags resets all changes to the "group_tags" edge.

func (*TagMutation) ResetGroups added in v0.11.5

func (m *TagMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*TagMutation) ResetTweetTags

func (m *TagMutation) ResetTweetTags()

ResetTweetTags resets all changes to the "tweet_tags" edge.

func (*TagMutation) ResetTweets

func (m *TagMutation) ResetTweets()

ResetTweets resets all changes to the "tweets" edge.

func (*TagMutation) ResetValue

func (m *TagMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*TagMutation) SetField

func (m *TagMutation) 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 (*TagMutation) SetOp added in v0.11.5

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetValue

func (m *TagMutation) SetValue(s string)

SetValue sets the "value" field.

func (*TagMutation) TweetTagsCleared

func (m *TagMutation) TweetTagsCleared() bool

TweetTagsCleared reports if the "tweet_tags" edge to the TweetTag entity was cleared.

func (*TagMutation) TweetTagsIDs

func (m *TagMutation) TweetTagsIDs() (ids []uuid.UUID)

TweetTagsIDs returns the "tweet_tags" edge IDs in the mutation.

func (*TagMutation) TweetsCleared

func (m *TagMutation) TweetsCleared() bool

TweetsCleared reports if the "tweets" edge to the Tweet entity was cleared.

func (*TagMutation) TweetsIDs

func (m *TagMutation) TweetsIDs() (ids []int)

TweetsIDs returns the "tweets" edge IDs in the mutation.

func (TagMutation) Tx

func (m TagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TagMutation) Type

func (m *TagMutation) Type() string

Type returns the node type of this mutation (Tag).

func (*TagMutation) Value

func (m *TagMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP added in v0.11.5

func (m *TagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TagQuery

type TagQuery struct {
	// contains filtered or unexported fields
}

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate added in v0.11.4

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

AllX is like All, but panics if an error occurs.

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagQuery) Filter added in v0.11.2

func (tq *TagQuery) Filter() *TagFilter

Filter returns a Filter implementation to apply filters on the TagQuery builder.

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

FirstX is like First, but panics if an error occurs.

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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 {
	Value string `json:"value,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldValue).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tag IDs.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit the number of records to be returned by this query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

OnlyX is like Only, but panics if an error occurs.

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...OrderFunc) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryGroupTags added in v0.11.5

func (tq *TagQuery) QueryGroupTags() *GroupTagQuery

QueryGroupTags chains the current query on the "group_tags" edge.

func (*TagQuery) QueryGroups added in v0.11.5

func (tq *TagQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*TagQuery) QueryTweetTags

func (tq *TagQuery) QueryTweetTags() *TweetTagQuery

QueryTweetTags chains the current query on the "tweet_tags" edge.

func (*TagQuery) QueryTweets

func (tq *TagQuery) QueryTweets() *TweetQuery

QueryTweets chains the current query on the "tweets" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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 {
	Value string `json:"value,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldValue).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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 (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithGroupTags added in v0.11.5

func (tq *TagQuery) WithGroupTags(opts ...func(*GroupTagQuery)) *TagQuery

WithGroupTags tells the query-builder to eager-load the nodes that are connected to the "group_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TagQuery) WithGroups added in v0.11.5

func (tq *TagQuery) WithGroups(opts ...func(*GroupQuery)) *TagQuery

WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*TagQuery) WithTweetTags

func (tq *TagQuery) WithTweetTags(opts ...func(*TweetTagQuery)) *TagQuery

WithTweetTags tells the query-builder to eager-load the nodes that are connected to the "tweet_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TagQuery) WithTweets

func (tq *TagQuery) WithTweets(opts ...func(*TweetQuery)) *TagQuery

WithTweets tells the query-builder to eager-load the nodes that are connected to the "tweets" edge. The optional arguments are used to configure the query builder of the edge.

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate added in v0.11.4

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolX

func (s *TagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagSelect) Bools

func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolsX

func (s *TagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagSelect) Float64

func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64X

func (s *TagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagSelect) Float64s

func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64sX

func (s *TagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagSelect) Int

func (s *TagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntX

func (s *TagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagSelect) Ints

func (s *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (s *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagSelect) ScanX

func (s *TagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (s *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (s *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (s *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (s *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddGroupIDs added in v0.11.5

func (tu *TagUpdate) AddGroupIDs(ids ...int) *TagUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*TagUpdate) AddGroupTagIDs added in v0.11.5

func (tu *TagUpdate) AddGroupTagIDs(ids ...int) *TagUpdate

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by IDs.

func (*TagUpdate) AddGroupTags added in v0.11.5

func (tu *TagUpdate) AddGroupTags(g ...*GroupTag) *TagUpdate

AddGroupTags adds the "group_tags" edges to the GroupTag entity.

func (*TagUpdate) AddGroups added in v0.11.5

func (tu *TagUpdate) AddGroups(g ...*Group) *TagUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*TagUpdate) AddTweetIDs

func (tu *TagUpdate) AddTweetIDs(ids ...int) *TagUpdate

AddTweetIDs adds the "tweets" edge to the Tweet entity by IDs.

func (*TagUpdate) AddTweetTagIDs

func (tu *TagUpdate) AddTweetTagIDs(ids ...uuid.UUID) *TagUpdate

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TagUpdate) AddTweetTags

func (tu *TagUpdate) AddTweetTags(t ...*TweetTag) *TagUpdate

AddTweetTags adds the "tweet_tags" edges to the TweetTag entity.

func (*TagUpdate) AddTweets

func (tu *TagUpdate) AddTweets(t ...*Tweet) *TagUpdate

AddTweets adds the "tweets" edges to the Tweet entity.

func (*TagUpdate) ClearGroupTags added in v0.11.5

func (tu *TagUpdate) ClearGroupTags() *TagUpdate

ClearGroupTags clears all "group_tags" edges to the GroupTag entity.

func (*TagUpdate) ClearGroups added in v0.11.5

func (tu *TagUpdate) ClearGroups() *TagUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*TagUpdate) ClearTweetTags

func (tu *TagUpdate) ClearTweetTags() *TagUpdate

ClearTweetTags clears all "tweet_tags" edges to the TweetTag entity.

func (*TagUpdate) ClearTweets

func (tu *TagUpdate) ClearTweets() *TagUpdate

ClearTweets clears all "tweets" edges to the Tweet entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveGroupIDs added in v0.11.5

func (tu *TagUpdate) RemoveGroupIDs(ids ...int) *TagUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*TagUpdate) RemoveGroupTagIDs added in v0.11.5

func (tu *TagUpdate) RemoveGroupTagIDs(ids ...int) *TagUpdate

RemoveGroupTagIDs removes the "group_tags" edge to GroupTag entities by IDs.

func (*TagUpdate) RemoveGroupTags added in v0.11.5

func (tu *TagUpdate) RemoveGroupTags(g ...*GroupTag) *TagUpdate

RemoveGroupTags removes "group_tags" edges to GroupTag entities.

func (*TagUpdate) RemoveGroups added in v0.11.5

func (tu *TagUpdate) RemoveGroups(g ...*Group) *TagUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*TagUpdate) RemoveTweetIDs

func (tu *TagUpdate) RemoveTweetIDs(ids ...int) *TagUpdate

RemoveTweetIDs removes the "tweets" edge to Tweet entities by IDs.

func (*TagUpdate) RemoveTweetTagIDs

func (tu *TagUpdate) RemoveTweetTagIDs(ids ...uuid.UUID) *TagUpdate

RemoveTweetTagIDs removes the "tweet_tags" edge to TweetTag entities by IDs.

func (*TagUpdate) RemoveTweetTags

func (tu *TagUpdate) RemoveTweetTags(t ...*TweetTag) *TagUpdate

RemoveTweetTags removes "tweet_tags" edges to TweetTag entities.

func (*TagUpdate) RemoveTweets

func (tu *TagUpdate) RemoveTweets(t ...*Tweet) *TagUpdate

RemoveTweets removes "tweets" edges to Tweet entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetValue

func (tu *TagUpdate) SetValue(s string) *TagUpdate

SetValue sets the "value" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

type TagUpdateOne struct {
	// contains filtered or unexported fields
}

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddGroupIDs added in v0.11.5

func (tuo *TagUpdateOne) AddGroupIDs(ids ...int) *TagUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*TagUpdateOne) AddGroupTagIDs added in v0.11.5

func (tuo *TagUpdateOne) AddGroupTagIDs(ids ...int) *TagUpdateOne

AddGroupTagIDs adds the "group_tags" edge to the GroupTag entity by IDs.

func (*TagUpdateOne) AddGroupTags added in v0.11.5

func (tuo *TagUpdateOne) AddGroupTags(g ...*GroupTag) *TagUpdateOne

AddGroupTags adds the "group_tags" edges to the GroupTag entity.

func (*TagUpdateOne) AddGroups added in v0.11.5

func (tuo *TagUpdateOne) AddGroups(g ...*Group) *TagUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*TagUpdateOne) AddTweetIDs

func (tuo *TagUpdateOne) AddTweetIDs(ids ...int) *TagUpdateOne

AddTweetIDs adds the "tweets" edge to the Tweet entity by IDs.

func (*TagUpdateOne) AddTweetTagIDs

func (tuo *TagUpdateOne) AddTweetTagIDs(ids ...uuid.UUID) *TagUpdateOne

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TagUpdateOne) AddTweetTags

func (tuo *TagUpdateOne) AddTweetTags(t ...*TweetTag) *TagUpdateOne

AddTweetTags adds the "tweet_tags" edges to the TweetTag entity.

func (*TagUpdateOne) AddTweets

func (tuo *TagUpdateOne) AddTweets(t ...*Tweet) *TagUpdateOne

AddTweets adds the "tweets" edges to the Tweet entity.

func (*TagUpdateOne) ClearGroupTags added in v0.11.5

func (tuo *TagUpdateOne) ClearGroupTags() *TagUpdateOne

ClearGroupTags clears all "group_tags" edges to the GroupTag entity.

func (*TagUpdateOne) ClearGroups added in v0.11.5

func (tuo *TagUpdateOne) ClearGroups() *TagUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*TagUpdateOne) ClearTweetTags

func (tuo *TagUpdateOne) ClearTweetTags() *TagUpdateOne

ClearTweetTags clears all "tweet_tags" edges to the TweetTag entity.

func (*TagUpdateOne) ClearTweets

func (tuo *TagUpdateOne) ClearTweets() *TagUpdateOne

ClearTweets clears all "tweets" edges to the Tweet entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveGroupIDs added in v0.11.5

func (tuo *TagUpdateOne) RemoveGroupIDs(ids ...int) *TagUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*TagUpdateOne) RemoveGroupTagIDs added in v0.11.5

func (tuo *TagUpdateOne) RemoveGroupTagIDs(ids ...int) *TagUpdateOne

RemoveGroupTagIDs removes the "group_tags" edge to GroupTag entities by IDs.

func (*TagUpdateOne) RemoveGroupTags added in v0.11.5

func (tuo *TagUpdateOne) RemoveGroupTags(g ...*GroupTag) *TagUpdateOne

RemoveGroupTags removes "group_tags" edges to GroupTag entities.

func (*TagUpdateOne) RemoveGroups added in v0.11.5

func (tuo *TagUpdateOne) RemoveGroups(g ...*Group) *TagUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*TagUpdateOne) RemoveTweetIDs

func (tuo *TagUpdateOne) RemoveTweetIDs(ids ...int) *TagUpdateOne

RemoveTweetIDs removes the "tweets" edge to Tweet entities by IDs.

func (*TagUpdateOne) RemoveTweetTagIDs

func (tuo *TagUpdateOne) RemoveTweetTagIDs(ids ...uuid.UUID) *TagUpdateOne

RemoveTweetTagIDs removes the "tweet_tags" edge to TweetTag entities by IDs.

func (*TagUpdateOne) RemoveTweetTags

func (tuo *TagUpdateOne) RemoveTweetTags(t ...*TweetTag) *TagUpdateOne

RemoveTweetTags removes "tweet_tags" edges to TweetTag entities.

func (*TagUpdateOne) RemoveTweets

func (tuo *TagUpdateOne) RemoveTweets(t ...*Tweet) *TagUpdateOne

RemoveTweets removes "tweets" edges to Tweet entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

SaveX is like Save, but panics if an error occurs.

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TagUpdateOne) SetValue

func (tuo *TagUpdateOne) SetValue(s string) *TagUpdateOne

SetValue sets the "value" field.

func (*TagUpdateOne) Where added in v0.11.8

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type TagUpsert

type TagUpsert struct {
	*sql.UpdateSet
}

TagUpsert is the "OnConflict" setter.

func (*TagUpsert) SetValue

func (u *TagUpsert) SetValue(v string) *TagUpsert

SetValue sets the "value" field.

func (*TagUpsert) UpdateValue

func (u *TagUpsert) UpdateValue() *TagUpsert

UpdateValue sets the "value" field to the value that was provided on create.

type TagUpsertBulk

type TagUpsertBulk struct {
	// contains filtered or unexported fields
}

TagUpsertBulk is the builder for "upsert"-ing a bulk of Tag nodes.

func (*TagUpsertBulk) DoNothing

func (u *TagUpsertBulk) DoNothing() *TagUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TagUpsertBulk) Exec

func (u *TagUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpsertBulk) ExecX

func (u *TagUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpsertBulk) Ignore

func (u *TagUpsertBulk) Ignore() *TagUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TagUpsertBulk) SetValue

func (u *TagUpsertBulk) SetValue(v string) *TagUpsertBulk

SetValue sets the "value" field.

func (*TagUpsertBulk) Update

func (u *TagUpsertBulk) Update(set func(*TagUpsert)) *TagUpsertBulk

Update allows overriding fields `UPDATE` values. See the TagCreateBulk.OnConflict documentation for more info.

func (*TagUpsertBulk) UpdateNewValues

func (u *TagUpsertBulk) UpdateNewValues() *TagUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TagUpsertBulk) UpdateValue

func (u *TagUpsertBulk) UpdateValue() *TagUpsertBulk

UpdateValue sets the "value" field to the value that was provided on create.

type TagUpsertOne

type TagUpsertOne struct {
	// contains filtered or unexported fields
}

TagUpsertOne is the builder for "upsert"-ing

one Tag node.

func (*TagUpsertOne) DoNothing

func (u *TagUpsertOne) DoNothing() *TagUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TagUpsertOne) Exec

func (u *TagUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpsertOne) ExecX

func (u *TagUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpsertOne) ID

func (u *TagUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TagUpsertOne) IDX

func (u *TagUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*TagUpsertOne) Ignore

func (u *TagUpsertOne) Ignore() *TagUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tag.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TagUpsertOne) SetValue

func (u *TagUpsertOne) SetValue(v string) *TagUpsertOne

SetValue sets the "value" field.

func (*TagUpsertOne) Update

func (u *TagUpsertOne) Update(set func(*TagUpsert)) *TagUpsertOne

Update allows overriding fields `UPDATE` values. See the TagCreate.OnConflict documentation for more info.

func (*TagUpsertOne) UpdateNewValues

func (u *TagUpsertOne) UpdateNewValues() *TagUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TagUpsertOne) UpdateValue

func (u *TagUpsertOne) UpdateValue() *TagUpsertOne

UpdateValue sets the "value" field to the value that was provided on create.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

type TraverseFunc added in v0.11.5

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser added in v0.11.5

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tweet

type Tweet 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 TweetQuery when eager-loading is set.
	Edges TweetEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tweet is the model entity for the Tweet schema.

func (*Tweet) QueryLikedUsers

func (t *Tweet) QueryLikedUsers() *UserQuery

QueryLikedUsers queries the "liked_users" edge of the Tweet entity.

func (*Tweet) QueryLikes

func (t *Tweet) QueryLikes() *TweetLikeQuery

QueryLikes queries the "likes" edge of the Tweet entity.

func (*Tweet) QueryTags

func (t *Tweet) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Tweet entity.

func (*Tweet) QueryTweetTags

func (t *Tweet) QueryTweetTags() *TweetTagQuery

QueryTweetTags queries the "tweet_tags" edge of the Tweet entity.

func (*Tweet) QueryTweetUser

func (t *Tweet) QueryTweetUser() *UserTweetQuery

QueryTweetUser queries the "tweet_user" edge of the Tweet entity.

func (*Tweet) QueryUser

func (t *Tweet) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Tweet entity.

func (*Tweet) String

func (t *Tweet) String() string

String implements the fmt.Stringer.

func (*Tweet) Unwrap

func (t *Tweet) Unwrap() *Tweet

Unwrap unwraps the Tweet 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 (*Tweet) Update

func (t *Tweet) Update() *TweetUpdateOne

Update returns a builder for updating this Tweet. Note that you need to call Tweet.Unwrap() before calling this method if this Tweet was returned from a transaction, and the transaction was committed or rolled back.

type TweetClient

type TweetClient struct {
	// contains filtered or unexported fields
}

TweetClient is a client for the Tweet schema.

func NewTweetClient

func NewTweetClient(c config) *TweetClient

NewTweetClient returns a client for the Tweet from the given config.

func (*TweetClient) Create

func (c *TweetClient) Create() *TweetCreate

Create returns a builder for creating a Tweet entity.

func (*TweetClient) CreateBulk

func (c *TweetClient) CreateBulk(builders ...*TweetCreate) *TweetCreateBulk

CreateBulk returns a builder for creating a bulk of Tweet entities.

func (*TweetClient) Delete

func (c *TweetClient) Delete() *TweetDelete

Delete returns a delete builder for Tweet.

func (*TweetClient) DeleteOne

func (c *TweetClient) DeleteOne(t *Tweet) *TweetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TweetClient) DeleteOneID

func (c *TweetClient) DeleteOneID(id int) *TweetDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TweetClient) Get

func (c *TweetClient) Get(ctx context.Context, id int) (*Tweet, error)

Get returns a Tweet entity by its id.

func (*TweetClient) GetX

func (c *TweetClient) GetX(ctx context.Context, id int) *Tweet

GetX is like Get, but panics if an error occurs.

func (*TweetClient) Hooks

func (c *TweetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TweetClient) Intercept added in v0.11.5

func (c *TweetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tweet.Intercept(f(g(h())))`.

func (*TweetClient) Interceptors added in v0.11.5

func (c *TweetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TweetClient) Query

func (c *TweetClient) Query() *TweetQuery

Query returns a query builder for Tweet.

func (*TweetClient) QueryLikedUsers

func (c *TweetClient) QueryLikedUsers(t *Tweet) *UserQuery

QueryLikedUsers queries the liked_users edge of a Tweet.

func (*TweetClient) QueryLikes

func (c *TweetClient) QueryLikes(t *Tweet) *TweetLikeQuery

QueryLikes queries the likes edge of a Tweet.

func (*TweetClient) QueryTags

func (c *TweetClient) QueryTags(t *Tweet) *TagQuery

QueryTags queries the tags edge of a Tweet.

func (*TweetClient) QueryTweetTags

func (c *TweetClient) QueryTweetTags(t *Tweet) *TweetTagQuery

QueryTweetTags queries the tweet_tags edge of a Tweet.

func (*TweetClient) QueryTweetUser

func (c *TweetClient) QueryTweetUser(t *Tweet) *UserTweetQuery

QueryTweetUser queries the tweet_user edge of a Tweet.

func (*TweetClient) QueryUser

func (c *TweetClient) QueryUser(t *Tweet) *UserQuery

QueryUser queries the user edge of a Tweet.

func (*TweetClient) Update

func (c *TweetClient) Update() *TweetUpdate

Update returns an update builder for Tweet.

func (*TweetClient) UpdateOne

func (c *TweetClient) UpdateOne(t *Tweet) *TweetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TweetClient) UpdateOneID

func (c *TweetClient) UpdateOneID(id int) *TweetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TweetClient) Use

func (c *TweetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tweet.Hooks(f(g(h())))`.

type TweetCreate

type TweetCreate struct {
	// contains filtered or unexported fields
}

TweetCreate is the builder for creating a Tweet entity.

func (*TweetCreate) AddLikedUserIDs

func (tc *TweetCreate) AddLikedUserIDs(ids ...int) *TweetCreate

AddLikedUserIDs adds the "liked_users" edge to the User entity by IDs.

func (*TweetCreate) AddLikedUsers

func (tc *TweetCreate) AddLikedUsers(u ...*User) *TweetCreate

AddLikedUsers adds the "liked_users" edges to the User entity.

func (*TweetCreate) AddTagIDs

func (tc *TweetCreate) AddTagIDs(ids ...int) *TweetCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*TweetCreate) AddTags

func (tc *TweetCreate) AddTags(t ...*Tag) *TweetCreate

AddTags adds the "tags" edges to the Tag entity.

func (*TweetCreate) AddTweetTagIDs

func (tc *TweetCreate) AddTweetTagIDs(ids ...uuid.UUID) *TweetCreate

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TweetCreate) AddTweetTags

func (tc *TweetCreate) AddTweetTags(t ...*TweetTag) *TweetCreate

AddTweetTags adds the "tweet_tags" edges to the TweetTag entity.

func (*TweetCreate) AddTweetUser

func (tc *TweetCreate) AddTweetUser(u ...*UserTweet) *TweetCreate

AddTweetUser adds the "tweet_user" edges to the UserTweet entity.

func (*TweetCreate) AddTweetUserIDs

func (tc *TweetCreate) AddTweetUserIDs(ids ...int) *TweetCreate

AddTweetUserIDs adds the "tweet_user" edge to the UserTweet entity by IDs.

func (*TweetCreate) AddUser

func (tc *TweetCreate) AddUser(u ...*User) *TweetCreate

AddUser adds the "user" edges to the User entity.

func (*TweetCreate) AddUserIDs

func (tc *TweetCreate) AddUserIDs(ids ...int) *TweetCreate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*TweetCreate) Exec

func (tc *TweetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetCreate) ExecX

func (tc *TweetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetCreate) Mutation

func (tc *TweetCreate) Mutation() *TweetMutation

Mutation returns the TweetMutation object of the builder.

func (*TweetCreate) OnConflict

func (tc *TweetCreate) OnConflict(opts ...sql.ConflictOption) *TweetUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tweet.Create().
	SetText(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TweetUpsert) {
		SetText(v+v).
	}).
	Exec(ctx)

func (*TweetCreate) OnConflictColumns

func (tc *TweetCreate) OnConflictColumns(columns ...string) *TweetUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tweet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TweetCreate) Save

func (tc *TweetCreate) Save(ctx context.Context) (*Tweet, error)

Save creates the Tweet in the database.

func (*TweetCreate) SaveX

func (tc *TweetCreate) SaveX(ctx context.Context) *Tweet

SaveX calls Save and panics if Save returns an error.

func (*TweetCreate) SetText

func (tc *TweetCreate) SetText(s string) *TweetCreate

SetText sets the "text" field.

type TweetCreateBulk

type TweetCreateBulk struct {
	// contains filtered or unexported fields
}

TweetCreateBulk is the builder for creating many Tweet entities in bulk.

func (*TweetCreateBulk) Exec

func (tcb *TweetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetCreateBulk) ExecX

func (tcb *TweetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetCreateBulk) OnConflict

func (tcb *TweetCreateBulk) OnConflict(opts ...sql.ConflictOption) *TweetUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tweet.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TweetUpsert) {
		SetText(v+v).
	}).
	Exec(ctx)

func (*TweetCreateBulk) OnConflictColumns

func (tcb *TweetCreateBulk) OnConflictColumns(columns ...string) *TweetUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tweet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TweetCreateBulk) Save

func (tcb *TweetCreateBulk) Save(ctx context.Context) ([]*Tweet, error)

Save creates the Tweet entities in the database.

func (*TweetCreateBulk) SaveX

func (tcb *TweetCreateBulk) SaveX(ctx context.Context) []*Tweet

SaveX is like Save, but panics if an error occurs.

type TweetDelete

type TweetDelete struct {
	// contains filtered or unexported fields
}

TweetDelete is the builder for deleting a Tweet entity.

func (*TweetDelete) Exec

func (td *TweetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TweetDelete) ExecX

func (td *TweetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TweetDelete) Where

func (td *TweetDelete) Where(ps ...predicate.Tweet) *TweetDelete

Where appends a list predicates to the TweetDelete builder.

type TweetDeleteOne

type TweetDeleteOne struct {
	// contains filtered or unexported fields
}

TweetDeleteOne is the builder for deleting a single Tweet entity.

func (*TweetDeleteOne) Exec

func (tdo *TweetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TweetDeleteOne) ExecX

func (tdo *TweetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetDeleteOne) Where added in v0.11.7

func (tdo *TweetDeleteOne) Where(ps ...predicate.Tweet) *TweetDeleteOne

Where appends a list predicates to the TweetDelete builder.

type TweetEdges

type TweetEdges struct {
	// LikedUsers holds the value of the liked_users edge.
	LikedUsers []*User `json:"liked_users,omitempty"`
	// The uniqueness is enforced on the edge schema
	User []*User `json:"user,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// Likes holds the value of the likes edge.
	Likes []*TweetLike `json:"likes,omitempty"`
	// TweetUser holds the value of the tweet_user edge.
	TweetUser []*UserTweet `json:"tweet_user,omitempty"`
	// TweetTags holds the value of the tweet_tags edge.
	TweetTags []*TweetTag `json:"tweet_tags,omitempty"`
	// contains filtered or unexported fields
}

TweetEdges holds the relations/edges for other nodes in the graph.

func (TweetEdges) LikedUsersOrErr

func (e TweetEdges) LikedUsersOrErr() ([]*User, error)

LikedUsersOrErr returns the LikedUsers value or an error if the edge was not loaded in eager-loading.

func (TweetEdges) LikesOrErr

func (e TweetEdges) LikesOrErr() ([]*TweetLike, error)

LikesOrErr returns the Likes value or an error if the edge was not loaded in eager-loading.

func (TweetEdges) TagsOrErr

func (e TweetEdges) TagsOrErr() ([]*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

func (TweetEdges) TweetTagsOrErr

func (e TweetEdges) TweetTagsOrErr() ([]*TweetTag, error)

TweetTagsOrErr returns the TweetTags value or an error if the edge was not loaded in eager-loading.

func (TweetEdges) TweetUserOrErr

func (e TweetEdges) TweetUserOrErr() ([]*UserTweet, error)

TweetUserOrErr returns the TweetUser value or an error if the edge was not loaded in eager-loading.

func (TweetEdges) UserOrErr

func (e TweetEdges) UserOrErr() ([]*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.

type TweetFilter added in v0.11.2

type TweetFilter struct {
	// contains filtered or unexported fields
}

TweetFilter provides a generic filtering capability at runtime for TweetQuery.

func (*TweetFilter) Where added in v0.11.2

func (f *TweetFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*TweetFilter) WhereHasLikedUsers added in v0.11.2

func (f *TweetFilter) WhereHasLikedUsers()

WhereHasLikedUsers applies a predicate to check if query has an edge liked_users.

func (*TweetFilter) WhereHasLikedUsersWith added in v0.11.2

func (f *TweetFilter) WhereHasLikedUsersWith(preds ...predicate.User)

WhereHasLikedUsersWith applies a predicate to check if query has an edge liked_users with a given conditions (other predicates).

func (*TweetFilter) WhereHasLikes added in v0.11.2

func (f *TweetFilter) WhereHasLikes()

WhereHasLikes applies a predicate to check if query has an edge likes.

func (*TweetFilter) WhereHasLikesWith added in v0.11.2

func (f *TweetFilter) WhereHasLikesWith(preds ...predicate.TweetLike)

WhereHasLikesWith applies a predicate to check if query has an edge likes with a given conditions (other predicates).

func (*TweetFilter) WhereHasTags added in v0.11.2

func (f *TweetFilter) WhereHasTags()

WhereHasTags applies a predicate to check if query has an edge tags.

func (*TweetFilter) WhereHasTagsWith added in v0.11.2

func (f *TweetFilter) WhereHasTagsWith(preds ...predicate.Tag)

WhereHasTagsWith applies a predicate to check if query has an edge tags with a given conditions (other predicates).

func (*TweetFilter) WhereHasTweetTags added in v0.11.2

func (f *TweetFilter) WhereHasTweetTags()

WhereHasTweetTags applies a predicate to check if query has an edge tweet_tags.

func (*TweetFilter) WhereHasTweetTagsWith added in v0.11.2

func (f *TweetFilter) WhereHasTweetTagsWith(preds ...predicate.TweetTag)

WhereHasTweetTagsWith applies a predicate to check if query has an edge tweet_tags with a given conditions (other predicates).

func (*TweetFilter) WhereHasTweetUser added in v0.11.2

func (f *TweetFilter) WhereHasTweetUser()

WhereHasTweetUser applies a predicate to check if query has an edge tweet_user.

func (*TweetFilter) WhereHasTweetUserWith added in v0.11.2

func (f *TweetFilter) WhereHasTweetUserWith(preds ...predicate.UserTweet)

WhereHasTweetUserWith applies a predicate to check if query has an edge tweet_user with a given conditions (other predicates).

func (*TweetFilter) WhereHasUser added in v0.11.2

func (f *TweetFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*TweetFilter) WhereHasUserWith added in v0.11.2

func (f *TweetFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*TweetFilter) WhereID added in v0.11.2

func (f *TweetFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*TweetFilter) WhereText added in v0.11.2

func (f *TweetFilter) WhereText(p entql.StringP)

WhereText applies the entql string predicate on the text field.

type TweetGroupBy

type TweetGroupBy struct {
	// contains filtered or unexported fields
}

TweetGroupBy is the group-by builder for Tweet entities.

func (*TweetGroupBy) Aggregate

func (tgb *TweetGroupBy) Aggregate(fns ...AggregateFunc) *TweetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TweetGroupBy) Bool

func (s *TweetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) BoolX

func (s *TweetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TweetGroupBy) Bools

func (s *TweetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) BoolsX

func (s *TweetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TweetGroupBy) Float64

func (s *TweetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) Float64X

func (s *TweetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TweetGroupBy) Float64s

func (s *TweetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) Float64sX

func (s *TweetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TweetGroupBy) Int

func (s *TweetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) IntX

func (s *TweetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TweetGroupBy) Ints

func (s *TweetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) IntsX

func (s *TweetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TweetGroupBy) Scan

func (tgb *TweetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TweetGroupBy) ScanX

func (s *TweetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TweetGroupBy) String

func (s *TweetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) StringX

func (s *TweetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TweetGroupBy) Strings

func (s *TweetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TweetGroupBy) StringsX

func (s *TweetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TweetLike

type TweetLike struct {

	// LikedAt holds the value of the "liked_at" field.
	LikedAt time.Time `json:"liked_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// TweetID holds the value of the "tweet_id" field.
	TweetID int `json:"tweet_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TweetLikeQuery when eager-loading is set.
	Edges TweetLikeEdges `json:"edges"`
	// contains filtered or unexported fields
}

TweetLike is the model entity for the TweetLike schema.

func (*TweetLike) QueryTweet

func (tl *TweetLike) QueryTweet() *TweetQuery

QueryTweet queries the "tweet" edge of the TweetLike entity.

func (*TweetLike) QueryUser

func (tl *TweetLike) QueryUser() *UserQuery

QueryUser queries the "user" edge of the TweetLike entity.

func (*TweetLike) String

func (tl *TweetLike) String() string

String implements the fmt.Stringer.

func (*TweetLike) Unwrap

func (tl *TweetLike) Unwrap() *TweetLike

Unwrap unwraps the TweetLike 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 (*TweetLike) Update

func (tl *TweetLike) Update() *TweetLikeUpdateOne

Update returns a builder for updating this TweetLike. Note that you need to call TweetLike.Unwrap() before calling this method if this TweetLike was returned from a transaction, and the transaction was committed or rolled back.

type TweetLikeClient

type TweetLikeClient struct {
	// contains filtered or unexported fields
}

TweetLikeClient is a client for the TweetLike schema.

func NewTweetLikeClient

func NewTweetLikeClient(c config) *TweetLikeClient

NewTweetLikeClient returns a client for the TweetLike from the given config.

func (*TweetLikeClient) Create

func (c *TweetLikeClient) Create() *TweetLikeCreate

Create returns a builder for creating a TweetLike entity.

func (*TweetLikeClient) CreateBulk

func (c *TweetLikeClient) CreateBulk(builders ...*TweetLikeCreate) *TweetLikeCreateBulk

CreateBulk returns a builder for creating a bulk of TweetLike entities.

func (*TweetLikeClient) Delete

func (c *TweetLikeClient) Delete() *TweetLikeDelete

Delete returns a delete builder for TweetLike.

func (*TweetLikeClient) Hooks

func (c *TweetLikeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TweetLikeClient) Intercept added in v0.11.5

func (c *TweetLikeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tweetlike.Intercept(f(g(h())))`.

func (*TweetLikeClient) Interceptors added in v0.11.5

func (c *TweetLikeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TweetLikeClient) Query

func (c *TweetLikeClient) Query() *TweetLikeQuery

Query returns a query builder for TweetLike.

func (*TweetLikeClient) QueryTweet

func (c *TweetLikeClient) QueryTweet(tl *TweetLike) *TweetQuery

QueryTweet queries the tweet edge of a TweetLike.

func (*TweetLikeClient) QueryUser

func (c *TweetLikeClient) QueryUser(tl *TweetLike) *UserQuery

QueryUser queries the user edge of a TweetLike.

func (*TweetLikeClient) Update

func (c *TweetLikeClient) Update() *TweetLikeUpdate

Update returns an update builder for TweetLike.

func (*TweetLikeClient) UpdateOne

func (c *TweetLikeClient) UpdateOne(tl *TweetLike) *TweetLikeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TweetLikeClient) Use

func (c *TweetLikeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tweetlike.Hooks(f(g(h())))`.

type TweetLikeCreate

type TweetLikeCreate struct {
	// contains filtered or unexported fields
}

TweetLikeCreate is the builder for creating a TweetLike entity.

func (*TweetLikeCreate) Exec

func (tlc *TweetLikeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetLikeCreate) ExecX

func (tlc *TweetLikeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeCreate) Mutation

func (tlc *TweetLikeCreate) Mutation() *TweetLikeMutation

Mutation returns the TweetLikeMutation object of the builder.

func (*TweetLikeCreate) OnConflict

func (tlc *TweetLikeCreate) OnConflict(opts ...sql.ConflictOption) *TweetLikeUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.TweetLike.Create().
	SetLikedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TweetLikeUpsert) {
		SetLikedAt(v+v).
	}).
	Exec(ctx)

func (*TweetLikeCreate) OnConflictColumns

func (tlc *TweetLikeCreate) OnConflictColumns(columns ...string) *TweetLikeUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.TweetLike.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TweetLikeCreate) Save

func (tlc *TweetLikeCreate) Save(ctx context.Context) (*TweetLike, error)

Save creates the TweetLike in the database.

func (*TweetLikeCreate) SaveX

func (tlc *TweetLikeCreate) SaveX(ctx context.Context) *TweetLike

SaveX calls Save and panics if Save returns an error.

func (*TweetLikeCreate) SetLikedAt

func (tlc *TweetLikeCreate) SetLikedAt(t time.Time) *TweetLikeCreate

SetLikedAt sets the "liked_at" field.

func (*TweetLikeCreate) SetNillableLikedAt

func (tlc *TweetLikeCreate) SetNillableLikedAt(t *time.Time) *TweetLikeCreate

SetNillableLikedAt sets the "liked_at" field if the given value is not nil.

func (*TweetLikeCreate) SetTweet

func (tlc *TweetLikeCreate) SetTweet(t *Tweet) *TweetLikeCreate

SetTweet sets the "tweet" edge to the Tweet entity.

func (*TweetLikeCreate) SetTweetID

func (tlc *TweetLikeCreate) SetTweetID(i int) *TweetLikeCreate

SetTweetID sets the "tweet_id" field.

func (*TweetLikeCreate) SetUser

func (tlc *TweetLikeCreate) SetUser(u *User) *TweetLikeCreate

SetUser sets the "user" edge to the User entity.

func (*TweetLikeCreate) SetUserID

func (tlc *TweetLikeCreate) SetUserID(i int) *TweetLikeCreate

SetUserID sets the "user_id" field.

type TweetLikeCreateBulk

type TweetLikeCreateBulk struct {
	// contains filtered or unexported fields
}

TweetLikeCreateBulk is the builder for creating many TweetLike entities in bulk.

func (*TweetLikeCreateBulk) Exec

func (tlcb *TweetLikeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetLikeCreateBulk) ExecX

func (tlcb *TweetLikeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeCreateBulk) OnConflict

func (tlcb *TweetLikeCreateBulk) OnConflict(opts ...sql.ConflictOption) *TweetLikeUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.TweetLike.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TweetLikeUpsert) {
		SetLikedAt(v+v).
	}).
	Exec(ctx)

func (*TweetLikeCreateBulk) OnConflictColumns

func (tlcb *TweetLikeCreateBulk) OnConflictColumns(columns ...string) *TweetLikeUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.TweetLike.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TweetLikeCreateBulk) Save

func (tlcb *TweetLikeCreateBulk) Save(ctx context.Context) ([]*TweetLike, error)

Save creates the TweetLike entities in the database.

func (*TweetLikeCreateBulk) SaveX

func (tlcb *TweetLikeCreateBulk) SaveX(ctx context.Context) []*TweetLike

SaveX is like Save, but panics if an error occurs.

type TweetLikeDelete

type TweetLikeDelete struct {
	// contains filtered or unexported fields
}

TweetLikeDelete is the builder for deleting a TweetLike entity.

func (*TweetLikeDelete) Exec

func (tld *TweetLikeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TweetLikeDelete) ExecX

func (tld *TweetLikeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeDelete) Where

Where appends a list predicates to the TweetLikeDelete builder.

type TweetLikeDeleteOne

type TweetLikeDeleteOne struct {
	// contains filtered or unexported fields
}

TweetLikeDeleteOne is the builder for deleting a single TweetLike entity.

func (*TweetLikeDeleteOne) Exec

func (tldo *TweetLikeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TweetLikeDeleteOne) ExecX

func (tldo *TweetLikeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeDeleteOne) Where added in v0.11.7

Where appends a list predicates to the TweetLikeDelete builder.

type TweetLikeEdges

type TweetLikeEdges struct {
	// Tweet holds the value of the tweet edge.
	Tweet *Tweet `json:"tweet,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

TweetLikeEdges holds the relations/edges for other nodes in the graph.

func (TweetLikeEdges) TweetOrErr

func (e TweetLikeEdges) TweetOrErr() (*Tweet, error)

TweetOrErr returns the Tweet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TweetLikeEdges) UserOrErr

func (e TweetLikeEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TweetLikeFilter added in v0.11.2

type TweetLikeFilter struct {
	// contains filtered or unexported fields
}

TweetLikeFilter provides a generic filtering capability at runtime for TweetLikeQuery.

func (*TweetLikeFilter) Where added in v0.11.2

func (f *TweetLikeFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*TweetLikeFilter) WhereHasTweet added in v0.11.2

func (f *TweetLikeFilter) WhereHasTweet()

WhereHasTweet applies a predicate to check if query has an edge tweet.

func (*TweetLikeFilter) WhereHasTweetWith added in v0.11.2

func (f *TweetLikeFilter) WhereHasTweetWith(preds ...predicate.Tweet)

WhereHasTweetWith applies a predicate to check if query has an edge tweet with a given conditions (other predicates).

func (*TweetLikeFilter) WhereHasUser added in v0.11.2

func (f *TweetLikeFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*TweetLikeFilter) WhereHasUserWith added in v0.11.2

func (f *TweetLikeFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*TweetLikeFilter) WhereLikedAt added in v0.11.2

func (f *TweetLikeFilter) WhereLikedAt(p entql.TimeP)

WhereLikedAt applies the entql time.Time predicate on the liked_at field.

func (*TweetLikeFilter) WhereTweetID added in v0.11.2

func (f *TweetLikeFilter) WhereTweetID(p entql.IntP)

WhereTweetID applies the entql int predicate on the tweet_id field.

func (*TweetLikeFilter) WhereUserID added in v0.11.2

func (f *TweetLikeFilter) WhereUserID(p entql.IntP)

WhereUserID applies the entql int predicate on the user_id field.

type TweetLikeGroupBy

type TweetLikeGroupBy struct {
	// contains filtered or unexported fields
}

TweetLikeGroupBy is the group-by builder for TweetLike entities.

func (*TweetLikeGroupBy) Aggregate

func (tlgb *TweetLikeGroupBy) Aggregate(fns ...AggregateFunc) *TweetLikeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TweetLikeGroupBy) Bool

func (s *TweetLikeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) BoolX

func (s *TweetLikeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TweetLikeGroupBy) Bools

func (s *TweetLikeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) BoolsX

func (s *TweetLikeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TweetLikeGroupBy) Float64

func (s *TweetLikeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) Float64X

func (s *TweetLikeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TweetLikeGroupBy) Float64s

func (s *TweetLikeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) Float64sX

func (s *TweetLikeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TweetLikeGroupBy) Int

func (s *TweetLikeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) IntX

func (s *TweetLikeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TweetLikeGroupBy) Ints

func (s *TweetLikeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) IntsX

func (s *TweetLikeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TweetLikeGroupBy) Scan

func (tlgb *TweetLikeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TweetLikeGroupBy) ScanX

func (s *TweetLikeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TweetLikeGroupBy) String

func (s *TweetLikeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) StringX

func (s *TweetLikeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TweetLikeGroupBy) Strings

func (s *TweetLikeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TweetLikeGroupBy) StringsX

func (s *TweetLikeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TweetLikeMutation

type TweetLikeMutation struct {
	// contains filtered or unexported fields
}

TweetLikeMutation represents an operation that mutates the TweetLike nodes in the graph.

func (*TweetLikeMutation) AddField

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) AddedEdges

func (m *TweetLikeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TweetLikeMutation) AddedField

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) AddedFields

func (m *TweetLikeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TweetLikeMutation) AddedIDs

func (m *TweetLikeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TweetLikeMutation) ClearEdge

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) ClearField

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) ClearTweet

func (m *TweetLikeMutation) ClearTweet()

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*TweetLikeMutation) ClearUser

func (m *TweetLikeMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*TweetLikeMutation) ClearedEdges

func (m *TweetLikeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TweetLikeMutation) ClearedFields

func (m *TweetLikeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TweetLikeMutation) Client

func (m TweetLikeMutation) 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 (*TweetLikeMutation) EdgeCleared

func (m *TweetLikeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TweetLikeMutation) Field

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) FieldCleared

func (m *TweetLikeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TweetLikeMutation) Fields

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) Filter added in v0.11.2

func (m *TweetLikeMutation) Filter() *TweetLikeFilter

Filter returns an entql.Where implementation to apply filters on the TweetLikeMutation builder.

func (*TweetLikeMutation) LikedAt

func (m *TweetLikeMutation) LikedAt() (r time.Time, exists bool)

LikedAt returns the value of the "liked_at" field in the mutation.

func (*TweetLikeMutation) OldField

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) Op

func (m *TweetLikeMutation) Op() Op

Op returns the operation name.

func (*TweetLikeMutation) RemovedEdges

func (m *TweetLikeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TweetLikeMutation) RemovedIDs

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) ResetEdge

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) ResetField

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) ResetLikedAt

func (m *TweetLikeMutation) ResetLikedAt()

ResetLikedAt resets all changes to the "liked_at" field.

func (*TweetLikeMutation) ResetTweet

func (m *TweetLikeMutation) ResetTweet()

ResetTweet resets all changes to the "tweet" edge.

func (*TweetLikeMutation) ResetTweetID

func (m *TweetLikeMutation) ResetTweetID()

ResetTweetID resets all changes to the "tweet_id" field.

func (*TweetLikeMutation) ResetUser

func (m *TweetLikeMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*TweetLikeMutation) ResetUserID

func (m *TweetLikeMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*TweetLikeMutation) SetField

func (m *TweetLikeMutation) 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 (*TweetLikeMutation) SetLikedAt

func (m *TweetLikeMutation) SetLikedAt(t time.Time)

SetLikedAt sets the "liked_at" field.

func (*TweetLikeMutation) SetOp added in v0.11.5

func (m *TweetLikeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TweetLikeMutation) SetTweetID

func (m *TweetLikeMutation) SetTweetID(i int)

SetTweetID sets the "tweet_id" field.

func (*TweetLikeMutation) SetUserID

func (m *TweetLikeMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*TweetLikeMutation) TweetCleared

func (m *TweetLikeMutation) TweetCleared() bool

TweetCleared reports if the "tweet" edge to the Tweet entity was cleared.

func (*TweetLikeMutation) TweetID

func (m *TweetLikeMutation) TweetID() (r int, exists bool)

TweetID returns the value of the "tweet_id" field in the mutation.

func (*TweetLikeMutation) TweetIDs

func (m *TweetLikeMutation) TweetIDs() (ids []int)

TweetIDs returns the "tweet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TweetID instead. It exists only for internal usage by the builders.

func (TweetLikeMutation) Tx

func (m TweetLikeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TweetLikeMutation) Type

func (m *TweetLikeMutation) Type() string

Type returns the node type of this mutation (TweetLike).

func (*TweetLikeMutation) UserCleared

func (m *TweetLikeMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*TweetLikeMutation) UserID

func (m *TweetLikeMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*TweetLikeMutation) UserIDs

func (m *TweetLikeMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*TweetLikeMutation) Where

func (m *TweetLikeMutation) Where(ps ...predicate.TweetLike)

Where appends a list predicates to the TweetLikeMutation builder.

func (*TweetLikeMutation) WhereP added in v0.11.5

func (m *TweetLikeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TweetLikeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TweetLikeQuery

type TweetLikeQuery struct {
	// contains filtered or unexported fields
}

TweetLikeQuery is the builder for querying TweetLike entities.

func (*TweetLikeQuery) Aggregate added in v0.11.4

func (tlq *TweetLikeQuery) Aggregate(fns ...AggregateFunc) *TweetLikeSelect

Aggregate returns a TweetLikeSelect configured with the given aggregations.

func (*TweetLikeQuery) All

func (tlq *TweetLikeQuery) All(ctx context.Context) ([]*TweetLike, error)

All executes the query and returns a list of TweetLikes.

func (*TweetLikeQuery) AllX

func (tlq *TweetLikeQuery) AllX(ctx context.Context) []*TweetLike

AllX is like All, but panics if an error occurs.

func (*TweetLikeQuery) Clone

func (tlq *TweetLikeQuery) Clone() *TweetLikeQuery

Clone returns a duplicate of the TweetLikeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TweetLikeQuery) Count

func (tlq *TweetLikeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TweetLikeQuery) CountX

func (tlq *TweetLikeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TweetLikeQuery) Exist

func (tlq *TweetLikeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TweetLikeQuery) ExistX

func (tlq *TweetLikeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TweetLikeQuery) Filter added in v0.11.2

func (tlq *TweetLikeQuery) Filter() *TweetLikeFilter

Filter returns a Filter implementation to apply filters on the TweetLikeQuery builder.

func (*TweetLikeQuery) First

func (tlq *TweetLikeQuery) First(ctx context.Context) (*TweetLike, error)

First returns the first TweetLike entity from the query. Returns a *NotFoundError when no TweetLike was found.

func (*TweetLikeQuery) FirstX

func (tlq *TweetLikeQuery) FirstX(ctx context.Context) *TweetLike

FirstX is like First, but panics if an error occurs.

func (*TweetLikeQuery) GroupBy

func (tlq *TweetLikeQuery) GroupBy(field string, fields ...string) *TweetLikeGroupBy

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 {
	LikedAt time.Time `json:"liked_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TweetLike.Query().
	GroupBy(tweetlike.FieldLikedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TweetLikeQuery) Limit

func (tlq *TweetLikeQuery) Limit(limit int) *TweetLikeQuery

Limit the number of records to be returned by this query.

func (*TweetLikeQuery) Offset

func (tlq *TweetLikeQuery) Offset(offset int) *TweetLikeQuery

Offset to start from.

func (*TweetLikeQuery) Only

func (tlq *TweetLikeQuery) Only(ctx context.Context) (*TweetLike, error)

Only returns a single TweetLike entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TweetLike entity is found. Returns a *NotFoundError when no TweetLike entities are found.

func (*TweetLikeQuery) OnlyX

func (tlq *TweetLikeQuery) OnlyX(ctx context.Context) *TweetLike

OnlyX is like Only, but panics if an error occurs.

func (*TweetLikeQuery) Order

func (tlq *TweetLikeQuery) Order(o ...OrderFunc) *TweetLikeQuery

Order specifies how the records should be ordered.

func (*TweetLikeQuery) QueryTweet

func (tlq *TweetLikeQuery) QueryTweet() *TweetQuery

QueryTweet chains the current query on the "tweet" edge.

func (*TweetLikeQuery) QueryUser

func (tlq *TweetLikeQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*TweetLikeQuery) Select

func (tlq *TweetLikeQuery) Select(fields ...string) *TweetLikeSelect

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 {
	LikedAt time.Time `json:"liked_at,omitempty"`
}

client.TweetLike.Query().
	Select(tweetlike.FieldLikedAt).
	Scan(ctx, &v)

func (*TweetLikeQuery) Unique

func (tlq *TweetLikeQuery) Unique(unique bool) *TweetLikeQuery

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 (*TweetLikeQuery) Where

func (tlq *TweetLikeQuery) Where(ps ...predicate.TweetLike) *TweetLikeQuery

Where adds a new predicate for the TweetLikeQuery builder.

func (*TweetLikeQuery) WithTweet

func (tlq *TweetLikeQuery) WithTweet(opts ...func(*TweetQuery)) *TweetLikeQuery

WithTweet tells the query-builder to eager-load the nodes that are connected to the "tweet" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetLikeQuery) WithUser

func (tlq *TweetLikeQuery) WithUser(opts ...func(*UserQuery)) *TweetLikeQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type TweetLikeSelect

type TweetLikeSelect struct {
	*TweetLikeQuery
	// contains filtered or unexported fields
}

TweetLikeSelect is the builder for selecting fields of TweetLike entities.

func (*TweetLikeSelect) Aggregate added in v0.11.4

func (tls *TweetLikeSelect) Aggregate(fns ...AggregateFunc) *TweetLikeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TweetLikeSelect) Bool

func (s *TweetLikeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) BoolX

func (s *TweetLikeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TweetLikeSelect) Bools

func (s *TweetLikeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) BoolsX

func (s *TweetLikeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TweetLikeSelect) Float64

func (s *TweetLikeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) Float64X

func (s *TweetLikeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TweetLikeSelect) Float64s

func (s *TweetLikeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) Float64sX

func (s *TweetLikeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TweetLikeSelect) Int

func (s *TweetLikeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) IntX

func (s *TweetLikeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TweetLikeSelect) Ints

func (s *TweetLikeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) IntsX

func (s *TweetLikeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TweetLikeSelect) Scan

func (tls *TweetLikeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TweetLikeSelect) ScanX

func (s *TweetLikeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TweetLikeSelect) String

func (s *TweetLikeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) StringX

func (s *TweetLikeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TweetLikeSelect) Strings

func (s *TweetLikeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TweetLikeSelect) StringsX

func (s *TweetLikeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TweetLikeUpdate

type TweetLikeUpdate struct {
	// contains filtered or unexported fields
}

TweetLikeUpdate is the builder for updating TweetLike entities.

func (*TweetLikeUpdate) ClearTweet

func (tlu *TweetLikeUpdate) ClearTweet() *TweetLikeUpdate

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*TweetLikeUpdate) ClearUser

func (tlu *TweetLikeUpdate) ClearUser() *TweetLikeUpdate

ClearUser clears the "user" edge to the User entity.

func (*TweetLikeUpdate) Exec

func (tlu *TweetLikeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetLikeUpdate) ExecX

func (tlu *TweetLikeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeUpdate) Mutation

func (tlu *TweetLikeUpdate) Mutation() *TweetLikeMutation

Mutation returns the TweetLikeMutation object of the builder.

func (*TweetLikeUpdate) Save

func (tlu *TweetLikeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TweetLikeUpdate) SaveX

func (tlu *TweetLikeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TweetLikeUpdate) SetLikedAt

func (tlu *TweetLikeUpdate) SetLikedAt(t time.Time) *TweetLikeUpdate

SetLikedAt sets the "liked_at" field.

func (*TweetLikeUpdate) SetNillableLikedAt

func (tlu *TweetLikeUpdate) SetNillableLikedAt(t *time.Time) *TweetLikeUpdate

SetNillableLikedAt sets the "liked_at" field if the given value is not nil.

func (*TweetLikeUpdate) SetTweet

func (tlu *TweetLikeUpdate) SetTweet(t *Tweet) *TweetLikeUpdate

SetTweet sets the "tweet" edge to the Tweet entity.

func (*TweetLikeUpdate) SetTweetID

func (tlu *TweetLikeUpdate) SetTweetID(i int) *TweetLikeUpdate

SetTweetID sets the "tweet_id" field.

func (*TweetLikeUpdate) SetUser

func (tlu *TweetLikeUpdate) SetUser(u *User) *TweetLikeUpdate

SetUser sets the "user" edge to the User entity.

func (*TweetLikeUpdate) SetUserID

func (tlu *TweetLikeUpdate) SetUserID(i int) *TweetLikeUpdate

SetUserID sets the "user_id" field.

func (*TweetLikeUpdate) Where

Where appends a list predicates to the TweetLikeUpdate builder.

type TweetLikeUpdateOne

type TweetLikeUpdateOne struct {
	// contains filtered or unexported fields
}

TweetLikeUpdateOne is the builder for updating a single TweetLike entity.

func (*TweetLikeUpdateOne) ClearTweet

func (tluo *TweetLikeUpdateOne) ClearTweet() *TweetLikeUpdateOne

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*TweetLikeUpdateOne) ClearUser

func (tluo *TweetLikeUpdateOne) ClearUser() *TweetLikeUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*TweetLikeUpdateOne) Exec

func (tluo *TweetLikeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TweetLikeUpdateOne) ExecX

func (tluo *TweetLikeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeUpdateOne) Mutation

func (tluo *TweetLikeUpdateOne) Mutation() *TweetLikeMutation

Mutation returns the TweetLikeMutation object of the builder.

func (*TweetLikeUpdateOne) Save

func (tluo *TweetLikeUpdateOne) Save(ctx context.Context) (*TweetLike, error)

Save executes the query and returns the updated TweetLike entity.

func (*TweetLikeUpdateOne) SaveX

func (tluo *TweetLikeUpdateOne) SaveX(ctx context.Context) *TweetLike

SaveX is like Save, but panics if an error occurs.

func (*TweetLikeUpdateOne) Select

func (tluo *TweetLikeUpdateOne) Select(field string, fields ...string) *TweetLikeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TweetLikeUpdateOne) SetLikedAt

func (tluo *TweetLikeUpdateOne) SetLikedAt(t time.Time) *TweetLikeUpdateOne

SetLikedAt sets the "liked_at" field.

func (*TweetLikeUpdateOne) SetNillableLikedAt

func (tluo *TweetLikeUpdateOne) SetNillableLikedAt(t *time.Time) *TweetLikeUpdateOne

SetNillableLikedAt sets the "liked_at" field if the given value is not nil.

func (*TweetLikeUpdateOne) SetTweet

func (tluo *TweetLikeUpdateOne) SetTweet(t *Tweet) *TweetLikeUpdateOne

SetTweet sets the "tweet" edge to the Tweet entity.

func (*TweetLikeUpdateOne) SetTweetID

func (tluo *TweetLikeUpdateOne) SetTweetID(i int) *TweetLikeUpdateOne

SetTweetID sets the "tweet_id" field.

func (*TweetLikeUpdateOne) SetUser

func (tluo *TweetLikeUpdateOne) SetUser(u *User) *TweetLikeUpdateOne

SetUser sets the "user" edge to the User entity.

func (*TweetLikeUpdateOne) SetUserID

func (tluo *TweetLikeUpdateOne) SetUserID(i int) *TweetLikeUpdateOne

SetUserID sets the "user_id" field.

func (*TweetLikeUpdateOne) Where added in v0.11.8

Where appends a list predicates to the TweetLikeUpdate builder.

type TweetLikeUpsert

type TweetLikeUpsert struct {
	*sql.UpdateSet
}

TweetLikeUpsert is the "OnConflict" setter.

func (*TweetLikeUpsert) SetLikedAt

func (u *TweetLikeUpsert) SetLikedAt(v time.Time) *TweetLikeUpsert

SetLikedAt sets the "liked_at" field.

func (*TweetLikeUpsert) SetTweetID

func (u *TweetLikeUpsert) SetTweetID(v int) *TweetLikeUpsert

SetTweetID sets the "tweet_id" field.

func (*TweetLikeUpsert) SetUserID

func (u *TweetLikeUpsert) SetUserID(v int) *TweetLikeUpsert

SetUserID sets the "user_id" field.

func (*TweetLikeUpsert) UpdateLikedAt

func (u *TweetLikeUpsert) UpdateLikedAt() *TweetLikeUpsert

UpdateLikedAt sets the "liked_at" field to the value that was provided on create.

func (*TweetLikeUpsert) UpdateTweetID

func (u *TweetLikeUpsert) UpdateTweetID() *TweetLikeUpsert

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

func (*TweetLikeUpsert) UpdateUserID

func (u *TweetLikeUpsert) UpdateUserID() *TweetLikeUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type TweetLikeUpsertBulk

type TweetLikeUpsertBulk struct {
	// contains filtered or unexported fields
}

TweetLikeUpsertBulk is the builder for "upsert"-ing a bulk of TweetLike nodes.

func (*TweetLikeUpsertBulk) DoNothing

func (u *TweetLikeUpsertBulk) DoNothing() *TweetLikeUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TweetLikeUpsertBulk) Exec

Exec executes the query.

func (*TweetLikeUpsertBulk) ExecX

func (u *TweetLikeUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.TweetLike.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TweetLikeUpsertBulk) SetLikedAt

SetLikedAt sets the "liked_at" field.

func (*TweetLikeUpsertBulk) SetTweetID

func (u *TweetLikeUpsertBulk) SetTweetID(v int) *TweetLikeUpsertBulk

SetTweetID sets the "tweet_id" field.

func (*TweetLikeUpsertBulk) SetUserID

func (u *TweetLikeUpsertBulk) SetUserID(v int) *TweetLikeUpsertBulk

SetUserID sets the "user_id" field.

func (*TweetLikeUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the TweetLikeCreateBulk.OnConflict documentation for more info.

func (*TweetLikeUpsertBulk) UpdateLikedAt

func (u *TweetLikeUpsertBulk) UpdateLikedAt() *TweetLikeUpsertBulk

UpdateLikedAt sets the "liked_at" field to the value that was provided on create.

func (*TweetLikeUpsertBulk) UpdateNewValues

func (u *TweetLikeUpsertBulk) UpdateNewValues() *TweetLikeUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.TweetLike.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TweetLikeUpsertBulk) UpdateTweetID

func (u *TweetLikeUpsertBulk) UpdateTweetID() *TweetLikeUpsertBulk

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

func (*TweetLikeUpsertBulk) UpdateUserID

func (u *TweetLikeUpsertBulk) UpdateUserID() *TweetLikeUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type TweetLikeUpsertOne

type TweetLikeUpsertOne struct {
	// contains filtered or unexported fields
}

TweetLikeUpsertOne is the builder for "upsert"-ing

one TweetLike node.

func (*TweetLikeUpsertOne) DoNothing

func (u *TweetLikeUpsertOne) DoNothing() *TweetLikeUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TweetLikeUpsertOne) Exec

func (u *TweetLikeUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetLikeUpsertOne) ExecX

func (u *TweetLikeUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetLikeUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.TweetLike.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TweetLikeUpsertOne) SetLikedAt

func (u *TweetLikeUpsertOne) SetLikedAt(v time.Time) *TweetLikeUpsertOne

SetLikedAt sets the "liked_at" field.

func (*TweetLikeUpsertOne) SetTweetID

func (u *TweetLikeUpsertOne) SetTweetID(v int) *TweetLikeUpsertOne

SetTweetID sets the "tweet_id" field.

func (*TweetLikeUpsertOne) SetUserID

func (u *TweetLikeUpsertOne) SetUserID(v int) *TweetLikeUpsertOne

SetUserID sets the "user_id" field.

func (*TweetLikeUpsertOne) Update

func (u *TweetLikeUpsertOne) Update(set func(*TweetLikeUpsert)) *TweetLikeUpsertOne

Update allows overriding fields `UPDATE` values. See the TweetLikeCreate.OnConflict documentation for more info.

func (*TweetLikeUpsertOne) UpdateLikedAt

func (u *TweetLikeUpsertOne) UpdateLikedAt() *TweetLikeUpsertOne

UpdateLikedAt sets the "liked_at" field to the value that was provided on create.

func (*TweetLikeUpsertOne) UpdateNewValues

func (u *TweetLikeUpsertOne) UpdateNewValues() *TweetLikeUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.TweetLike.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TweetLikeUpsertOne) UpdateTweetID

func (u *TweetLikeUpsertOne) UpdateTweetID() *TweetLikeUpsertOne

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

func (*TweetLikeUpsertOne) UpdateUserID

func (u *TweetLikeUpsertOne) UpdateUserID() *TweetLikeUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type TweetLikes

type TweetLikes []*TweetLike

TweetLikes is a parsable slice of TweetLike.

type TweetMutation

type TweetMutation struct {
	// contains filtered or unexported fields
}

TweetMutation represents an operation that mutates the Tweet nodes in the graph.

func (*TweetMutation) AddField

func (m *TweetMutation) 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 (*TweetMutation) AddLikedUserIDs

func (m *TweetMutation) AddLikedUserIDs(ids ...int)

AddLikedUserIDs adds the "liked_users" edge to the User entity by ids.

func (*TweetMutation) AddTagIDs

func (m *TweetMutation) AddTagIDs(ids ...int)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*TweetMutation) AddTweetTagIDs

func (m *TweetMutation) AddTweetTagIDs(ids ...uuid.UUID)

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by ids.

func (*TweetMutation) AddTweetUserIDs

func (m *TweetMutation) AddTweetUserIDs(ids ...int)

AddTweetUserIDs adds the "tweet_user" edge to the UserTweet entity by ids.

func (*TweetMutation) AddUserIDs

func (m *TweetMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "user" edge to the User entity by ids.

func (*TweetMutation) AddedEdges

func (m *TweetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TweetMutation) AddedField

func (m *TweetMutation) 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 (*TweetMutation) AddedFields

func (m *TweetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TweetMutation) AddedIDs

func (m *TweetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TweetMutation) ClearEdge

func (m *TweetMutation) 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 (*TweetMutation) ClearField

func (m *TweetMutation) 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 (*TweetMutation) ClearLikedUsers

func (m *TweetMutation) ClearLikedUsers()

ClearLikedUsers clears the "liked_users" edge to the User entity.

func (*TweetMutation) ClearTags

func (m *TweetMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*TweetMutation) ClearTweetTags

func (m *TweetMutation) ClearTweetTags()

ClearTweetTags clears the "tweet_tags" edge to the TweetTag entity.

func (*TweetMutation) ClearTweetUser

func (m *TweetMutation) ClearTweetUser()

ClearTweetUser clears the "tweet_user" edge to the UserTweet entity.

func (*TweetMutation) ClearUser

func (m *TweetMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*TweetMutation) ClearedEdges

func (m *TweetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TweetMutation) ClearedFields

func (m *TweetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TweetMutation) Client

func (m TweetMutation) 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 (*TweetMutation) EdgeCleared

func (m *TweetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TweetMutation) Field

func (m *TweetMutation) 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 (*TweetMutation) FieldCleared

func (m *TweetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TweetMutation) Fields

func (m *TweetMutation) 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 (*TweetMutation) Filter added in v0.11.2

func (m *TweetMutation) Filter() *TweetFilter

Filter returns an entql.Where implementation to apply filters on the TweetMutation builder.

func (*TweetMutation) ID

func (m *TweetMutation) 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 (*TweetMutation) IDs

func (m *TweetMutation) 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 (*TweetMutation) LikedUsersCleared

func (m *TweetMutation) LikedUsersCleared() bool

LikedUsersCleared reports if the "liked_users" edge to the User entity was cleared.

func (*TweetMutation) LikedUsersIDs

func (m *TweetMutation) LikedUsersIDs() (ids []int)

LikedUsersIDs returns the "liked_users" edge IDs in the mutation.

func (*TweetMutation) OldField

func (m *TweetMutation) 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 (*TweetMutation) OldText

func (m *TweetMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Tweet entity. If the Tweet 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 (*TweetMutation) Op

func (m *TweetMutation) Op() Op

Op returns the operation name.

func (*TweetMutation) RemoveLikedUserIDs

func (m *TweetMutation) RemoveLikedUserIDs(ids ...int)

RemoveLikedUserIDs removes the "liked_users" edge to the User entity by IDs.

func (*TweetMutation) RemoveTagIDs

func (m *TweetMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*TweetMutation) RemoveTweetTagIDs

func (m *TweetMutation) RemoveTweetTagIDs(ids ...uuid.UUID)

RemoveTweetTagIDs removes the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TweetMutation) RemoveTweetUserIDs

func (m *TweetMutation) RemoveTweetUserIDs(ids ...int)

RemoveTweetUserIDs removes the "tweet_user" edge to the UserTweet entity by IDs.

func (*TweetMutation) RemoveUserIDs

func (m *TweetMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "user" edge to the User entity by IDs.

func (*TweetMutation) RemovedEdges

func (m *TweetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TweetMutation) RemovedIDs

func (m *TweetMutation) 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 (*TweetMutation) RemovedLikedUsersIDs

func (m *TweetMutation) RemovedLikedUsersIDs() (ids []int)

RemovedLikedUsers returns the removed IDs of the "liked_users" edge to the User entity.

func (*TweetMutation) RemovedTagsIDs

func (m *TweetMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*TweetMutation) RemovedTweetTagsIDs

func (m *TweetMutation) RemovedTweetTagsIDs() (ids []uuid.UUID)

RemovedTweetTags returns the removed IDs of the "tweet_tags" edge to the TweetTag entity.

func (*TweetMutation) RemovedTweetUserIDs

func (m *TweetMutation) RemovedTweetUserIDs() (ids []int)

RemovedTweetUser returns the removed IDs of the "tweet_user" edge to the UserTweet entity.

func (*TweetMutation) RemovedUserIDs

func (m *TweetMutation) RemovedUserIDs() (ids []int)

RemovedUser returns the removed IDs of the "user" edge to the User entity.

func (*TweetMutation) ResetEdge

func (m *TweetMutation) 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 (*TweetMutation) ResetField

func (m *TweetMutation) 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 (*TweetMutation) ResetLikedUsers

func (m *TweetMutation) ResetLikedUsers()

ResetLikedUsers resets all changes to the "liked_users" edge.

func (*TweetMutation) ResetTags

func (m *TweetMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*TweetMutation) ResetText

func (m *TweetMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*TweetMutation) ResetTweetTags

func (m *TweetMutation) ResetTweetTags()

ResetTweetTags resets all changes to the "tweet_tags" edge.

func (*TweetMutation) ResetTweetUser

func (m *TweetMutation) ResetTweetUser()

ResetTweetUser resets all changes to the "tweet_user" edge.

func (*TweetMutation) ResetUser

func (m *TweetMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*TweetMutation) SetField

func (m *TweetMutation) 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 (*TweetMutation) SetOp added in v0.11.5

func (m *TweetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TweetMutation) SetText

func (m *TweetMutation) SetText(s string)

SetText sets the "text" field.

func (*TweetMutation) TagsCleared

func (m *TweetMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*TweetMutation) TagsIDs

func (m *TweetMutation) TagsIDs() (ids []int)

TagsIDs returns the "tags" edge IDs in the mutation.

func (*TweetMutation) Text

func (m *TweetMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (*TweetMutation) TweetTagsCleared

func (m *TweetMutation) TweetTagsCleared() bool

TweetTagsCleared reports if the "tweet_tags" edge to the TweetTag entity was cleared.

func (*TweetMutation) TweetTagsIDs

func (m *TweetMutation) TweetTagsIDs() (ids []uuid.UUID)

TweetTagsIDs returns the "tweet_tags" edge IDs in the mutation.

func (*TweetMutation) TweetUserCleared

func (m *TweetMutation) TweetUserCleared() bool

TweetUserCleared reports if the "tweet_user" edge to the UserTweet entity was cleared.

func (*TweetMutation) TweetUserIDs

func (m *TweetMutation) TweetUserIDs() (ids []int)

TweetUserIDs returns the "tweet_user" edge IDs in the mutation.

func (TweetMutation) Tx

func (m TweetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TweetMutation) Type

func (m *TweetMutation) Type() string

Type returns the node type of this mutation (Tweet).

func (*TweetMutation) UserCleared

func (m *TweetMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*TweetMutation) UserIDs

func (m *TweetMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation.

func (*TweetMutation) Where

func (m *TweetMutation) Where(ps ...predicate.Tweet)

Where appends a list predicates to the TweetMutation builder.

func (*TweetMutation) WhereP added in v0.11.5

func (m *TweetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TweetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TweetQuery

type TweetQuery struct {
	// contains filtered or unexported fields
}

TweetQuery is the builder for querying Tweet entities.

func (*TweetQuery) Aggregate added in v0.11.4

func (tq *TweetQuery) Aggregate(fns ...AggregateFunc) *TweetSelect

Aggregate returns a TweetSelect configured with the given aggregations.

func (*TweetQuery) All

func (tq *TweetQuery) All(ctx context.Context) ([]*Tweet, error)

All executes the query and returns a list of Tweets.

func (*TweetQuery) AllX

func (tq *TweetQuery) AllX(ctx context.Context) []*Tweet

AllX is like All, but panics if an error occurs.

func (*TweetQuery) Clone

func (tq *TweetQuery) Clone() *TweetQuery

Clone returns a duplicate of the TweetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TweetQuery) Count

func (tq *TweetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TweetQuery) CountX

func (tq *TweetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TweetQuery) Exist

func (tq *TweetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TweetQuery) ExistX

func (tq *TweetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TweetQuery) Filter added in v0.11.2

func (tq *TweetQuery) Filter() *TweetFilter

Filter returns a Filter implementation to apply filters on the TweetQuery builder.

func (*TweetQuery) First

func (tq *TweetQuery) First(ctx context.Context) (*Tweet, error)

First returns the first Tweet entity from the query. Returns a *NotFoundError when no Tweet was found.

func (*TweetQuery) FirstID

func (tq *TweetQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tweet ID from the query. Returns a *NotFoundError when no Tweet ID was found.

func (*TweetQuery) FirstIDX

func (tq *TweetQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TweetQuery) FirstX

func (tq *TweetQuery) FirstX(ctx context.Context) *Tweet

FirstX is like First, but panics if an error occurs.

func (*TweetQuery) GroupBy

func (tq *TweetQuery) GroupBy(field string, fields ...string) *TweetGroupBy

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.Tweet.Query().
	GroupBy(tweet.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TweetQuery) IDs

func (tq *TweetQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tweet IDs.

func (*TweetQuery) IDsX

func (tq *TweetQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TweetQuery) Limit

func (tq *TweetQuery) Limit(limit int) *TweetQuery

Limit the number of records to be returned by this query.

func (*TweetQuery) Offset

func (tq *TweetQuery) Offset(offset int) *TweetQuery

Offset to start from.

func (*TweetQuery) Only

func (tq *TweetQuery) Only(ctx context.Context) (*Tweet, error)

Only returns a single Tweet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tweet entity is found. Returns a *NotFoundError when no Tweet entities are found.

func (*TweetQuery) OnlyID

func (tq *TweetQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Tweet ID in the query. Returns a *NotSingularError when more than one Tweet ID is found. Returns a *NotFoundError when no entities are found.

func (*TweetQuery) OnlyIDX

func (tq *TweetQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TweetQuery) OnlyX

func (tq *TweetQuery) OnlyX(ctx context.Context) *Tweet

OnlyX is like Only, but panics if an error occurs.

func (*TweetQuery) Order

func (tq *TweetQuery) Order(o ...OrderFunc) *TweetQuery

Order specifies how the records should be ordered.

func (*TweetQuery) QueryLikedUsers

func (tq *TweetQuery) QueryLikedUsers() *UserQuery

QueryLikedUsers chains the current query on the "liked_users" edge.

func (*TweetQuery) QueryLikes

func (tq *TweetQuery) QueryLikes() *TweetLikeQuery

QueryLikes chains the current query on the "likes" edge.

func (*TweetQuery) QueryTags

func (tq *TweetQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*TweetQuery) QueryTweetTags

func (tq *TweetQuery) QueryTweetTags() *TweetTagQuery

QueryTweetTags chains the current query on the "tweet_tags" edge.

func (*TweetQuery) QueryTweetUser

func (tq *TweetQuery) QueryTweetUser() *UserTweetQuery

QueryTweetUser chains the current query on the "tweet_user" edge.

func (*TweetQuery) QueryUser

func (tq *TweetQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*TweetQuery) Select

func (tq *TweetQuery) Select(fields ...string) *TweetSelect

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.Tweet.Query().
	Select(tweet.FieldText).
	Scan(ctx, &v)

func (*TweetQuery) Unique

func (tq *TweetQuery) Unique(unique bool) *TweetQuery

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 (*TweetQuery) Where

func (tq *TweetQuery) Where(ps ...predicate.Tweet) *TweetQuery

Where adds a new predicate for the TweetQuery builder.

func (*TweetQuery) WithLikedUsers

func (tq *TweetQuery) WithLikedUsers(opts ...func(*UserQuery)) *TweetQuery

WithLikedUsers tells the query-builder to eager-load the nodes that are connected to the "liked_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetQuery) WithLikes

func (tq *TweetQuery) WithLikes(opts ...func(*TweetLikeQuery)) *TweetQuery

WithLikes tells the query-builder to eager-load the nodes that are connected to the "likes" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetQuery) WithTags

func (tq *TweetQuery) WithTags(opts ...func(*TagQuery)) *TweetQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetQuery) WithTweetTags

func (tq *TweetQuery) WithTweetTags(opts ...func(*TweetTagQuery)) *TweetQuery

WithTweetTags tells the query-builder to eager-load the nodes that are connected to the "tweet_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetQuery) WithTweetUser

func (tq *TweetQuery) WithTweetUser(opts ...func(*UserTweetQuery)) *TweetQuery

WithTweetUser tells the query-builder to eager-load the nodes that are connected to the "tweet_user" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetQuery) WithUser

func (tq *TweetQuery) WithUser(opts ...func(*UserQuery)) *TweetQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type TweetSelect

type TweetSelect struct {
	*TweetQuery
	// contains filtered or unexported fields
}

TweetSelect is the builder for selecting fields of Tweet entities.

func (*TweetSelect) Aggregate added in v0.11.4

func (ts *TweetSelect) Aggregate(fns ...AggregateFunc) *TweetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TweetSelect) Bool

func (s *TweetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TweetSelect) BoolX

func (s *TweetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TweetSelect) Bools

func (s *TweetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TweetSelect) BoolsX

func (s *TweetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TweetSelect) Float64

func (s *TweetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TweetSelect) Float64X

func (s *TweetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TweetSelect) Float64s

func (s *TweetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TweetSelect) Float64sX

func (s *TweetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TweetSelect) Int

func (s *TweetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TweetSelect) IntX

func (s *TweetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TweetSelect) Ints

func (s *TweetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TweetSelect) IntsX

func (s *TweetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TweetSelect) Scan

func (ts *TweetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TweetSelect) ScanX

func (s *TweetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TweetSelect) String

func (s *TweetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TweetSelect) StringX

func (s *TweetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TweetSelect) Strings

func (s *TweetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TweetSelect) StringsX

func (s *TweetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TweetTag

type TweetTag struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// AddedAt holds the value of the "added_at" field.
	AddedAt time.Time `json:"added_at,omitempty"`
	// TagID holds the value of the "tag_id" field.
	TagID int `json:"tag_id,omitempty"`
	// TweetID holds the value of the "tweet_id" field.
	TweetID int `json:"tweet_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TweetTagQuery when eager-loading is set.
	Edges TweetTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

TweetTag is the model entity for the TweetTag schema.

func (*TweetTag) QueryTag

func (tt *TweetTag) QueryTag() *TagQuery

QueryTag queries the "tag" edge of the TweetTag entity.

func (*TweetTag) QueryTweet

func (tt *TweetTag) QueryTweet() *TweetQuery

QueryTweet queries the "tweet" edge of the TweetTag entity.

func (*TweetTag) String

func (tt *TweetTag) String() string

String implements the fmt.Stringer.

func (*TweetTag) Unwrap

func (tt *TweetTag) Unwrap() *TweetTag

Unwrap unwraps the TweetTag 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 (*TweetTag) Update

func (tt *TweetTag) Update() *TweetTagUpdateOne

Update returns a builder for updating this TweetTag. Note that you need to call TweetTag.Unwrap() before calling this method if this TweetTag was returned from a transaction, and the transaction was committed or rolled back.

type TweetTagClient

type TweetTagClient struct {
	// contains filtered or unexported fields
}

TweetTagClient is a client for the TweetTag schema.

func NewTweetTagClient

func NewTweetTagClient(c config) *TweetTagClient

NewTweetTagClient returns a client for the TweetTag from the given config.

func (*TweetTagClient) Create

func (c *TweetTagClient) Create() *TweetTagCreate

Create returns a builder for creating a TweetTag entity.

func (*TweetTagClient) CreateBulk

func (c *TweetTagClient) CreateBulk(builders ...*TweetTagCreate) *TweetTagCreateBulk

CreateBulk returns a builder for creating a bulk of TweetTag entities.

func (*TweetTagClient) Delete

func (c *TweetTagClient) Delete() *TweetTagDelete

Delete returns a delete builder for TweetTag.

func (*TweetTagClient) DeleteOne

func (c *TweetTagClient) DeleteOne(tt *TweetTag) *TweetTagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TweetTagClient) DeleteOneID

func (c *TweetTagClient) DeleteOneID(id uuid.UUID) *TweetTagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TweetTagClient) Get

func (c *TweetTagClient) Get(ctx context.Context, id uuid.UUID) (*TweetTag, error)

Get returns a TweetTag entity by its id.

func (*TweetTagClient) GetX

func (c *TweetTagClient) GetX(ctx context.Context, id uuid.UUID) *TweetTag

GetX is like Get, but panics if an error occurs.

func (*TweetTagClient) Hooks

func (c *TweetTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TweetTagClient) Intercept added in v0.11.5

func (c *TweetTagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tweettag.Intercept(f(g(h())))`.

func (*TweetTagClient) Interceptors added in v0.11.5

func (c *TweetTagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TweetTagClient) Query

func (c *TweetTagClient) Query() *TweetTagQuery

Query returns a query builder for TweetTag.

func (*TweetTagClient) QueryTag

func (c *TweetTagClient) QueryTag(tt *TweetTag) *TagQuery

QueryTag queries the tag edge of a TweetTag.

func (*TweetTagClient) QueryTweet

func (c *TweetTagClient) QueryTweet(tt *TweetTag) *TweetQuery

QueryTweet queries the tweet edge of a TweetTag.

func (*TweetTagClient) Update

func (c *TweetTagClient) Update() *TweetTagUpdate

Update returns an update builder for TweetTag.

func (*TweetTagClient) UpdateOne

func (c *TweetTagClient) UpdateOne(tt *TweetTag) *TweetTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TweetTagClient) UpdateOneID

func (c *TweetTagClient) UpdateOneID(id uuid.UUID) *TweetTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TweetTagClient) Use

func (c *TweetTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tweettag.Hooks(f(g(h())))`.

type TweetTagCreate

type TweetTagCreate struct {
	// contains filtered or unexported fields
}

TweetTagCreate is the builder for creating a TweetTag entity.

func (*TweetTagCreate) Exec

func (ttc *TweetTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetTagCreate) ExecX

func (ttc *TweetTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagCreate) Mutation

func (ttc *TweetTagCreate) Mutation() *TweetTagMutation

Mutation returns the TweetTagMutation object of the builder.

func (*TweetTagCreate) OnConflict

func (ttc *TweetTagCreate) OnConflict(opts ...sql.ConflictOption) *TweetTagUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.TweetTag.Create().
	SetAddedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TweetTagUpsert) {
		SetAddedAt(v+v).
	}).
	Exec(ctx)

func (*TweetTagCreate) OnConflictColumns

func (ttc *TweetTagCreate) OnConflictColumns(columns ...string) *TweetTagUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.TweetTag.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TweetTagCreate) Save

func (ttc *TweetTagCreate) Save(ctx context.Context) (*TweetTag, error)

Save creates the TweetTag in the database.

func (*TweetTagCreate) SaveX

func (ttc *TweetTagCreate) SaveX(ctx context.Context) *TweetTag

SaveX calls Save and panics if Save returns an error.

func (*TweetTagCreate) SetAddedAt

func (ttc *TweetTagCreate) SetAddedAt(t time.Time) *TweetTagCreate

SetAddedAt sets the "added_at" field.

func (*TweetTagCreate) SetID

func (ttc *TweetTagCreate) SetID(u uuid.UUID) *TweetTagCreate

SetID sets the "id" field.

func (*TweetTagCreate) SetNillableAddedAt

func (ttc *TweetTagCreate) SetNillableAddedAt(t *time.Time) *TweetTagCreate

SetNillableAddedAt sets the "added_at" field if the given value is not nil.

func (*TweetTagCreate) SetNillableID

func (ttc *TweetTagCreate) SetNillableID(u *uuid.UUID) *TweetTagCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TweetTagCreate) SetTag

func (ttc *TweetTagCreate) SetTag(t *Tag) *TweetTagCreate

SetTag sets the "tag" edge to the Tag entity.

func (*TweetTagCreate) SetTagID

func (ttc *TweetTagCreate) SetTagID(i int) *TweetTagCreate

SetTagID sets the "tag_id" field.

func (*TweetTagCreate) SetTweet

func (ttc *TweetTagCreate) SetTweet(t *Tweet) *TweetTagCreate

SetTweet sets the "tweet" edge to the Tweet entity.

func (*TweetTagCreate) SetTweetID

func (ttc *TweetTagCreate) SetTweetID(i int) *TweetTagCreate

SetTweetID sets the "tweet_id" field.

type TweetTagCreateBulk

type TweetTagCreateBulk struct {
	// contains filtered or unexported fields
}

TweetTagCreateBulk is the builder for creating many TweetTag entities in bulk.

func (*TweetTagCreateBulk) Exec

func (ttcb *TweetTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetTagCreateBulk) ExecX

func (ttcb *TweetTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagCreateBulk) OnConflict

func (ttcb *TweetTagCreateBulk) OnConflict(opts ...sql.ConflictOption) *TweetTagUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.TweetTag.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TweetTagUpsert) {
		SetAddedAt(v+v).
	}).
	Exec(ctx)

func (*TweetTagCreateBulk) OnConflictColumns

func (ttcb *TweetTagCreateBulk) OnConflictColumns(columns ...string) *TweetTagUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.TweetTag.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TweetTagCreateBulk) Save

func (ttcb *TweetTagCreateBulk) Save(ctx context.Context) ([]*TweetTag, error)

Save creates the TweetTag entities in the database.

func (*TweetTagCreateBulk) SaveX

func (ttcb *TweetTagCreateBulk) SaveX(ctx context.Context) []*TweetTag

SaveX is like Save, but panics if an error occurs.

type TweetTagDelete

type TweetTagDelete struct {
	// contains filtered or unexported fields
}

TweetTagDelete is the builder for deleting a TweetTag entity.

func (*TweetTagDelete) Exec

func (ttd *TweetTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TweetTagDelete) ExecX

func (ttd *TweetTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagDelete) Where

func (ttd *TweetTagDelete) Where(ps ...predicate.TweetTag) *TweetTagDelete

Where appends a list predicates to the TweetTagDelete builder.

type TweetTagDeleteOne

type TweetTagDeleteOne struct {
	// contains filtered or unexported fields
}

TweetTagDeleteOne is the builder for deleting a single TweetTag entity.

func (*TweetTagDeleteOne) Exec

func (ttdo *TweetTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TweetTagDeleteOne) ExecX

func (ttdo *TweetTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagDeleteOne) Where added in v0.11.7

Where appends a list predicates to the TweetTagDelete builder.

type TweetTagEdges

type TweetTagEdges struct {
	// Tag holds the value of the tag edge.
	Tag *Tag `json:"tag,omitempty"`
	// Tweet holds the value of the tweet edge.
	Tweet *Tweet `json:"tweet,omitempty"`
	// contains filtered or unexported fields
}

TweetTagEdges holds the relations/edges for other nodes in the graph.

func (TweetTagEdges) TagOrErr

func (e TweetTagEdges) TagOrErr() (*Tag, error)

TagOrErr returns the Tag value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TweetTagEdges) TweetOrErr

func (e TweetTagEdges) TweetOrErr() (*Tweet, error)

TweetOrErr returns the Tweet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TweetTagFilter added in v0.11.2

type TweetTagFilter struct {
	// contains filtered or unexported fields
}

TweetTagFilter provides a generic filtering capability at runtime for TweetTagQuery.

func (*TweetTagFilter) Where added in v0.11.2

func (f *TweetTagFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*TweetTagFilter) WhereAddedAt added in v0.11.2

func (f *TweetTagFilter) WhereAddedAt(p entql.TimeP)

WhereAddedAt applies the entql time.Time predicate on the added_at field.

func (*TweetTagFilter) WhereHasTag added in v0.11.2

func (f *TweetTagFilter) WhereHasTag()

WhereHasTag applies a predicate to check if query has an edge tag.

func (*TweetTagFilter) WhereHasTagWith added in v0.11.2

func (f *TweetTagFilter) WhereHasTagWith(preds ...predicate.Tag)

WhereHasTagWith applies a predicate to check if query has an edge tag with a given conditions (other predicates).

func (*TweetTagFilter) WhereHasTweet added in v0.11.2

func (f *TweetTagFilter) WhereHasTweet()

WhereHasTweet applies a predicate to check if query has an edge tweet.

func (*TweetTagFilter) WhereHasTweetWith added in v0.11.2

func (f *TweetTagFilter) WhereHasTweetWith(preds ...predicate.Tweet)

WhereHasTweetWith applies a predicate to check if query has an edge tweet with a given conditions (other predicates).

func (*TweetTagFilter) WhereID added in v0.11.2

func (f *TweetTagFilter) WhereID(p entql.ValueP)

WhereID applies the entql [16]byte predicate on the id field.

func (*TweetTagFilter) WhereTagID added in v0.11.2

func (f *TweetTagFilter) WhereTagID(p entql.IntP)

WhereTagID applies the entql int predicate on the tag_id field.

func (*TweetTagFilter) WhereTweetID added in v0.11.2

func (f *TweetTagFilter) WhereTweetID(p entql.IntP)

WhereTweetID applies the entql int predicate on the tweet_id field.

type TweetTagGroupBy

type TweetTagGroupBy struct {
	// contains filtered or unexported fields
}

TweetTagGroupBy is the group-by builder for TweetTag entities.

func (*TweetTagGroupBy) Aggregate

func (ttgb *TweetTagGroupBy) Aggregate(fns ...AggregateFunc) *TweetTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TweetTagGroupBy) Bool

func (s *TweetTagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) BoolX

func (s *TweetTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TweetTagGroupBy) Bools

func (s *TweetTagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) BoolsX

func (s *TweetTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TweetTagGroupBy) Float64

func (s *TweetTagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) Float64X

func (s *TweetTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TweetTagGroupBy) Float64s

func (s *TweetTagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) Float64sX

func (s *TweetTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TweetTagGroupBy) Int

func (s *TweetTagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) IntX

func (s *TweetTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TweetTagGroupBy) Ints

func (s *TweetTagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) IntsX

func (s *TweetTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TweetTagGroupBy) Scan

func (ttgb *TweetTagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TweetTagGroupBy) ScanX

func (s *TweetTagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TweetTagGroupBy) String

func (s *TweetTagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) StringX

func (s *TweetTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TweetTagGroupBy) Strings

func (s *TweetTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TweetTagGroupBy) StringsX

func (s *TweetTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TweetTagMutation

type TweetTagMutation struct {
	// contains filtered or unexported fields
}

TweetTagMutation represents an operation that mutates the TweetTag nodes in the graph.

func (*TweetTagMutation) AddField

func (m *TweetTagMutation) 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 (*TweetTagMutation) AddedAt

func (m *TweetTagMutation) AddedAt() (r time.Time, exists bool)

AddedAt returns the value of the "added_at" field in the mutation.

func (*TweetTagMutation) AddedEdges

func (m *TweetTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TweetTagMutation) AddedField

func (m *TweetTagMutation) 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 (*TweetTagMutation) AddedFields

func (m *TweetTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TweetTagMutation) AddedIDs

func (m *TweetTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TweetTagMutation) ClearEdge

func (m *TweetTagMutation) 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 (*TweetTagMutation) ClearField

func (m *TweetTagMutation) 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 (*TweetTagMutation) ClearTag

func (m *TweetTagMutation) ClearTag()

ClearTag clears the "tag" edge to the Tag entity.

func (*TweetTagMutation) ClearTweet

func (m *TweetTagMutation) ClearTweet()

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*TweetTagMutation) ClearedEdges

func (m *TweetTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TweetTagMutation) ClearedFields

func (m *TweetTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TweetTagMutation) Client

func (m TweetTagMutation) 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 (*TweetTagMutation) EdgeCleared

func (m *TweetTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TweetTagMutation) Field

func (m *TweetTagMutation) 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 (*TweetTagMutation) FieldCleared

func (m *TweetTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TweetTagMutation) Fields

func (m *TweetTagMutation) 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 (*TweetTagMutation) Filter added in v0.11.2

func (m *TweetTagMutation) Filter() *TweetTagFilter

Filter returns an entql.Where implementation to apply filters on the TweetTagMutation builder.

func (*TweetTagMutation) ID

func (m *TweetTagMutation) ID() (id uuid.UUID, 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 (*TweetTagMutation) IDs

func (m *TweetTagMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*TweetTagMutation) OldAddedAt

func (m *TweetTagMutation) OldAddedAt(ctx context.Context) (v time.Time, err error)

OldAddedAt returns the old "added_at" field's value of the TweetTag entity. If the TweetTag 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 (*TweetTagMutation) OldField

func (m *TweetTagMutation) 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 (*TweetTagMutation) OldTagID

func (m *TweetTagMutation) OldTagID(ctx context.Context) (v int, err error)

OldTagID returns the old "tag_id" field's value of the TweetTag entity. If the TweetTag 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 (*TweetTagMutation) OldTweetID

func (m *TweetTagMutation) OldTweetID(ctx context.Context) (v int, err error)

OldTweetID returns the old "tweet_id" field's value of the TweetTag entity. If the TweetTag 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 (*TweetTagMutation) Op

func (m *TweetTagMutation) Op() Op

Op returns the operation name.

func (*TweetTagMutation) RemovedEdges

func (m *TweetTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TweetTagMutation) RemovedIDs

func (m *TweetTagMutation) 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 (*TweetTagMutation) ResetAddedAt

func (m *TweetTagMutation) ResetAddedAt()

ResetAddedAt resets all changes to the "added_at" field.

func (*TweetTagMutation) ResetEdge

func (m *TweetTagMutation) 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 (*TweetTagMutation) ResetField

func (m *TweetTagMutation) 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 (*TweetTagMutation) ResetTag

func (m *TweetTagMutation) ResetTag()

ResetTag resets all changes to the "tag" edge.

func (*TweetTagMutation) ResetTagID

func (m *TweetTagMutation) ResetTagID()

ResetTagID resets all changes to the "tag_id" field.

func (*TweetTagMutation) ResetTweet

func (m *TweetTagMutation) ResetTweet()

ResetTweet resets all changes to the "tweet" edge.

func (*TweetTagMutation) ResetTweetID

func (m *TweetTagMutation) ResetTweetID()

ResetTweetID resets all changes to the "tweet_id" field.

func (*TweetTagMutation) SetAddedAt

func (m *TweetTagMutation) SetAddedAt(t time.Time)

SetAddedAt sets the "added_at" field.

func (*TweetTagMutation) SetField

func (m *TweetTagMutation) 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 (*TweetTagMutation) SetID

func (m *TweetTagMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TweetTag entities.

func (*TweetTagMutation) SetOp added in v0.11.5

func (m *TweetTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TweetTagMutation) SetTagID

func (m *TweetTagMutation) SetTagID(i int)

SetTagID sets the "tag_id" field.

func (*TweetTagMutation) SetTweetID

func (m *TweetTagMutation) SetTweetID(i int)

SetTweetID sets the "tweet_id" field.

func (*TweetTagMutation) TagCleared

func (m *TweetTagMutation) TagCleared() bool

TagCleared reports if the "tag" edge to the Tag entity was cleared.

func (*TweetTagMutation) TagID

func (m *TweetTagMutation) TagID() (r int, exists bool)

TagID returns the value of the "tag_id" field in the mutation.

func (*TweetTagMutation) TagIDs

func (m *TweetTagMutation) TagIDs() (ids []int)

TagIDs returns the "tag" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TagID instead. It exists only for internal usage by the builders.

func (*TweetTagMutation) TweetCleared

func (m *TweetTagMutation) TweetCleared() bool

TweetCleared reports if the "tweet" edge to the Tweet entity was cleared.

func (*TweetTagMutation) TweetID

func (m *TweetTagMutation) TweetID() (r int, exists bool)

TweetID returns the value of the "tweet_id" field in the mutation.

func (*TweetTagMutation) TweetIDs

func (m *TweetTagMutation) TweetIDs() (ids []int)

TweetIDs returns the "tweet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TweetID instead. It exists only for internal usage by the builders.

func (TweetTagMutation) Tx

func (m TweetTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TweetTagMutation) Type

func (m *TweetTagMutation) Type() string

Type returns the node type of this mutation (TweetTag).

func (*TweetTagMutation) Where

func (m *TweetTagMutation) Where(ps ...predicate.TweetTag)

Where appends a list predicates to the TweetTagMutation builder.

func (*TweetTagMutation) WhereP added in v0.11.5

func (m *TweetTagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TweetTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TweetTagQuery

type TweetTagQuery struct {
	// contains filtered or unexported fields
}

TweetTagQuery is the builder for querying TweetTag entities.

func (*TweetTagQuery) Aggregate added in v0.11.4

func (ttq *TweetTagQuery) Aggregate(fns ...AggregateFunc) *TweetTagSelect

Aggregate returns a TweetTagSelect configured with the given aggregations.

func (*TweetTagQuery) All

func (ttq *TweetTagQuery) All(ctx context.Context) ([]*TweetTag, error)

All executes the query and returns a list of TweetTags.

func (*TweetTagQuery) AllX

func (ttq *TweetTagQuery) AllX(ctx context.Context) []*TweetTag

AllX is like All, but panics if an error occurs.

func (*TweetTagQuery) Clone

func (ttq *TweetTagQuery) Clone() *TweetTagQuery

Clone returns a duplicate of the TweetTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TweetTagQuery) Count

func (ttq *TweetTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TweetTagQuery) CountX

func (ttq *TweetTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TweetTagQuery) Exist

func (ttq *TweetTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TweetTagQuery) ExistX

func (ttq *TweetTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TweetTagQuery) Filter added in v0.11.2

func (ttq *TweetTagQuery) Filter() *TweetTagFilter

Filter returns a Filter implementation to apply filters on the TweetTagQuery builder.

func (*TweetTagQuery) First

func (ttq *TweetTagQuery) First(ctx context.Context) (*TweetTag, error)

First returns the first TweetTag entity from the query. Returns a *NotFoundError when no TweetTag was found.

func (*TweetTagQuery) FirstID

func (ttq *TweetTagQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first TweetTag ID from the query. Returns a *NotFoundError when no TweetTag ID was found.

func (*TweetTagQuery) FirstIDX

func (ttq *TweetTagQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TweetTagQuery) FirstX

func (ttq *TweetTagQuery) FirstX(ctx context.Context) *TweetTag

FirstX is like First, but panics if an error occurs.

func (*TweetTagQuery) GroupBy

func (ttq *TweetTagQuery) GroupBy(field string, fields ...string) *TweetTagGroupBy

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 {
	AddedAt time.Time `json:"added_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TweetTag.Query().
	GroupBy(tweettag.FieldAddedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TweetTagQuery) IDs

func (ttq *TweetTagQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of TweetTag IDs.

func (*TweetTagQuery) IDsX

func (ttq *TweetTagQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TweetTagQuery) Limit

func (ttq *TweetTagQuery) Limit(limit int) *TweetTagQuery

Limit the number of records to be returned by this query.

func (*TweetTagQuery) Offset

func (ttq *TweetTagQuery) Offset(offset int) *TweetTagQuery

Offset to start from.

func (*TweetTagQuery) Only

func (ttq *TweetTagQuery) Only(ctx context.Context) (*TweetTag, error)

Only returns a single TweetTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TweetTag entity is found. Returns a *NotFoundError when no TweetTag entities are found.

func (*TweetTagQuery) OnlyID

func (ttq *TweetTagQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only TweetTag ID in the query. Returns a *NotSingularError when more than one TweetTag ID is found. Returns a *NotFoundError when no entities are found.

func (*TweetTagQuery) OnlyIDX

func (ttq *TweetTagQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TweetTagQuery) OnlyX

func (ttq *TweetTagQuery) OnlyX(ctx context.Context) *TweetTag

OnlyX is like Only, but panics if an error occurs.

func (*TweetTagQuery) Order

func (ttq *TweetTagQuery) Order(o ...OrderFunc) *TweetTagQuery

Order specifies how the records should be ordered.

func (*TweetTagQuery) QueryTag

func (ttq *TweetTagQuery) QueryTag() *TagQuery

QueryTag chains the current query on the "tag" edge.

func (*TweetTagQuery) QueryTweet

func (ttq *TweetTagQuery) QueryTweet() *TweetQuery

QueryTweet chains the current query on the "tweet" edge.

func (*TweetTagQuery) Select

func (ttq *TweetTagQuery) Select(fields ...string) *TweetTagSelect

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 {
	AddedAt time.Time `json:"added_at,omitempty"`
}

client.TweetTag.Query().
	Select(tweettag.FieldAddedAt).
	Scan(ctx, &v)

func (*TweetTagQuery) Unique

func (ttq *TweetTagQuery) Unique(unique bool) *TweetTagQuery

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 (*TweetTagQuery) Where

func (ttq *TweetTagQuery) Where(ps ...predicate.TweetTag) *TweetTagQuery

Where adds a new predicate for the TweetTagQuery builder.

func (*TweetTagQuery) WithTag

func (ttq *TweetTagQuery) WithTag(opts ...func(*TagQuery)) *TweetTagQuery

WithTag tells the query-builder to eager-load the nodes that are connected to the "tag" edge. The optional arguments are used to configure the query builder of the edge.

func (*TweetTagQuery) WithTweet

func (ttq *TweetTagQuery) WithTweet(opts ...func(*TweetQuery)) *TweetTagQuery

WithTweet tells the query-builder to eager-load the nodes that are connected to the "tweet" edge. The optional arguments are used to configure the query builder of the edge.

type TweetTagSelect

type TweetTagSelect struct {
	*TweetTagQuery
	// contains filtered or unexported fields
}

TweetTagSelect is the builder for selecting fields of TweetTag entities.

func (*TweetTagSelect) Aggregate added in v0.11.4

func (tts *TweetTagSelect) Aggregate(fns ...AggregateFunc) *TweetTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TweetTagSelect) Bool

func (s *TweetTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) BoolX

func (s *TweetTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TweetTagSelect) Bools

func (s *TweetTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) BoolsX

func (s *TweetTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TweetTagSelect) Float64

func (s *TweetTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) Float64X

func (s *TweetTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TweetTagSelect) Float64s

func (s *TweetTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) Float64sX

func (s *TweetTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TweetTagSelect) Int

func (s *TweetTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) IntX

func (s *TweetTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TweetTagSelect) Ints

func (s *TweetTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) IntsX

func (s *TweetTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TweetTagSelect) Scan

func (tts *TweetTagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TweetTagSelect) ScanX

func (s *TweetTagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TweetTagSelect) String

func (s *TweetTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) StringX

func (s *TweetTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TweetTagSelect) Strings

func (s *TweetTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TweetTagSelect) StringsX

func (s *TweetTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TweetTagUpdate

type TweetTagUpdate struct {
	// contains filtered or unexported fields
}

TweetTagUpdate is the builder for updating TweetTag entities.

func (*TweetTagUpdate) ClearTag

func (ttu *TweetTagUpdate) ClearTag() *TweetTagUpdate

ClearTag clears the "tag" edge to the Tag entity.

func (*TweetTagUpdate) ClearTweet

func (ttu *TweetTagUpdate) ClearTweet() *TweetTagUpdate

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*TweetTagUpdate) Exec

func (ttu *TweetTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetTagUpdate) ExecX

func (ttu *TweetTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagUpdate) Mutation

func (ttu *TweetTagUpdate) Mutation() *TweetTagMutation

Mutation returns the TweetTagMutation object of the builder.

func (*TweetTagUpdate) Save

func (ttu *TweetTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TweetTagUpdate) SaveX

func (ttu *TweetTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TweetTagUpdate) SetAddedAt

func (ttu *TweetTagUpdate) SetAddedAt(t time.Time) *TweetTagUpdate

SetAddedAt sets the "added_at" field.

func (*TweetTagUpdate) SetNillableAddedAt

func (ttu *TweetTagUpdate) SetNillableAddedAt(t *time.Time) *TweetTagUpdate

SetNillableAddedAt sets the "added_at" field if the given value is not nil.

func (*TweetTagUpdate) SetTag

func (ttu *TweetTagUpdate) SetTag(t *Tag) *TweetTagUpdate

SetTag sets the "tag" edge to the Tag entity.

func (*TweetTagUpdate) SetTagID

func (ttu *TweetTagUpdate) SetTagID(i int) *TweetTagUpdate

SetTagID sets the "tag_id" field.

func (*TweetTagUpdate) SetTweet

func (ttu *TweetTagUpdate) SetTweet(t *Tweet) *TweetTagUpdate

SetTweet sets the "tweet" edge to the Tweet entity.

func (*TweetTagUpdate) SetTweetID

func (ttu *TweetTagUpdate) SetTweetID(i int) *TweetTagUpdate

SetTweetID sets the "tweet_id" field.

func (*TweetTagUpdate) Where

func (ttu *TweetTagUpdate) Where(ps ...predicate.TweetTag) *TweetTagUpdate

Where appends a list predicates to the TweetTagUpdate builder.

type TweetTagUpdateOne

type TweetTagUpdateOne struct {
	// contains filtered or unexported fields
}

TweetTagUpdateOne is the builder for updating a single TweetTag entity.

func (*TweetTagUpdateOne) ClearTag

func (ttuo *TweetTagUpdateOne) ClearTag() *TweetTagUpdateOne

ClearTag clears the "tag" edge to the Tag entity.

func (*TweetTagUpdateOne) ClearTweet

func (ttuo *TweetTagUpdateOne) ClearTweet() *TweetTagUpdateOne

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*TweetTagUpdateOne) Exec

func (ttuo *TweetTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TweetTagUpdateOne) ExecX

func (ttuo *TweetTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagUpdateOne) Mutation

func (ttuo *TweetTagUpdateOne) Mutation() *TweetTagMutation

Mutation returns the TweetTagMutation object of the builder.

func (*TweetTagUpdateOne) Save

func (ttuo *TweetTagUpdateOne) Save(ctx context.Context) (*TweetTag, error)

Save executes the query and returns the updated TweetTag entity.

func (*TweetTagUpdateOne) SaveX

func (ttuo *TweetTagUpdateOne) SaveX(ctx context.Context) *TweetTag

SaveX is like Save, but panics if an error occurs.

func (*TweetTagUpdateOne) Select

func (ttuo *TweetTagUpdateOne) Select(field string, fields ...string) *TweetTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TweetTagUpdateOne) SetAddedAt

func (ttuo *TweetTagUpdateOne) SetAddedAt(t time.Time) *TweetTagUpdateOne

SetAddedAt sets the "added_at" field.

func (*TweetTagUpdateOne) SetNillableAddedAt

func (ttuo *TweetTagUpdateOne) SetNillableAddedAt(t *time.Time) *TweetTagUpdateOne

SetNillableAddedAt sets the "added_at" field if the given value is not nil.

func (*TweetTagUpdateOne) SetTag

func (ttuo *TweetTagUpdateOne) SetTag(t *Tag) *TweetTagUpdateOne

SetTag sets the "tag" edge to the Tag entity.

func (*TweetTagUpdateOne) SetTagID

func (ttuo *TweetTagUpdateOne) SetTagID(i int) *TweetTagUpdateOne

SetTagID sets the "tag_id" field.

func (*TweetTagUpdateOne) SetTweet

func (ttuo *TweetTagUpdateOne) SetTweet(t *Tweet) *TweetTagUpdateOne

SetTweet sets the "tweet" edge to the Tweet entity.

func (*TweetTagUpdateOne) SetTweetID

func (ttuo *TweetTagUpdateOne) SetTweetID(i int) *TweetTagUpdateOne

SetTweetID sets the "tweet_id" field.

func (*TweetTagUpdateOne) Where added in v0.11.8

Where appends a list predicates to the TweetTagUpdate builder.

type TweetTagUpsert

type TweetTagUpsert struct {
	*sql.UpdateSet
}

TweetTagUpsert is the "OnConflict" setter.

func (*TweetTagUpsert) SetAddedAt

func (u *TweetTagUpsert) SetAddedAt(v time.Time) *TweetTagUpsert

SetAddedAt sets the "added_at" field.

func (*TweetTagUpsert) SetTagID

func (u *TweetTagUpsert) SetTagID(v int) *TweetTagUpsert

SetTagID sets the "tag_id" field.

func (*TweetTagUpsert) SetTweetID

func (u *TweetTagUpsert) SetTweetID(v int) *TweetTagUpsert

SetTweetID sets the "tweet_id" field.

func (*TweetTagUpsert) UpdateAddedAt

func (u *TweetTagUpsert) UpdateAddedAt() *TweetTagUpsert

UpdateAddedAt sets the "added_at" field to the value that was provided on create.

func (*TweetTagUpsert) UpdateTagID

func (u *TweetTagUpsert) UpdateTagID() *TweetTagUpsert

UpdateTagID sets the "tag_id" field to the value that was provided on create.

func (*TweetTagUpsert) UpdateTweetID

func (u *TweetTagUpsert) UpdateTweetID() *TweetTagUpsert

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

type TweetTagUpsertBulk

type TweetTagUpsertBulk struct {
	// contains filtered or unexported fields
}

TweetTagUpsertBulk is the builder for "upsert"-ing a bulk of TweetTag nodes.

func (*TweetTagUpsertBulk) DoNothing

func (u *TweetTagUpsertBulk) DoNothing() *TweetTagUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TweetTagUpsertBulk) Exec

func (u *TweetTagUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetTagUpsertBulk) ExecX

func (u *TweetTagUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.TweetTag.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TweetTagUpsertBulk) SetAddedAt

func (u *TweetTagUpsertBulk) SetAddedAt(v time.Time) *TweetTagUpsertBulk

SetAddedAt sets the "added_at" field.

func (*TweetTagUpsertBulk) SetTagID

func (u *TweetTagUpsertBulk) SetTagID(v int) *TweetTagUpsertBulk

SetTagID sets the "tag_id" field.

func (*TweetTagUpsertBulk) SetTweetID

func (u *TweetTagUpsertBulk) SetTweetID(v int) *TweetTagUpsertBulk

SetTweetID sets the "tweet_id" field.

func (*TweetTagUpsertBulk) Update

func (u *TweetTagUpsertBulk) Update(set func(*TweetTagUpsert)) *TweetTagUpsertBulk

Update allows overriding fields `UPDATE` values. See the TweetTagCreateBulk.OnConflict documentation for more info.

func (*TweetTagUpsertBulk) UpdateAddedAt

func (u *TweetTagUpsertBulk) UpdateAddedAt() *TweetTagUpsertBulk

UpdateAddedAt sets the "added_at" field to the value that was provided on create.

func (*TweetTagUpsertBulk) UpdateNewValues

func (u *TweetTagUpsertBulk) UpdateNewValues() *TweetTagUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.TweetTag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(tweettag.FieldID)
		}),
	).
	Exec(ctx)

func (*TweetTagUpsertBulk) UpdateTagID

func (u *TweetTagUpsertBulk) UpdateTagID() *TweetTagUpsertBulk

UpdateTagID sets the "tag_id" field to the value that was provided on create.

func (*TweetTagUpsertBulk) UpdateTweetID

func (u *TweetTagUpsertBulk) UpdateTweetID() *TweetTagUpsertBulk

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

type TweetTagUpsertOne

type TweetTagUpsertOne struct {
	// contains filtered or unexported fields
}

TweetTagUpsertOne is the builder for "upsert"-ing

one TweetTag node.

func (*TweetTagUpsertOne) DoNothing

func (u *TweetTagUpsertOne) DoNothing() *TweetTagUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TweetTagUpsertOne) Exec

func (u *TweetTagUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetTagUpsertOne) ExecX

func (u *TweetTagUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetTagUpsertOne) ID

func (u *TweetTagUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TweetTagUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*TweetTagUpsertOne) Ignore

func (u *TweetTagUpsertOne) Ignore() *TweetTagUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.TweetTag.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TweetTagUpsertOne) SetAddedAt

func (u *TweetTagUpsertOne) SetAddedAt(v time.Time) *TweetTagUpsertOne

SetAddedAt sets the "added_at" field.

func (*TweetTagUpsertOne) SetTagID

func (u *TweetTagUpsertOne) SetTagID(v int) *TweetTagUpsertOne

SetTagID sets the "tag_id" field.

func (*TweetTagUpsertOne) SetTweetID

func (u *TweetTagUpsertOne) SetTweetID(v int) *TweetTagUpsertOne

SetTweetID sets the "tweet_id" field.

func (*TweetTagUpsertOne) Update

func (u *TweetTagUpsertOne) Update(set func(*TweetTagUpsert)) *TweetTagUpsertOne

Update allows overriding fields `UPDATE` values. See the TweetTagCreate.OnConflict documentation for more info.

func (*TweetTagUpsertOne) UpdateAddedAt

func (u *TweetTagUpsertOne) UpdateAddedAt() *TweetTagUpsertOne

UpdateAddedAt sets the "added_at" field to the value that was provided on create.

func (*TweetTagUpsertOne) UpdateNewValues

func (u *TweetTagUpsertOne) UpdateNewValues() *TweetTagUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.TweetTag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(tweettag.FieldID)
		}),
	).
	Exec(ctx)

func (*TweetTagUpsertOne) UpdateTagID

func (u *TweetTagUpsertOne) UpdateTagID() *TweetTagUpsertOne

UpdateTagID sets the "tag_id" field to the value that was provided on create.

func (*TweetTagUpsertOne) UpdateTweetID

func (u *TweetTagUpsertOne) UpdateTweetID() *TweetTagUpsertOne

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

type TweetTags

type TweetTags []*TweetTag

TweetTags is a parsable slice of TweetTag.

type TweetUpdate

type TweetUpdate struct {
	// contains filtered or unexported fields
}

TweetUpdate is the builder for updating Tweet entities.

func (*TweetUpdate) AddLikedUserIDs

func (tu *TweetUpdate) AddLikedUserIDs(ids ...int) *TweetUpdate

AddLikedUserIDs adds the "liked_users" edge to the User entity by IDs.

func (*TweetUpdate) AddLikedUsers

func (tu *TweetUpdate) AddLikedUsers(u ...*User) *TweetUpdate

AddLikedUsers adds the "liked_users" edges to the User entity.

func (*TweetUpdate) AddTagIDs

func (tu *TweetUpdate) AddTagIDs(ids ...int) *TweetUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*TweetUpdate) AddTags

func (tu *TweetUpdate) AddTags(t ...*Tag) *TweetUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*TweetUpdate) AddTweetTagIDs

func (tu *TweetUpdate) AddTweetTagIDs(ids ...uuid.UUID) *TweetUpdate

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TweetUpdate) AddTweetTags

func (tu *TweetUpdate) AddTweetTags(t ...*TweetTag) *TweetUpdate

AddTweetTags adds the "tweet_tags" edges to the TweetTag entity.

func (*TweetUpdate) AddTweetUser

func (tu *TweetUpdate) AddTweetUser(u ...*UserTweet) *TweetUpdate

AddTweetUser adds the "tweet_user" edges to the UserTweet entity.

func (*TweetUpdate) AddTweetUserIDs

func (tu *TweetUpdate) AddTweetUserIDs(ids ...int) *TweetUpdate

AddTweetUserIDs adds the "tweet_user" edge to the UserTweet entity by IDs.

func (*TweetUpdate) AddUser

func (tu *TweetUpdate) AddUser(u ...*User) *TweetUpdate

AddUser adds the "user" edges to the User entity.

func (*TweetUpdate) AddUserIDs

func (tu *TweetUpdate) AddUserIDs(ids ...int) *TweetUpdate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*TweetUpdate) ClearLikedUsers

func (tu *TweetUpdate) ClearLikedUsers() *TweetUpdate

ClearLikedUsers clears all "liked_users" edges to the User entity.

func (*TweetUpdate) ClearTags

func (tu *TweetUpdate) ClearTags() *TweetUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*TweetUpdate) ClearTweetTags

func (tu *TweetUpdate) ClearTweetTags() *TweetUpdate

ClearTweetTags clears all "tweet_tags" edges to the TweetTag entity.

func (*TweetUpdate) ClearTweetUser

func (tu *TweetUpdate) ClearTweetUser() *TweetUpdate

ClearTweetUser clears all "tweet_user" edges to the UserTweet entity.

func (*TweetUpdate) ClearUser

func (tu *TweetUpdate) ClearUser() *TweetUpdate

ClearUser clears all "user" edges to the User entity.

func (*TweetUpdate) Exec

func (tu *TweetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetUpdate) ExecX

func (tu *TweetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetUpdate) Mutation

func (tu *TweetUpdate) Mutation() *TweetMutation

Mutation returns the TweetMutation object of the builder.

func (*TweetUpdate) RemoveLikedUserIDs

func (tu *TweetUpdate) RemoveLikedUserIDs(ids ...int) *TweetUpdate

RemoveLikedUserIDs removes the "liked_users" edge to User entities by IDs.

func (*TweetUpdate) RemoveLikedUsers

func (tu *TweetUpdate) RemoveLikedUsers(u ...*User) *TweetUpdate

RemoveLikedUsers removes "liked_users" edges to User entities.

func (*TweetUpdate) RemoveTagIDs

func (tu *TweetUpdate) RemoveTagIDs(ids ...int) *TweetUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*TweetUpdate) RemoveTags

func (tu *TweetUpdate) RemoveTags(t ...*Tag) *TweetUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*TweetUpdate) RemoveTweetTagIDs

func (tu *TweetUpdate) RemoveTweetTagIDs(ids ...uuid.UUID) *TweetUpdate

RemoveTweetTagIDs removes the "tweet_tags" edge to TweetTag entities by IDs.

func (*TweetUpdate) RemoveTweetTags

func (tu *TweetUpdate) RemoveTweetTags(t ...*TweetTag) *TweetUpdate

RemoveTweetTags removes "tweet_tags" edges to TweetTag entities.

func (*TweetUpdate) RemoveTweetUser

func (tu *TweetUpdate) RemoveTweetUser(u ...*UserTweet) *TweetUpdate

RemoveTweetUser removes "tweet_user" edges to UserTweet entities.

func (*TweetUpdate) RemoveTweetUserIDs

func (tu *TweetUpdate) RemoveTweetUserIDs(ids ...int) *TweetUpdate

RemoveTweetUserIDs removes the "tweet_user" edge to UserTweet entities by IDs.

func (*TweetUpdate) RemoveUser

func (tu *TweetUpdate) RemoveUser(u ...*User) *TweetUpdate

RemoveUser removes "user" edges to User entities.

func (*TweetUpdate) RemoveUserIDs

func (tu *TweetUpdate) RemoveUserIDs(ids ...int) *TweetUpdate

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*TweetUpdate) Save

func (tu *TweetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TweetUpdate) SaveX

func (tu *TweetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TweetUpdate) SetText

func (tu *TweetUpdate) SetText(s string) *TweetUpdate

SetText sets the "text" field.

func (*TweetUpdate) Where

func (tu *TweetUpdate) Where(ps ...predicate.Tweet) *TweetUpdate

Where appends a list predicates to the TweetUpdate builder.

type TweetUpdateOne

type TweetUpdateOne struct {
	// contains filtered or unexported fields
}

TweetUpdateOne is the builder for updating a single Tweet entity.

func (*TweetUpdateOne) AddLikedUserIDs

func (tuo *TweetUpdateOne) AddLikedUserIDs(ids ...int) *TweetUpdateOne

AddLikedUserIDs adds the "liked_users" edge to the User entity by IDs.

func (*TweetUpdateOne) AddLikedUsers

func (tuo *TweetUpdateOne) AddLikedUsers(u ...*User) *TweetUpdateOne

AddLikedUsers adds the "liked_users" edges to the User entity.

func (*TweetUpdateOne) AddTagIDs

func (tuo *TweetUpdateOne) AddTagIDs(ids ...int) *TweetUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*TweetUpdateOne) AddTags

func (tuo *TweetUpdateOne) AddTags(t ...*Tag) *TweetUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*TweetUpdateOne) AddTweetTagIDs

func (tuo *TweetUpdateOne) AddTweetTagIDs(ids ...uuid.UUID) *TweetUpdateOne

AddTweetTagIDs adds the "tweet_tags" edge to the TweetTag entity by IDs.

func (*TweetUpdateOne) AddTweetTags

func (tuo *TweetUpdateOne) AddTweetTags(t ...*TweetTag) *TweetUpdateOne

AddTweetTags adds the "tweet_tags" edges to the TweetTag entity.

func (*TweetUpdateOne) AddTweetUser

func (tuo *TweetUpdateOne) AddTweetUser(u ...*UserTweet) *TweetUpdateOne

AddTweetUser adds the "tweet_user" edges to the UserTweet entity.

func (*TweetUpdateOne) AddTweetUserIDs

func (tuo *TweetUpdateOne) AddTweetUserIDs(ids ...int) *TweetUpdateOne

AddTweetUserIDs adds the "tweet_user" edge to the UserTweet entity by IDs.

func (*TweetUpdateOne) AddUser

func (tuo *TweetUpdateOne) AddUser(u ...*User) *TweetUpdateOne

AddUser adds the "user" edges to the User entity.

func (*TweetUpdateOne) AddUserIDs

func (tuo *TweetUpdateOne) AddUserIDs(ids ...int) *TweetUpdateOne

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*TweetUpdateOne) ClearLikedUsers

func (tuo *TweetUpdateOne) ClearLikedUsers() *TweetUpdateOne

ClearLikedUsers clears all "liked_users" edges to the User entity.

func (*TweetUpdateOne) ClearTags

func (tuo *TweetUpdateOne) ClearTags() *TweetUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*TweetUpdateOne) ClearTweetTags

func (tuo *TweetUpdateOne) ClearTweetTags() *TweetUpdateOne

ClearTweetTags clears all "tweet_tags" edges to the TweetTag entity.

func (*TweetUpdateOne) ClearTweetUser

func (tuo *TweetUpdateOne) ClearTweetUser() *TweetUpdateOne

ClearTweetUser clears all "tweet_user" edges to the UserTweet entity.

func (*TweetUpdateOne) ClearUser

func (tuo *TweetUpdateOne) ClearUser() *TweetUpdateOne

ClearUser clears all "user" edges to the User entity.

func (*TweetUpdateOne) Exec

func (tuo *TweetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TweetUpdateOne) ExecX

func (tuo *TweetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetUpdateOne) Mutation

func (tuo *TweetUpdateOne) Mutation() *TweetMutation

Mutation returns the TweetMutation object of the builder.

func (*TweetUpdateOne) RemoveLikedUserIDs

func (tuo *TweetUpdateOne) RemoveLikedUserIDs(ids ...int) *TweetUpdateOne

RemoveLikedUserIDs removes the "liked_users" edge to User entities by IDs.

func (*TweetUpdateOne) RemoveLikedUsers

func (tuo *TweetUpdateOne) RemoveLikedUsers(u ...*User) *TweetUpdateOne

RemoveLikedUsers removes "liked_users" edges to User entities.

func (*TweetUpdateOne) RemoveTagIDs

func (tuo *TweetUpdateOne) RemoveTagIDs(ids ...int) *TweetUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*TweetUpdateOne) RemoveTags

func (tuo *TweetUpdateOne) RemoveTags(t ...*Tag) *TweetUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*TweetUpdateOne) RemoveTweetTagIDs

func (tuo *TweetUpdateOne) RemoveTweetTagIDs(ids ...uuid.UUID) *TweetUpdateOne

RemoveTweetTagIDs removes the "tweet_tags" edge to TweetTag entities by IDs.

func (*TweetUpdateOne) RemoveTweetTags

func (tuo *TweetUpdateOne) RemoveTweetTags(t ...*TweetTag) *TweetUpdateOne

RemoveTweetTags removes "tweet_tags" edges to TweetTag entities.

func (*TweetUpdateOne) RemoveTweetUser

func (tuo *TweetUpdateOne) RemoveTweetUser(u ...*UserTweet) *TweetUpdateOne

RemoveTweetUser removes "tweet_user" edges to UserTweet entities.

func (*TweetUpdateOne) RemoveTweetUserIDs

func (tuo *TweetUpdateOne) RemoveTweetUserIDs(ids ...int) *TweetUpdateOne

RemoveTweetUserIDs removes the "tweet_user" edge to UserTweet entities by IDs.

func (*TweetUpdateOne) RemoveUser

func (tuo *TweetUpdateOne) RemoveUser(u ...*User) *TweetUpdateOne

RemoveUser removes "user" edges to User entities.

func (*TweetUpdateOne) RemoveUserIDs

func (tuo *TweetUpdateOne) RemoveUserIDs(ids ...int) *TweetUpdateOne

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*TweetUpdateOne) Save

func (tuo *TweetUpdateOne) Save(ctx context.Context) (*Tweet, error)

Save executes the query and returns the updated Tweet entity.

func (*TweetUpdateOne) SaveX

func (tuo *TweetUpdateOne) SaveX(ctx context.Context) *Tweet

SaveX is like Save, but panics if an error occurs.

func (*TweetUpdateOne) Select

func (tuo *TweetUpdateOne) Select(field string, fields ...string) *TweetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TweetUpdateOne) SetText

func (tuo *TweetUpdateOne) SetText(s string) *TweetUpdateOne

SetText sets the "text" field.

func (*TweetUpdateOne) Where added in v0.11.8

func (tuo *TweetUpdateOne) Where(ps ...predicate.Tweet) *TweetUpdateOne

Where appends a list predicates to the TweetUpdate builder.

type TweetUpsert

type TweetUpsert struct {
	*sql.UpdateSet
}

TweetUpsert is the "OnConflict" setter.

func (*TweetUpsert) SetText

func (u *TweetUpsert) SetText(v string) *TweetUpsert

SetText sets the "text" field.

func (*TweetUpsert) UpdateText

func (u *TweetUpsert) UpdateText() *TweetUpsert

UpdateText sets the "text" field to the value that was provided on create.

type TweetUpsertBulk

type TweetUpsertBulk struct {
	// contains filtered or unexported fields
}

TweetUpsertBulk is the builder for "upsert"-ing a bulk of Tweet nodes.

func (*TweetUpsertBulk) DoNothing

func (u *TweetUpsertBulk) DoNothing() *TweetUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TweetUpsertBulk) Exec

func (u *TweetUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetUpsertBulk) ExecX

func (u *TweetUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetUpsertBulk) Ignore

func (u *TweetUpsertBulk) Ignore() *TweetUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tweet.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TweetUpsertBulk) SetText

func (u *TweetUpsertBulk) SetText(v string) *TweetUpsertBulk

SetText sets the "text" field.

func (*TweetUpsertBulk) Update

func (u *TweetUpsertBulk) Update(set func(*TweetUpsert)) *TweetUpsertBulk

Update allows overriding fields `UPDATE` values. See the TweetCreateBulk.OnConflict documentation for more info.

func (*TweetUpsertBulk) UpdateNewValues

func (u *TweetUpsertBulk) UpdateNewValues() *TweetUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tweet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TweetUpsertBulk) UpdateText

func (u *TweetUpsertBulk) UpdateText() *TweetUpsertBulk

UpdateText sets the "text" field to the value that was provided on create.

type TweetUpsertOne

type TweetUpsertOne struct {
	// contains filtered or unexported fields
}

TweetUpsertOne is the builder for "upsert"-ing

one Tweet node.

func (*TweetUpsertOne) DoNothing

func (u *TweetUpsertOne) DoNothing() *TweetUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TweetUpsertOne) Exec

func (u *TweetUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TweetUpsertOne) ExecX

func (u *TweetUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TweetUpsertOne) ID

func (u *TweetUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TweetUpsertOne) IDX

func (u *TweetUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*TweetUpsertOne) Ignore

func (u *TweetUpsertOne) Ignore() *TweetUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tweet.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TweetUpsertOne) SetText

func (u *TweetUpsertOne) SetText(v string) *TweetUpsertOne

SetText sets the "text" field.

func (*TweetUpsertOne) Update

func (u *TweetUpsertOne) Update(set func(*TweetUpsert)) *TweetUpsertOne

Update allows overriding fields `UPDATE` values. See the TweetCreate.OnConflict documentation for more info.

func (*TweetUpsertOne) UpdateNewValues

func (u *TweetUpsertOne) UpdateNewValues() *TweetUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tweet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TweetUpsertOne) UpdateText

func (u *TweetUpsertOne) UpdateText() *TweetUpsertOne

UpdateText sets the "text" field to the value that was provided on create.

type Tweets

type Tweets []*Tweet

Tweets is a parsable slice of Tweet.

type Tx

type Tx struct {

	// AttachedFile is the client for interacting with the AttachedFile builders.
	AttachedFile *AttachedFileClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Friendship is the client for interacting with the Friendship builders.
	Friendship *FriendshipClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupTag is the client for interacting with the GroupTag builders.
	GroupTag *GroupTagClient
	// Process is the client for interacting with the Process builders.
	Process *ProcessClient
	// Relationship is the client for interacting with the Relationship builders.
	Relationship *RelationshipClient
	// RelationshipInfo is the client for interacting with the RelationshipInfo builders.
	RelationshipInfo *RelationshipInfoClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// RoleUser is the client for interacting with the RoleUser builders.
	RoleUser *RoleUserClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// Tweet is the client for interacting with the Tweet builders.
	Tweet *TweetClient
	// TweetLike is the client for interacting with the TweetLike builders.
	TweetLike *TweetLikeClient
	// TweetTag is the client for interacting with the TweetTag builders.
	TweetTag *TweetTagClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserGroup is the client for interacting with the UserGroup builders.
	UserGroup *UserGroupClient
	// UserTweet is the client for interacting with the UserTweet builders.
	UserTweet *UserTweetClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryFriends

func (u *User) QueryFriends() *UserQuery

QueryFriends queries the "friends" edge of the User entity.

func (*User) QueryFriendships

func (u *User) QueryFriendships() *FriendshipQuery

QueryFriendships queries the "friendships" edge of the User entity.

func (*User) QueryGroups

func (u *User) QueryGroups() *GroupQuery

QueryGroups queries the "groups" edge of the User entity.

func (*User) QueryJoinedGroups

func (u *User) QueryJoinedGroups() *UserGroupQuery

QueryJoinedGroups queries the "joined_groups" edge of the User entity.

func (*User) QueryLikedTweets

func (u *User) QueryLikedTweets() *TweetQuery

QueryLikedTweets queries the "liked_tweets" edge of the User entity.

func (*User) QueryLikes

func (u *User) QueryLikes() *TweetLikeQuery

QueryLikes queries the "likes" edge of the User entity.

func (*User) QueryRelationship

func (u *User) QueryRelationship() *RelationshipQuery

QueryRelationship queries the "relationship" edge of the User entity.

func (*User) QueryRelatives

func (u *User) QueryRelatives() *UserQuery

QueryRelatives queries the "relatives" edge of the User entity.

func (*User) QueryRoles added in v0.11.1

func (u *User) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the User entity.

func (*User) QueryRolesUsers added in v0.11.1

func (u *User) QueryRolesUsers() *RoleUserQuery

QueryRolesUsers queries the "roles_users" edge of the User entity.

func (*User) QueryTweets

func (u *User) QueryTweets() *TweetQuery

QueryTweets queries the "tweets" edge of the User entity.

func (*User) QueryUserTweets

func (u *User) QueryUserTweets() *UserTweetQuery

QueryUserTweets queries the "user_tweets" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept added in v0.11.5

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors added in v0.11.5

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryFriends

func (c *UserClient) QueryFriends(u *User) *UserQuery

QueryFriends queries the friends edge of a User.

func (*UserClient) QueryFriendships

func (c *UserClient) QueryFriendships(u *User) *FriendshipQuery

QueryFriendships queries the friendships edge of a User.

func (*UserClient) QueryGroups

func (c *UserClient) QueryGroups(u *User) *GroupQuery

QueryGroups queries the groups edge of a User.

func (*UserClient) QueryJoinedGroups

func (c *UserClient) QueryJoinedGroups(u *User) *UserGroupQuery

QueryJoinedGroups queries the joined_groups edge of a User.

func (*UserClient) QueryLikedTweets

func (c *UserClient) QueryLikedTweets(u *User) *TweetQuery

QueryLikedTweets queries the liked_tweets edge of a User.

func (*UserClient) QueryLikes

func (c *UserClient) QueryLikes(u *User) *TweetLikeQuery

QueryLikes queries the likes edge of a User.

func (*UserClient) QueryRelationship

func (c *UserClient) QueryRelationship(u *User) *RelationshipQuery

QueryRelationship queries the relationship edge of a User.

func (*UserClient) QueryRelatives

func (c *UserClient) QueryRelatives(u *User) *UserQuery

QueryRelatives queries the relatives edge of a User.

func (*UserClient) QueryRoles added in v0.11.1

func (c *UserClient) QueryRoles(u *User) *RoleQuery

QueryRoles queries the roles edge of a User.

func (*UserClient) QueryRolesUsers added in v0.11.1

func (c *UserClient) QueryRolesUsers(u *User) *RoleUserQuery

QueryRolesUsers queries the roles_users edge of a User.

func (*UserClient) QueryTweets

func (c *UserClient) QueryTweets(u *User) *TweetQuery

QueryTweets queries the tweets edge of a User.

func (*UserClient) QueryUserTweets

func (c *UserClient) QueryUserTweets(u *User) *UserTweetQuery

QueryUserTweets queries the user_tweets edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddFriendIDs

func (uc *UserCreate) AddFriendIDs(ids ...int) *UserCreate

AddFriendIDs adds the "friends" edge to the User entity by IDs.

func (*UserCreate) AddFriends

func (uc *UserCreate) AddFriends(u ...*User) *UserCreate

AddFriends adds the "friends" edges to the User entity.

func (*UserCreate) AddFriendshipIDs

func (uc *UserCreate) AddFriendshipIDs(ids ...int) *UserCreate

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.

func (*UserCreate) AddFriendships

func (uc *UserCreate) AddFriendships(f ...*Friendship) *UserCreate

AddFriendships adds the "friendships" edges to the Friendship entity.

func (*UserCreate) AddGroupIDs

func (uc *UserCreate) AddGroupIDs(ids ...int) *UserCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserCreate) AddGroups

func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate

AddGroups adds the "groups" edges to the Group entity.

func (*UserCreate) AddJoinedGroupIDs

func (uc *UserCreate) AddJoinedGroupIDs(ids ...int) *UserCreate

AddJoinedGroupIDs adds the "joined_groups" edge to the UserGroup entity by IDs.

func (*UserCreate) AddJoinedGroups

func (uc *UserCreate) AddJoinedGroups(u ...*UserGroup) *UserCreate

AddJoinedGroups adds the "joined_groups" edges to the UserGroup entity.

func (*UserCreate) AddLikedTweetIDs

func (uc *UserCreate) AddLikedTweetIDs(ids ...int) *UserCreate

AddLikedTweetIDs adds the "liked_tweets" edge to the Tweet entity by IDs.

func (*UserCreate) AddLikedTweets

func (uc *UserCreate) AddLikedTweets(t ...*Tweet) *UserCreate

AddLikedTweets adds the "liked_tweets" edges to the Tweet entity.

func (*UserCreate) AddRelativeIDs

func (uc *UserCreate) AddRelativeIDs(ids ...int) *UserCreate

AddRelativeIDs adds the "relatives" edge to the User entity by IDs.

func (*UserCreate) AddRelatives

func (uc *UserCreate) AddRelatives(u ...*User) *UserCreate

AddRelatives adds the "relatives" edges to the User entity.

func (*UserCreate) AddRoleIDs added in v0.11.1

func (uc *UserCreate) AddRoleIDs(ids ...int) *UserCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserCreate) AddRoles added in v0.11.1

func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate

AddRoles adds the "roles" edges to the Role entity.

func (*UserCreate) AddTweetIDs

func (uc *UserCreate) AddTweetIDs(ids ...int) *UserCreate

AddTweetIDs adds the "tweets" edge to the Tweet entity by IDs.

func (*UserCreate) AddTweets

func (uc *UserCreate) AddTweets(t ...*Tweet) *UserCreate

AddTweets adds the "tweets" edges to the Tweet entity.

func (*UserCreate) AddUserTweetIDs

func (uc *UserCreate) AddUserTweetIDs(ids ...int) *UserCreate

AddUserTweetIDs adds the "user_tweets" edge to the UserTweet entity by IDs.

func (*UserCreate) AddUserTweets

func (uc *UserCreate) AddUserTweets(u ...*UserTweet) *UserCreate

AddUserTweets adds the "user_tweets" edges to the UserTweet entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableName

func (uc *UserCreate) SetNillableName(s *string) *UserCreate

SetNillableName sets the "name" field if the given value is not nil.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where added in v0.11.7

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Groups holds the value of the groups edge.
	Groups []*Group `json:"groups,omitempty"`
	// Friends holds the value of the friends edge.
	Friends []*User `json:"friends,omitempty"`
	// Relatives holds the value of the relatives edge.
	Relatives []*User `json:"relatives,omitempty"`
	// LikedTweets holds the value of the liked_tweets edge.
	LikedTweets []*Tweet `json:"liked_tweets,omitempty"`
	// Tweets holds the value of the tweets edge.
	Tweets []*Tweet `json:"tweets,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// JoinedGroups holds the value of the joined_groups edge.
	JoinedGroups []*UserGroup `json:"joined_groups,omitempty"`
	// Friendships holds the value of the friendships edge.
	Friendships []*Friendship `json:"friendships,omitempty"`
	// Relationship holds the value of the relationship edge.
	Relationship []*Relationship `json:"relationship,omitempty"`
	// Likes holds the value of the likes edge.
	Likes []*TweetLike `json:"likes,omitempty"`
	// UserTweets holds the value of the user_tweets edge.
	UserTweets []*UserTweet `json:"user_tweets,omitempty"`
	// RolesUsers holds the value of the roles_users edge.
	RolesUsers []*RoleUser `json:"roles_users,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) FriendsOrErr

func (e UserEdges) FriendsOrErr() ([]*User, error)

FriendsOrErr returns the Friends value or an error if the edge was not loaded in eager-loading.

func (UserEdges) FriendshipsOrErr

func (e UserEdges) FriendshipsOrErr() ([]*Friendship, error)

FriendshipsOrErr returns the Friendships value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroupsOrErr

func (e UserEdges) GroupsOrErr() ([]*Group, error)

GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.

func (UserEdges) JoinedGroupsOrErr

func (e UserEdges) JoinedGroupsOrErr() ([]*UserGroup, error)

JoinedGroupsOrErr returns the JoinedGroups value or an error if the edge was not loaded in eager-loading.

func (UserEdges) LikedTweetsOrErr

func (e UserEdges) LikedTweetsOrErr() ([]*Tweet, error)

LikedTweetsOrErr returns the LikedTweets value or an error if the edge was not loaded in eager-loading.

func (UserEdges) LikesOrErr

func (e UserEdges) LikesOrErr() ([]*TweetLike, error)

LikesOrErr returns the Likes value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RelationshipOrErr

func (e UserEdges) RelationshipOrErr() ([]*Relationship, error)

RelationshipOrErr returns the Relationship value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RelativesOrErr

func (e UserEdges) RelativesOrErr() ([]*User, error)

RelativesOrErr returns the Relatives value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RolesOrErr added in v0.11.1

func (e UserEdges) RolesOrErr() ([]*Role, error)

RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RolesUsersOrErr added in v0.11.1

func (e UserEdges) RolesUsersOrErr() ([]*RoleUser, error)

RolesUsersOrErr returns the RolesUsers value or an error if the edge was not loaded in eager-loading.

func (UserEdges) TweetsOrErr

func (e UserEdges) TweetsOrErr() ([]*Tweet, error)

TweetsOrErr returns the Tweets value or an error if the edge was not loaded in eager-loading.

func (UserEdges) UserTweetsOrErr

func (e UserEdges) UserTweetsOrErr() ([]*UserTweet, error)

UserTweetsOrErr returns the UserTweets value or an error if the edge was not loaded in eager-loading.

type UserFilter added in v0.11.2

type UserFilter struct {
	// contains filtered or unexported fields
}

UserFilter provides a generic filtering capability at runtime for UserQuery.

func (*UserFilter) Where added in v0.11.2

func (f *UserFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*UserFilter) WhereHasFriends added in v0.11.2

func (f *UserFilter) WhereHasFriends()

WhereHasFriends applies a predicate to check if query has an edge friends.

func (*UserFilter) WhereHasFriendsWith added in v0.11.2

func (f *UserFilter) WhereHasFriendsWith(preds ...predicate.User)

WhereHasFriendsWith applies a predicate to check if query has an edge friends with a given conditions (other predicates).

func (*UserFilter) WhereHasFriendships added in v0.11.2

func (f *UserFilter) WhereHasFriendships()

WhereHasFriendships applies a predicate to check if query has an edge friendships.

func (*UserFilter) WhereHasFriendshipsWith added in v0.11.2

func (f *UserFilter) WhereHasFriendshipsWith(preds ...predicate.Friendship)

WhereHasFriendshipsWith applies a predicate to check if query has an edge friendships with a given conditions (other predicates).

func (*UserFilter) WhereHasGroups added in v0.11.2

func (f *UserFilter) WhereHasGroups()

WhereHasGroups applies a predicate to check if query has an edge groups.

func (*UserFilter) WhereHasGroupsWith added in v0.11.2

func (f *UserFilter) WhereHasGroupsWith(preds ...predicate.Group)

WhereHasGroupsWith applies a predicate to check if query has an edge groups with a given conditions (other predicates).

func (*UserFilter) WhereHasJoinedGroups added in v0.11.2

func (f *UserFilter) WhereHasJoinedGroups()

WhereHasJoinedGroups applies a predicate to check if query has an edge joined_groups.

func (*UserFilter) WhereHasJoinedGroupsWith added in v0.11.2

func (f *UserFilter) WhereHasJoinedGroupsWith(preds ...predicate.UserGroup)

WhereHasJoinedGroupsWith applies a predicate to check if query has an edge joined_groups with a given conditions (other predicates).

func (*UserFilter) WhereHasLikedTweets added in v0.11.2

func (f *UserFilter) WhereHasLikedTweets()

WhereHasLikedTweets applies a predicate to check if query has an edge liked_tweets.

func (*UserFilter) WhereHasLikedTweetsWith added in v0.11.2

func (f *UserFilter) WhereHasLikedTweetsWith(preds ...predicate.Tweet)

WhereHasLikedTweetsWith applies a predicate to check if query has an edge liked_tweets with a given conditions (other predicates).

func (*UserFilter) WhereHasLikes added in v0.11.2

func (f *UserFilter) WhereHasLikes()

WhereHasLikes applies a predicate to check if query has an edge likes.

func (*UserFilter) WhereHasLikesWith added in v0.11.2

func (f *UserFilter) WhereHasLikesWith(preds ...predicate.TweetLike)

WhereHasLikesWith applies a predicate to check if query has an edge likes with a given conditions (other predicates).

func (*UserFilter) WhereHasRelationship added in v0.11.2

func (f *UserFilter) WhereHasRelationship()

WhereHasRelationship applies a predicate to check if query has an edge relationship.

func (*UserFilter) WhereHasRelationshipWith added in v0.11.2

func (f *UserFilter) WhereHasRelationshipWith(preds ...predicate.Relationship)

WhereHasRelationshipWith applies a predicate to check if query has an edge relationship with a given conditions (other predicates).

func (*UserFilter) WhereHasRelatives added in v0.11.2

func (f *UserFilter) WhereHasRelatives()

WhereHasRelatives applies a predicate to check if query has an edge relatives.

func (*UserFilter) WhereHasRelativesWith added in v0.11.2

func (f *UserFilter) WhereHasRelativesWith(preds ...predicate.User)

WhereHasRelativesWith applies a predicate to check if query has an edge relatives with a given conditions (other predicates).

func (*UserFilter) WhereHasRoles added in v0.11.2

func (f *UserFilter) WhereHasRoles()

WhereHasRoles applies a predicate to check if query has an edge roles.

func (*UserFilter) WhereHasRolesUsers added in v0.11.2

func (f *UserFilter) WhereHasRolesUsers()

WhereHasRolesUsers applies a predicate to check if query has an edge roles_users.

func (*UserFilter) WhereHasRolesUsersWith added in v0.11.2

func (f *UserFilter) WhereHasRolesUsersWith(preds ...predicate.RoleUser)

WhereHasRolesUsersWith applies a predicate to check if query has an edge roles_users with a given conditions (other predicates).

func (*UserFilter) WhereHasRolesWith added in v0.11.2

func (f *UserFilter) WhereHasRolesWith(preds ...predicate.Role)

WhereHasRolesWith applies a predicate to check if query has an edge roles with a given conditions (other predicates).

func (*UserFilter) WhereHasTweets added in v0.11.2

func (f *UserFilter) WhereHasTweets()

WhereHasTweets applies a predicate to check if query has an edge tweets.

func (*UserFilter) WhereHasTweetsWith added in v0.11.2

func (f *UserFilter) WhereHasTweetsWith(preds ...predicate.Tweet)

WhereHasTweetsWith applies a predicate to check if query has an edge tweets with a given conditions (other predicates).

func (*UserFilter) WhereHasUserTweets added in v0.11.2

func (f *UserFilter) WhereHasUserTweets()

WhereHasUserTweets applies a predicate to check if query has an edge user_tweets.

func (*UserFilter) WhereHasUserTweetsWith added in v0.11.2

func (f *UserFilter) WhereHasUserTweetsWith(preds ...predicate.UserTweet)

WhereHasUserTweetsWith applies a predicate to check if query has an edge user_tweets with a given conditions (other predicates).

func (*UserFilter) WhereID added in v0.11.2

func (f *UserFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*UserFilter) WhereName added in v0.11.2

func (f *UserFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

type UserGroup

type UserGroup struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// JoinedAt holds the value of the "joined_at" field.
	JoinedAt time.Time `json:"joined_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// GroupID holds the value of the "group_id" field.
	GroupID int `json:"group_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserGroupQuery when eager-loading is set.
	Edges UserGroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserGroup is the model entity for the UserGroup schema.

func (*UserGroup) QueryGroup

func (ug *UserGroup) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the UserGroup entity.

func (*UserGroup) QueryUser

func (ug *UserGroup) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserGroup entity.

func (*UserGroup) String

func (ug *UserGroup) String() string

String implements the fmt.Stringer.

func (*UserGroup) Unwrap

func (ug *UserGroup) Unwrap() *UserGroup

Unwrap unwraps the UserGroup 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 (*UserGroup) Update

func (ug *UserGroup) Update() *UserGroupUpdateOne

Update returns a builder for updating this UserGroup. Note that you need to call UserGroup.Unwrap() before calling this method if this UserGroup was returned from a transaction, and the transaction was committed or rolled back.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserGroupClient

type UserGroupClient struct {
	// contains filtered or unexported fields
}

UserGroupClient is a client for the UserGroup schema.

func NewUserGroupClient

func NewUserGroupClient(c config) *UserGroupClient

NewUserGroupClient returns a client for the UserGroup from the given config.

func (*UserGroupClient) Create

func (c *UserGroupClient) Create() *UserGroupCreate

Create returns a builder for creating a UserGroup entity.

func (*UserGroupClient) CreateBulk

func (c *UserGroupClient) CreateBulk(builders ...*UserGroupCreate) *UserGroupCreateBulk

CreateBulk returns a builder for creating a bulk of UserGroup entities.

func (*UserGroupClient) Delete

func (c *UserGroupClient) Delete() *UserGroupDelete

Delete returns a delete builder for UserGroup.

func (*UserGroupClient) DeleteOne

func (c *UserGroupClient) DeleteOne(ug *UserGroup) *UserGroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserGroupClient) DeleteOneID

func (c *UserGroupClient) DeleteOneID(id int) *UserGroupDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserGroupClient) Get

func (c *UserGroupClient) Get(ctx context.Context, id int) (*UserGroup, error)

Get returns a UserGroup entity by its id.

func (*UserGroupClient) GetX

func (c *UserGroupClient) GetX(ctx context.Context, id int) *UserGroup

GetX is like Get, but panics if an error occurs.

func (*UserGroupClient) Hooks

func (c *UserGroupClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserGroupClient) Intercept added in v0.11.5

func (c *UserGroupClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usergroup.Intercept(f(g(h())))`.

func (*UserGroupClient) Interceptors added in v0.11.5

func (c *UserGroupClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserGroupClient) Query

func (c *UserGroupClient) Query() *UserGroupQuery

Query returns a query builder for UserGroup.

func (*UserGroupClient) QueryGroup

func (c *UserGroupClient) QueryGroup(ug *UserGroup) *GroupQuery

QueryGroup queries the group edge of a UserGroup.

func (*UserGroupClient) QueryUser

func (c *UserGroupClient) QueryUser(ug *UserGroup) *UserQuery

QueryUser queries the user edge of a UserGroup.

func (*UserGroupClient) Update

func (c *UserGroupClient) Update() *UserGroupUpdate

Update returns an update builder for UserGroup.

func (*UserGroupClient) UpdateOne

func (c *UserGroupClient) UpdateOne(ug *UserGroup) *UserGroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserGroupClient) UpdateOneID

func (c *UserGroupClient) UpdateOneID(id int) *UserGroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserGroupClient) Use

func (c *UserGroupClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usergroup.Hooks(f(g(h())))`.

type UserGroupCreate

type UserGroupCreate struct {
	// contains filtered or unexported fields
}

UserGroupCreate is the builder for creating a UserGroup entity.

func (*UserGroupCreate) Exec

func (ugc *UserGroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupCreate) ExecX

func (ugc *UserGroupCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupCreate) Mutation

func (ugc *UserGroupCreate) Mutation() *UserGroupMutation

Mutation returns the UserGroupMutation object of the builder.

func (*UserGroupCreate) OnConflict

func (ugc *UserGroupCreate) OnConflict(opts ...sql.ConflictOption) *UserGroupUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserGroup.Create().
	SetJoinedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserGroupUpsert) {
		SetJoinedAt(v+v).
	}).
	Exec(ctx)

func (*UserGroupCreate) OnConflictColumns

func (ugc *UserGroupCreate) OnConflictColumns(columns ...string) *UserGroupUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserGroup.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserGroupCreate) Save

func (ugc *UserGroupCreate) Save(ctx context.Context) (*UserGroup, error)

Save creates the UserGroup in the database.

func (*UserGroupCreate) SaveX

func (ugc *UserGroupCreate) SaveX(ctx context.Context) *UserGroup

SaveX calls Save and panics if Save returns an error.

func (*UserGroupCreate) SetGroup

func (ugc *UserGroupCreate) SetGroup(g *Group) *UserGroupCreate

SetGroup sets the "group" edge to the Group entity.

func (*UserGroupCreate) SetGroupID

func (ugc *UserGroupCreate) SetGroupID(i int) *UserGroupCreate

SetGroupID sets the "group_id" field.

func (*UserGroupCreate) SetJoinedAt

func (ugc *UserGroupCreate) SetJoinedAt(t time.Time) *UserGroupCreate

SetJoinedAt sets the "joined_at" field.

func (*UserGroupCreate) SetNillableJoinedAt

func (ugc *UserGroupCreate) SetNillableJoinedAt(t *time.Time) *UserGroupCreate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserGroupCreate) SetUser

func (ugc *UserGroupCreate) SetUser(u *User) *UserGroupCreate

SetUser sets the "user" edge to the User entity.

func (*UserGroupCreate) SetUserID

func (ugc *UserGroupCreate) SetUserID(i int) *UserGroupCreate

SetUserID sets the "user_id" field.

type UserGroupCreateBulk

type UserGroupCreateBulk struct {
	// contains filtered or unexported fields
}

UserGroupCreateBulk is the builder for creating many UserGroup entities in bulk.

func (*UserGroupCreateBulk) Exec

func (ugcb *UserGroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupCreateBulk) ExecX

func (ugcb *UserGroupCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupCreateBulk) OnConflict

func (ugcb *UserGroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserGroupUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserGroup.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserGroupUpsert) {
		SetJoinedAt(v+v).
	}).
	Exec(ctx)

func (*UserGroupCreateBulk) OnConflictColumns

func (ugcb *UserGroupCreateBulk) OnConflictColumns(columns ...string) *UserGroupUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserGroup.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserGroupCreateBulk) Save

func (ugcb *UserGroupCreateBulk) Save(ctx context.Context) ([]*UserGroup, error)

Save creates the UserGroup entities in the database.

func (*UserGroupCreateBulk) SaveX

func (ugcb *UserGroupCreateBulk) SaveX(ctx context.Context) []*UserGroup

SaveX is like Save, but panics if an error occurs.

type UserGroupDelete

type UserGroupDelete struct {
	// contains filtered or unexported fields
}

UserGroupDelete is the builder for deleting a UserGroup entity.

func (*UserGroupDelete) Exec

func (ugd *UserGroupDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserGroupDelete) ExecX

func (ugd *UserGroupDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupDelete) Where

Where appends a list predicates to the UserGroupDelete builder.

type UserGroupDeleteOne

type UserGroupDeleteOne struct {
	// contains filtered or unexported fields
}

UserGroupDeleteOne is the builder for deleting a single UserGroup entity.

func (*UserGroupDeleteOne) Exec

func (ugdo *UserGroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserGroupDeleteOne) ExecX

func (ugdo *UserGroupDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupDeleteOne) Where added in v0.11.7

Where appends a list predicates to the UserGroupDelete builder.

type UserGroupEdges

type UserGroupEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

UserGroupEdges holds the relations/edges for other nodes in the graph.

func (UserGroupEdges) GroupOrErr

func (e UserGroupEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserGroupEdges) UserOrErr

func (e UserGroupEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupFilter added in v0.11.2

type UserGroupFilter struct {
	// contains filtered or unexported fields
}

UserGroupFilter provides a generic filtering capability at runtime for UserGroupQuery.

func (*UserGroupFilter) Where added in v0.11.2

func (f *UserGroupFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*UserGroupFilter) WhereGroupID added in v0.11.2

func (f *UserGroupFilter) WhereGroupID(p entql.IntP)

WhereGroupID applies the entql int predicate on the group_id field.

func (*UserGroupFilter) WhereHasGroup added in v0.11.2

func (f *UserGroupFilter) WhereHasGroup()

WhereHasGroup applies a predicate to check if query has an edge group.

func (*UserGroupFilter) WhereHasGroupWith added in v0.11.2

func (f *UserGroupFilter) WhereHasGroupWith(preds ...predicate.Group)

WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates).

func (*UserGroupFilter) WhereHasUser added in v0.11.2

func (f *UserGroupFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*UserGroupFilter) WhereHasUserWith added in v0.11.2

func (f *UserGroupFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*UserGroupFilter) WhereID added in v0.11.2

func (f *UserGroupFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*UserGroupFilter) WhereJoinedAt added in v0.11.2

func (f *UserGroupFilter) WhereJoinedAt(p entql.TimeP)

WhereJoinedAt applies the entql time.Time predicate on the joined_at field.

func (*UserGroupFilter) WhereUserID added in v0.11.2

func (f *UserGroupFilter) WhereUserID(p entql.IntP)

WhereUserID applies the entql int predicate on the user_id field.

type UserGroupGroupBy

type UserGroupGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupGroupBy is the group-by builder for UserGroup entities.

func (*UserGroupGroupBy) Aggregate

func (uggb *UserGroupGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupGroupBy) Bool

func (s *UserGroupGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) BoolX

func (s *UserGroupGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupGroupBy) Bools

func (s *UserGroupGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) BoolsX

func (s *UserGroupGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupGroupBy) Float64

func (s *UserGroupGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) Float64X

func (s *UserGroupGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupGroupBy) Float64s

func (s *UserGroupGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) Float64sX

func (s *UserGroupGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupGroupBy) Int

func (s *UserGroupGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) IntX

func (s *UserGroupGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupGroupBy) Ints

func (s *UserGroupGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) IntsX

func (s *UserGroupGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupGroupBy) Scan

func (uggb *UserGroupGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupGroupBy) ScanX

func (s *UserGroupGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupGroupBy) String

func (s *UserGroupGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) StringX

func (s *UserGroupGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupGroupBy) Strings

func (s *UserGroupGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupGroupBy) StringsX

func (s *UserGroupGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserGroupMutation

type UserGroupMutation struct {
	// contains filtered or unexported fields
}

UserGroupMutation represents an operation that mutates the UserGroup nodes in the graph.

func (*UserGroupMutation) AddField

func (m *UserGroupMutation) 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 (*UserGroupMutation) AddedEdges

func (m *UserGroupMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserGroupMutation) AddedField

func (m *UserGroupMutation) 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 (*UserGroupMutation) AddedFields

func (m *UserGroupMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserGroupMutation) AddedIDs

func (m *UserGroupMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserGroupMutation) ClearEdge

func (m *UserGroupMutation) 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 (*UserGroupMutation) ClearField

func (m *UserGroupMutation) 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 (*UserGroupMutation) ClearGroup

func (m *UserGroupMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*UserGroupMutation) ClearUser

func (m *UserGroupMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserGroupMutation) ClearedEdges

func (m *UserGroupMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserGroupMutation) ClearedFields

func (m *UserGroupMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserGroupMutation) Client

func (m UserGroupMutation) 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 (*UserGroupMutation) EdgeCleared

func (m *UserGroupMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserGroupMutation) Field

func (m *UserGroupMutation) 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 (*UserGroupMutation) FieldCleared

func (m *UserGroupMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserGroupMutation) Fields

func (m *UserGroupMutation) 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 (*UserGroupMutation) Filter added in v0.11.2

func (m *UserGroupMutation) Filter() *UserGroupFilter

Filter returns an entql.Where implementation to apply filters on the UserGroupMutation builder.

func (*UserGroupMutation) GroupCleared

func (m *UserGroupMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*UserGroupMutation) GroupID

func (m *UserGroupMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*UserGroupMutation) GroupIDs

func (m *UserGroupMutation) GroupIDs() (ids []int)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*UserGroupMutation) ID

func (m *UserGroupMutation) 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 (*UserGroupMutation) IDs

func (m *UserGroupMutation) 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 (*UserGroupMutation) JoinedAt

func (m *UserGroupMutation) JoinedAt() (r time.Time, exists bool)

JoinedAt returns the value of the "joined_at" field in the mutation.

func (*UserGroupMutation) OldField

func (m *UserGroupMutation) 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 (*UserGroupMutation) OldGroupID

func (m *UserGroupMutation) OldGroupID(ctx context.Context) (v int, err error)

OldGroupID returns the old "group_id" field's value of the UserGroup entity. If the UserGroup 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 (*UserGroupMutation) OldJoinedAt

func (m *UserGroupMutation) OldJoinedAt(ctx context.Context) (v time.Time, err error)

OldJoinedAt returns the old "joined_at" field's value of the UserGroup entity. If the UserGroup 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 (*UserGroupMutation) OldUserID

func (m *UserGroupMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserGroup entity. If the UserGroup 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 (*UserGroupMutation) Op

func (m *UserGroupMutation) Op() Op

Op returns the operation name.

func (*UserGroupMutation) RemovedEdges

func (m *UserGroupMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserGroupMutation) RemovedIDs

func (m *UserGroupMutation) 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 (*UserGroupMutation) ResetEdge

func (m *UserGroupMutation) 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 (*UserGroupMutation) ResetField

func (m *UserGroupMutation) 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 (*UserGroupMutation) ResetGroup

func (m *UserGroupMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*UserGroupMutation) ResetGroupID

func (m *UserGroupMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*UserGroupMutation) ResetJoinedAt

func (m *UserGroupMutation) ResetJoinedAt()

ResetJoinedAt resets all changes to the "joined_at" field.

func (*UserGroupMutation) ResetUser

func (m *UserGroupMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserGroupMutation) ResetUserID

func (m *UserGroupMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserGroupMutation) SetField

func (m *UserGroupMutation) 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 (*UserGroupMutation) SetGroupID

func (m *UserGroupMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*UserGroupMutation) SetJoinedAt

func (m *UserGroupMutation) SetJoinedAt(t time.Time)

SetJoinedAt sets the "joined_at" field.

func (*UserGroupMutation) SetOp added in v0.11.5

func (m *UserGroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserGroupMutation) SetUserID

func (m *UserGroupMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserGroupMutation) Tx

func (m UserGroupMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserGroupMutation) Type

func (m *UserGroupMutation) Type() string

Type returns the node type of this mutation (UserGroup).

func (*UserGroupMutation) UserCleared

func (m *UserGroupMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserGroupMutation) UserID

func (m *UserGroupMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserGroupMutation) UserIDs

func (m *UserGroupMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*UserGroupMutation) Where

func (m *UserGroupMutation) Where(ps ...predicate.UserGroup)

Where appends a list predicates to the UserGroupMutation builder.

func (*UserGroupMutation) WhereP added in v0.11.5

func (m *UserGroupMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserGroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserGroupQuery

type UserGroupQuery struct {
	// contains filtered or unexported fields
}

UserGroupQuery is the builder for querying UserGroup entities.

func (*UserGroupQuery) Aggregate added in v0.11.4

func (ugq *UserGroupQuery) Aggregate(fns ...AggregateFunc) *UserGroupSelect

Aggregate returns a UserGroupSelect configured with the given aggregations.

func (*UserGroupQuery) All

func (ugq *UserGroupQuery) All(ctx context.Context) ([]*UserGroup, error)

All executes the query and returns a list of UserGroups.

func (*UserGroupQuery) AllX

func (ugq *UserGroupQuery) AllX(ctx context.Context) []*UserGroup

AllX is like All, but panics if an error occurs.

func (*UserGroupQuery) Clone

func (ugq *UserGroupQuery) Clone() *UserGroupQuery

Clone returns a duplicate of the UserGroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserGroupQuery) Count

func (ugq *UserGroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserGroupQuery) CountX

func (ugq *UserGroupQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserGroupQuery) Exist

func (ugq *UserGroupQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserGroupQuery) ExistX

func (ugq *UserGroupQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserGroupQuery) Filter added in v0.11.2

func (ugq *UserGroupQuery) Filter() *UserGroupFilter

Filter returns a Filter implementation to apply filters on the UserGroupQuery builder.

func (*UserGroupQuery) First

func (ugq *UserGroupQuery) First(ctx context.Context) (*UserGroup, error)

First returns the first UserGroup entity from the query. Returns a *NotFoundError when no UserGroup was found.

func (*UserGroupQuery) FirstID

func (ugq *UserGroupQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserGroup ID from the query. Returns a *NotFoundError when no UserGroup ID was found.

func (*UserGroupQuery) FirstIDX

func (ugq *UserGroupQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserGroupQuery) FirstX

func (ugq *UserGroupQuery) FirstX(ctx context.Context) *UserGroup

FirstX is like First, but panics if an error occurs.

func (*UserGroupQuery) GroupBy

func (ugq *UserGroupQuery) GroupBy(field string, fields ...string) *UserGroupGroupBy

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 {
	JoinedAt time.Time `json:"joined_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserGroup.Query().
	GroupBy(usergroup.FieldJoinedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserGroupQuery) IDs

func (ugq *UserGroupQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserGroup IDs.

func (*UserGroupQuery) IDsX

func (ugq *UserGroupQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserGroupQuery) Limit

func (ugq *UserGroupQuery) Limit(limit int) *UserGroupQuery

Limit the number of records to be returned by this query.

func (*UserGroupQuery) Offset

func (ugq *UserGroupQuery) Offset(offset int) *UserGroupQuery

Offset to start from.

func (*UserGroupQuery) Only

func (ugq *UserGroupQuery) Only(ctx context.Context) (*UserGroup, error)

Only returns a single UserGroup entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserGroup entity is found. Returns a *NotFoundError when no UserGroup entities are found.

func (*UserGroupQuery) OnlyID

func (ugq *UserGroupQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserGroup ID in the query. Returns a *NotSingularError when more than one UserGroup ID is found. Returns a *NotFoundError when no entities are found.

func (*UserGroupQuery) OnlyIDX

func (ugq *UserGroupQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserGroupQuery) OnlyX

func (ugq *UserGroupQuery) OnlyX(ctx context.Context) *UserGroup

OnlyX is like Only, but panics if an error occurs.

func (*UserGroupQuery) Order

func (ugq *UserGroupQuery) Order(o ...OrderFunc) *UserGroupQuery

Order specifies how the records should be ordered.

func (*UserGroupQuery) QueryGroup

func (ugq *UserGroupQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*UserGroupQuery) QueryUser

func (ugq *UserGroupQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserGroupQuery) Select

func (ugq *UserGroupQuery) Select(fields ...string) *UserGroupSelect

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 {
	JoinedAt time.Time `json:"joined_at,omitempty"`
}

client.UserGroup.Query().
	Select(usergroup.FieldJoinedAt).
	Scan(ctx, &v)

func (*UserGroupQuery) Unique

func (ugq *UserGroupQuery) Unique(unique bool) *UserGroupQuery

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 (*UserGroupQuery) Where

func (ugq *UserGroupQuery) Where(ps ...predicate.UserGroup) *UserGroupQuery

Where adds a new predicate for the UserGroupQuery builder.

func (*UserGroupQuery) WithGroup

func (ugq *UserGroupQuery) WithGroup(opts ...func(*GroupQuery)) *UserGroupQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserGroupQuery) WithUser

func (ugq *UserGroupQuery) WithUser(opts ...func(*UserQuery)) *UserGroupQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type UserGroupSelect

type UserGroupSelect struct {
	*UserGroupQuery
	// contains filtered or unexported fields
}

UserGroupSelect is the builder for selecting fields of UserGroup entities.

func (*UserGroupSelect) Aggregate added in v0.11.4

func (ugs *UserGroupSelect) Aggregate(fns ...AggregateFunc) *UserGroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserGroupSelect) Bool

func (s *UserGroupSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) BoolX

func (s *UserGroupSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupSelect) Bools

func (s *UserGroupSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) BoolsX

func (s *UserGroupSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupSelect) Float64

func (s *UserGroupSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) Float64X

func (s *UserGroupSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupSelect) Float64s

func (s *UserGroupSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) Float64sX

func (s *UserGroupSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupSelect) Int

func (s *UserGroupSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) IntX

func (s *UserGroupSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupSelect) Ints

func (s *UserGroupSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) IntsX

func (s *UserGroupSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupSelect) Scan

func (ugs *UserGroupSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupSelect) ScanX

func (s *UserGroupSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupSelect) String

func (s *UserGroupSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) StringX

func (s *UserGroupSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupSelect) Strings

func (s *UserGroupSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupSelect) StringsX

func (s *UserGroupSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserGroupUpdate

type UserGroupUpdate struct {
	// contains filtered or unexported fields
}

UserGroupUpdate is the builder for updating UserGroup entities.

func (*UserGroupUpdate) ClearGroup

func (ugu *UserGroupUpdate) ClearGroup() *UserGroupUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*UserGroupUpdate) ClearUser

func (ugu *UserGroupUpdate) ClearUser() *UserGroupUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserGroupUpdate) Exec

func (ugu *UserGroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupUpdate) ExecX

func (ugu *UserGroupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupUpdate) Mutation

func (ugu *UserGroupUpdate) Mutation() *UserGroupMutation

Mutation returns the UserGroupMutation object of the builder.

func (*UserGroupUpdate) Save

func (ugu *UserGroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserGroupUpdate) SaveX

func (ugu *UserGroupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserGroupUpdate) SetGroup

func (ugu *UserGroupUpdate) SetGroup(g *Group) *UserGroupUpdate

SetGroup sets the "group" edge to the Group entity.

func (*UserGroupUpdate) SetGroupID

func (ugu *UserGroupUpdate) SetGroupID(i int) *UserGroupUpdate

SetGroupID sets the "group_id" field.

func (*UserGroupUpdate) SetJoinedAt

func (ugu *UserGroupUpdate) SetJoinedAt(t time.Time) *UserGroupUpdate

SetJoinedAt sets the "joined_at" field.

func (*UserGroupUpdate) SetNillableJoinedAt

func (ugu *UserGroupUpdate) SetNillableJoinedAt(t *time.Time) *UserGroupUpdate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserGroupUpdate) SetUser

func (ugu *UserGroupUpdate) SetUser(u *User) *UserGroupUpdate

SetUser sets the "user" edge to the User entity.

func (*UserGroupUpdate) SetUserID

func (ugu *UserGroupUpdate) SetUserID(i int) *UserGroupUpdate

SetUserID sets the "user_id" field.

func (*UserGroupUpdate) Where

Where appends a list predicates to the UserGroupUpdate builder.

type UserGroupUpdateOne

type UserGroupUpdateOne struct {
	// contains filtered or unexported fields
}

UserGroupUpdateOne is the builder for updating a single UserGroup entity.

func (*UserGroupUpdateOne) ClearGroup

func (uguo *UserGroupUpdateOne) ClearGroup() *UserGroupUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*UserGroupUpdateOne) ClearUser

func (uguo *UserGroupUpdateOne) ClearUser() *UserGroupUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*UserGroupUpdateOne) Exec

func (uguo *UserGroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserGroupUpdateOne) ExecX

func (uguo *UserGroupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupUpdateOne) Mutation

func (uguo *UserGroupUpdateOne) Mutation() *UserGroupMutation

Mutation returns the UserGroupMutation object of the builder.

func (*UserGroupUpdateOne) Save

func (uguo *UserGroupUpdateOne) Save(ctx context.Context) (*UserGroup, error)

Save executes the query and returns the updated UserGroup entity.

func (*UserGroupUpdateOne) SaveX

func (uguo *UserGroupUpdateOne) SaveX(ctx context.Context) *UserGroup

SaveX is like Save, but panics if an error occurs.

func (*UserGroupUpdateOne) Select

func (uguo *UserGroupUpdateOne) Select(field string, fields ...string) *UserGroupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserGroupUpdateOne) SetGroup

func (uguo *UserGroupUpdateOne) SetGroup(g *Group) *UserGroupUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*UserGroupUpdateOne) SetGroupID

func (uguo *UserGroupUpdateOne) SetGroupID(i int) *UserGroupUpdateOne

SetGroupID sets the "group_id" field.

func (*UserGroupUpdateOne) SetJoinedAt

func (uguo *UserGroupUpdateOne) SetJoinedAt(t time.Time) *UserGroupUpdateOne

SetJoinedAt sets the "joined_at" field.

func (*UserGroupUpdateOne) SetNillableJoinedAt

func (uguo *UserGroupUpdateOne) SetNillableJoinedAt(t *time.Time) *UserGroupUpdateOne

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserGroupUpdateOne) SetUser

func (uguo *UserGroupUpdateOne) SetUser(u *User) *UserGroupUpdateOne

SetUser sets the "user" edge to the User entity.

func (*UserGroupUpdateOne) SetUserID

func (uguo *UserGroupUpdateOne) SetUserID(i int) *UserGroupUpdateOne

SetUserID sets the "user_id" field.

func (*UserGroupUpdateOne) Where added in v0.11.8

Where appends a list predicates to the UserGroupUpdate builder.

type UserGroupUpsert

type UserGroupUpsert struct {
	*sql.UpdateSet
}

UserGroupUpsert is the "OnConflict" setter.

func (*UserGroupUpsert) SetGroupID

func (u *UserGroupUpsert) SetGroupID(v int) *UserGroupUpsert

SetGroupID sets the "group_id" field.

func (*UserGroupUpsert) SetJoinedAt

func (u *UserGroupUpsert) SetJoinedAt(v time.Time) *UserGroupUpsert

SetJoinedAt sets the "joined_at" field.

func (*UserGroupUpsert) SetUserID

func (u *UserGroupUpsert) SetUserID(v int) *UserGroupUpsert

SetUserID sets the "user_id" field.

func (*UserGroupUpsert) UpdateGroupID

func (u *UserGroupUpsert) UpdateGroupID() *UserGroupUpsert

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*UserGroupUpsert) UpdateJoinedAt

func (u *UserGroupUpsert) UpdateJoinedAt() *UserGroupUpsert

UpdateJoinedAt sets the "joined_at" field to the value that was provided on create.

func (*UserGroupUpsert) UpdateUserID

func (u *UserGroupUpsert) UpdateUserID() *UserGroupUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserGroupUpsertBulk

type UserGroupUpsertBulk struct {
	// contains filtered or unexported fields
}

UserGroupUpsertBulk is the builder for "upsert"-ing a bulk of UserGroup nodes.

func (*UserGroupUpsertBulk) DoNothing

func (u *UserGroupUpsertBulk) DoNothing() *UserGroupUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserGroupUpsertBulk) Exec

Exec executes the query.

func (*UserGroupUpsertBulk) ExecX

func (u *UserGroupUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserGroup.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserGroupUpsertBulk) SetGroupID

func (u *UserGroupUpsertBulk) SetGroupID(v int) *UserGroupUpsertBulk

SetGroupID sets the "group_id" field.

func (*UserGroupUpsertBulk) SetJoinedAt

func (u *UserGroupUpsertBulk) SetJoinedAt(v time.Time) *UserGroupUpsertBulk

SetJoinedAt sets the "joined_at" field.

func (*UserGroupUpsertBulk) SetUserID

func (u *UserGroupUpsertBulk) SetUserID(v int) *UserGroupUpsertBulk

SetUserID sets the "user_id" field.

func (*UserGroupUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the UserGroupCreateBulk.OnConflict documentation for more info.

func (*UserGroupUpsertBulk) UpdateGroupID

func (u *UserGroupUpsertBulk) UpdateGroupID() *UserGroupUpsertBulk

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*UserGroupUpsertBulk) UpdateJoinedAt

func (u *UserGroupUpsertBulk) UpdateJoinedAt() *UserGroupUpsertBulk

UpdateJoinedAt sets the "joined_at" field to the value that was provided on create.

func (*UserGroupUpsertBulk) UpdateNewValues

func (u *UserGroupUpsertBulk) UpdateNewValues() *UserGroupUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserGroup.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserGroupUpsertBulk) UpdateUserID

func (u *UserGroupUpsertBulk) UpdateUserID() *UserGroupUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserGroupUpsertOne

type UserGroupUpsertOne struct {
	// contains filtered or unexported fields
}

UserGroupUpsertOne is the builder for "upsert"-ing

one UserGroup node.

func (*UserGroupUpsertOne) DoNothing

func (u *UserGroupUpsertOne) DoNothing() *UserGroupUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserGroupUpsertOne) Exec

func (u *UserGroupUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupUpsertOne) ExecX

func (u *UserGroupUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupUpsertOne) ID

func (u *UserGroupUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserGroupUpsertOne) IDX

func (u *UserGroupUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*UserGroupUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserGroup.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserGroupUpsertOne) SetGroupID

func (u *UserGroupUpsertOne) SetGroupID(v int) *UserGroupUpsertOne

SetGroupID sets the "group_id" field.

func (*UserGroupUpsertOne) SetJoinedAt

func (u *UserGroupUpsertOne) SetJoinedAt(v time.Time) *UserGroupUpsertOne

SetJoinedAt sets the "joined_at" field.

func (*UserGroupUpsertOne) SetUserID

func (u *UserGroupUpsertOne) SetUserID(v int) *UserGroupUpsertOne

SetUserID sets the "user_id" field.

func (*UserGroupUpsertOne) Update

func (u *UserGroupUpsertOne) Update(set func(*UserGroupUpsert)) *UserGroupUpsertOne

Update allows overriding fields `UPDATE` values. See the UserGroupCreate.OnConflict documentation for more info.

func (*UserGroupUpsertOne) UpdateGroupID

func (u *UserGroupUpsertOne) UpdateGroupID() *UserGroupUpsertOne

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*UserGroupUpsertOne) UpdateJoinedAt

func (u *UserGroupUpsertOne) UpdateJoinedAt() *UserGroupUpsertOne

UpdateJoinedAt sets the "joined_at" field to the value that was provided on create.

func (*UserGroupUpsertOne) UpdateNewValues

func (u *UserGroupUpsertOne) UpdateNewValues() *UserGroupUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserGroup.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserGroupUpsertOne) UpdateUserID

func (u *UserGroupUpsertOne) UpdateUserID() *UserGroupUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserGroups

type UserGroups []*UserGroup

UserGroups is a parsable slice of UserGroup.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddFriendIDs

func (m *UserMutation) AddFriendIDs(ids ...int)

AddFriendIDs adds the "friends" edge to the User entity by ids.

func (*UserMutation) AddFriendshipIDs

func (m *UserMutation) AddFriendshipIDs(ids ...int)

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by ids.

func (*UserMutation) AddGroupIDs

func (m *UserMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the "groups" edge to the Group entity by ids.

func (*UserMutation) AddJoinedGroupIDs

func (m *UserMutation) AddJoinedGroupIDs(ids ...int)

AddJoinedGroupIDs adds the "joined_groups" edge to the UserGroup entity by ids.

func (*UserMutation) AddLikedTweetIDs

func (m *UserMutation) AddLikedTweetIDs(ids ...int)

AddLikedTweetIDs adds the "liked_tweets" edge to the Tweet entity by ids.

func (*UserMutation) AddRelativeIDs

func (m *UserMutation) AddRelativeIDs(ids ...int)

AddRelativeIDs adds the "relatives" edge to the User entity by ids.

func (*UserMutation) AddRoleIDs added in v0.11.1

func (m *UserMutation) AddRoleIDs(ids ...int)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*UserMutation) AddTweetIDs

func (m *UserMutation) AddTweetIDs(ids ...int)

AddTweetIDs adds the "tweets" edge to the Tweet entity by ids.

func (*UserMutation) AddUserTweetIDs

func (m *UserMutation) AddUserTweetIDs(ids ...int)

AddUserTweetIDs adds the "user_tweets" edge to the UserTweet entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearFriends

func (m *UserMutation) ClearFriends()

ClearFriends clears the "friends" edge to the User entity.

func (*UserMutation) ClearFriendships

func (m *UserMutation) ClearFriendships()

ClearFriendships clears the "friendships" edge to the Friendship entity.

func (*UserMutation) ClearGroups

func (m *UserMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*UserMutation) ClearJoinedGroups

func (m *UserMutation) ClearJoinedGroups()

ClearJoinedGroups clears the "joined_groups" edge to the UserGroup entity.

func (*UserMutation) ClearLikedTweets

func (m *UserMutation) ClearLikedTweets()

ClearLikedTweets clears the "liked_tweets" edge to the Tweet entity.

func (*UserMutation) ClearRelatives

func (m *UserMutation) ClearRelatives()

ClearRelatives clears the "relatives" edge to the User entity.

func (*UserMutation) ClearRoles added in v0.11.1

func (m *UserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*UserMutation) ClearTweets

func (m *UserMutation) ClearTweets()

ClearTweets clears the "tweets" edge to the Tweet entity.

func (*UserMutation) ClearUserTweets

func (m *UserMutation) ClearUserTweets()

ClearUserTweets clears the "user_tweets" edge to the UserTweet entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) Filter added in v0.11.2

func (m *UserMutation) Filter() *UserFilter

Filter returns an entql.Where implementation to apply filters on the UserMutation builder.

func (*UserMutation) FriendsCleared

func (m *UserMutation) FriendsCleared() bool

FriendsCleared reports if the "friends" edge to the User entity was cleared.

func (*UserMutation) FriendsIDs

func (m *UserMutation) FriendsIDs() (ids []int)

FriendsIDs returns the "friends" edge IDs in the mutation.

func (*UserMutation) FriendshipsCleared

func (m *UserMutation) FriendshipsCleared() bool

FriendshipsCleared reports if the "friendships" edge to the Friendship entity was cleared.

func (*UserMutation) FriendshipsIDs

func (m *UserMutation) FriendshipsIDs() (ids []int)

FriendshipsIDs returns the "friendships" edge IDs in the mutation.

func (*UserMutation) GroupsCleared

func (m *UserMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Group entity was cleared.

func (*UserMutation) GroupsIDs

func (m *UserMutation) GroupsIDs() (ids []int)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) 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 (*UserMutation) IDs

func (m *UserMutation) 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 (*UserMutation) JoinedGroupsCleared

func (m *UserMutation) JoinedGroupsCleared() bool

JoinedGroupsCleared reports if the "joined_groups" edge to the UserGroup entity was cleared.

func (*UserMutation) JoinedGroupsIDs

func (m *UserMutation) JoinedGroupsIDs() (ids []int)

JoinedGroupsIDs returns the "joined_groups" edge IDs in the mutation.

func (*UserMutation) LikedTweetsCleared

func (m *UserMutation) LikedTweetsCleared() bool

LikedTweetsCleared reports if the "liked_tweets" edge to the Tweet entity was cleared.

func (*UserMutation) LikedTweetsIDs

func (m *UserMutation) LikedTweetsIDs() (ids []int)

LikedTweetsIDs returns the "liked_tweets" edge IDs in the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RelativesCleared

func (m *UserMutation) RelativesCleared() bool

RelativesCleared reports if the "relatives" edge to the User entity was cleared.

func (*UserMutation) RelativesIDs

func (m *UserMutation) RelativesIDs() (ids []int)

RelativesIDs returns the "relatives" edge IDs in the mutation.

func (*UserMutation) RemoveFriendIDs

func (m *UserMutation) RemoveFriendIDs(ids ...int)

RemoveFriendIDs removes the "friends" edge to the User entity by IDs.

func (*UserMutation) RemoveFriendshipIDs

func (m *UserMutation) RemoveFriendshipIDs(ids ...int)

RemoveFriendshipIDs removes the "friendships" edge to the Friendship entity by IDs.

func (*UserMutation) RemoveGroupIDs

func (m *UserMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.

func (*UserMutation) RemoveJoinedGroupIDs

func (m *UserMutation) RemoveJoinedGroupIDs(ids ...int)

RemoveJoinedGroupIDs removes the "joined_groups" edge to the UserGroup entity by IDs.

func (*UserMutation) RemoveLikedTweetIDs

func (m *UserMutation) RemoveLikedTweetIDs(ids ...int)

RemoveLikedTweetIDs removes the "liked_tweets" edge to the Tweet entity by IDs.

func (*UserMutation) RemoveRelativeIDs

func (m *UserMutation) RemoveRelativeIDs(ids ...int)

RemoveRelativeIDs removes the "relatives" edge to the User entity by IDs.

func (*UserMutation) RemoveRoleIDs added in v0.11.1

func (m *UserMutation) RemoveRoleIDs(ids ...int)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (*UserMutation) RemoveTweetIDs

func (m *UserMutation) RemoveTweetIDs(ids ...int)

RemoveTweetIDs removes the "tweets" edge to the Tweet entity by IDs.

func (*UserMutation) RemoveUserTweetIDs

func (m *UserMutation) RemoveUserTweetIDs(ids ...int)

RemoveUserTweetIDs removes the "user_tweets" edge to the UserTweet entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedFriendsIDs

func (m *UserMutation) RemovedFriendsIDs() (ids []int)

RemovedFriends returns the removed IDs of the "friends" edge to the User entity.

func (*UserMutation) RemovedFriendshipsIDs

func (m *UserMutation) RemovedFriendshipsIDs() (ids []int)

RemovedFriendships returns the removed IDs of the "friendships" edge to the Friendship entity.

func (*UserMutation) RemovedGroupsIDs

func (m *UserMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedJoinedGroupsIDs

func (m *UserMutation) RemovedJoinedGroupsIDs() (ids []int)

RemovedJoinedGroups returns the removed IDs of the "joined_groups" edge to the UserGroup entity.

func (*UserMutation) RemovedLikedTweetsIDs

func (m *UserMutation) RemovedLikedTweetsIDs() (ids []int)

RemovedLikedTweets returns the removed IDs of the "liked_tweets" edge to the Tweet entity.

func (*UserMutation) RemovedRelativesIDs

func (m *UserMutation) RemovedRelativesIDs() (ids []int)

RemovedRelatives returns the removed IDs of the "relatives" edge to the User entity.

func (*UserMutation) RemovedRolesIDs added in v0.11.1

func (m *UserMutation) RemovedRolesIDs() (ids []int)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*UserMutation) RemovedTweetsIDs

func (m *UserMutation) RemovedTweetsIDs() (ids []int)

RemovedTweets returns the removed IDs of the "tweets" edge to the Tweet entity.

func (*UserMutation) RemovedUserTweetsIDs

func (m *UserMutation) RemovedUserTweetsIDs() (ids []int)

RemovedUserTweets returns the removed IDs of the "user_tweets" edge to the UserTweet entity.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetFriends

func (m *UserMutation) ResetFriends()

ResetFriends resets all changes to the "friends" edge.

func (*UserMutation) ResetFriendships

func (m *UserMutation) ResetFriendships()

ResetFriendships resets all changes to the "friendships" edge.

func (*UserMutation) ResetGroups

func (m *UserMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*UserMutation) ResetJoinedGroups

func (m *UserMutation) ResetJoinedGroups()

ResetJoinedGroups resets all changes to the "joined_groups" edge.

func (*UserMutation) ResetLikedTweets

func (m *UserMutation) ResetLikedTweets()

ResetLikedTweets resets all changes to the "liked_tweets" edge.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetRelatives

func (m *UserMutation) ResetRelatives()

ResetRelatives resets all changes to the "relatives" edge.

func (*UserMutation) ResetRoles added in v0.11.1

func (m *UserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMutation) ResetTweets

func (m *UserMutation) ResetTweets()

ResetTweets resets all changes to the "tweets" edge.

func (*UserMutation) ResetUserTweets

func (m *UserMutation) ResetUserTweets()

ResetUserTweets resets all changes to the "user_tweets" edge.

func (*UserMutation) RolesCleared added in v0.11.1

func (m *UserMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (*UserMutation) RolesIDs added in v0.11.1

func (m *UserMutation) RolesIDs() (ids []int)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp added in v0.11.5

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) TweetsCleared

func (m *UserMutation) TweetsCleared() bool

TweetsCleared reports if the "tweets" edge to the Tweet entity was cleared.

func (*UserMutation) TweetsIDs

func (m *UserMutation) TweetsIDs() (ids []int)

TweetsIDs returns the "tweets" edge IDs in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UserTweetsCleared

func (m *UserMutation) UserTweetsCleared() bool

UserTweetsCleared reports if the "user_tweets" edge to the UserTweet entity was cleared.

func (*UserMutation) UserTweetsIDs

func (m *UserMutation) UserTweetsIDs() (ids []int)

UserTweetsIDs returns the "user_tweets" edge IDs in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP added in v0.11.5

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate added in v0.11.4

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) Filter added in v0.11.2

func (uq *UserQuery) Filter() *UserFilter

Filter returns a Filter implementation to apply filters on the UserQuery builder.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryFriends

func (uq *UserQuery) QueryFriends() *UserQuery

QueryFriends chains the current query on the "friends" edge.

func (*UserQuery) QueryFriendships

func (uq *UserQuery) QueryFriendships() *FriendshipQuery

QueryFriendships chains the current query on the "friendships" edge.

func (*UserQuery) QueryGroups

func (uq *UserQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*UserQuery) QueryJoinedGroups

func (uq *UserQuery) QueryJoinedGroups() *UserGroupQuery

QueryJoinedGroups chains the current query on the "joined_groups" edge.

func (*UserQuery) QueryLikedTweets

func (uq *UserQuery) QueryLikedTweets() *TweetQuery

QueryLikedTweets chains the current query on the "liked_tweets" edge.

func (*UserQuery) QueryLikes

func (uq *UserQuery) QueryLikes() *TweetLikeQuery

QueryLikes chains the current query on the "likes" edge.

func (*UserQuery) QueryRelationship

func (uq *UserQuery) QueryRelationship() *RelationshipQuery

QueryRelationship chains the current query on the "relationship" edge.

func (*UserQuery) QueryRelatives

func (uq *UserQuery) QueryRelatives() *UserQuery

QueryRelatives chains the current query on the "relatives" edge.

func (*UserQuery) QueryRoles added in v0.11.1

func (uq *UserQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*UserQuery) QueryRolesUsers added in v0.11.1

func (uq *UserQuery) QueryRolesUsers() *RoleUserQuery

QueryRolesUsers chains the current query on the "roles_users" edge.

func (*UserQuery) QueryTweets

func (uq *UserQuery) QueryTweets() *TweetQuery

QueryTweets chains the current query on the "tweets" edge.

func (*UserQuery) QueryUserTweets

func (uq *UserQuery) QueryUserTweets() *UserTweetQuery

QueryUserTweets chains the current query on the "user_tweets" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.User.Query().
	Select(user.FieldName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithFriends

func (uq *UserQuery) WithFriends(opts ...func(*UserQuery)) *UserQuery

WithFriends tells the query-builder to eager-load the nodes that are connected to the "friends" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithFriendships

func (uq *UserQuery) WithFriendships(opts ...func(*FriendshipQuery)) *UserQuery

WithFriendships tells the query-builder to eager-load the nodes that are connected to the "friendships" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroups

func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery

WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithJoinedGroups

func (uq *UserQuery) WithJoinedGroups(opts ...func(*UserGroupQuery)) *UserQuery

WithJoinedGroups tells the query-builder to eager-load the nodes that are connected to the "joined_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithLikedTweets

func (uq *UserQuery) WithLikedTweets(opts ...func(*TweetQuery)) *UserQuery

WithLikedTweets tells the query-builder to eager-load the nodes that are connected to the "liked_tweets" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithLikes

func (uq *UserQuery) WithLikes(opts ...func(*TweetLikeQuery)) *UserQuery

WithLikes tells the query-builder to eager-load the nodes that are connected to the "likes" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRelationship

func (uq *UserQuery) WithRelationship(opts ...func(*RelationshipQuery)) *UserQuery

WithRelationship tells the query-builder to eager-load the nodes that are connected to the "relationship" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRelatives

func (uq *UserQuery) WithRelatives(opts ...func(*UserQuery)) *UserQuery

WithRelatives tells the query-builder to eager-load the nodes that are connected to the "relatives" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRoles added in v0.11.1

func (uq *UserQuery) WithRoles(opts ...func(*RoleQuery)) *UserQuery

WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRolesUsers added in v0.11.1

func (uq *UserQuery) WithRolesUsers(opts ...func(*RoleUserQuery)) *UserQuery

WithRolesUsers tells the query-builder to eager-load the nodes that are connected to the "roles_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithTweets

func (uq *UserQuery) WithTweets(opts ...func(*TweetQuery)) *UserQuery

WithTweets tells the query-builder to eager-load the nodes that are connected to the "tweets" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithUserTweets

func (uq *UserQuery) WithUserTweets(opts ...func(*UserTweetQuery)) *UserQuery

WithUserTweets tells the query-builder to eager-load the nodes that are connected to the "user_tweets" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate added in v0.11.4

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserTweet

type UserTweet struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// TweetID holds the value of the "tweet_id" field.
	TweetID int `json:"tweet_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserTweetQuery when eager-loading is set.
	Edges UserTweetEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserTweet is the model entity for the UserTweet schema.

func (*UserTweet) QueryTweet

func (ut *UserTweet) QueryTweet() *TweetQuery

QueryTweet queries the "tweet" edge of the UserTweet entity.

func (*UserTweet) QueryUser

func (ut *UserTweet) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserTweet entity.

func (*UserTweet) String

func (ut *UserTweet) String() string

String implements the fmt.Stringer.

func (*UserTweet) Unwrap

func (ut *UserTweet) Unwrap() *UserTweet

Unwrap unwraps the UserTweet 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 (*UserTweet) Update

func (ut *UserTweet) Update() *UserTweetUpdateOne

Update returns a builder for updating this UserTweet. Note that you need to call UserTweet.Unwrap() before calling this method if this UserTweet was returned from a transaction, and the transaction was committed or rolled back.

type UserTweetClient

type UserTweetClient struct {
	// contains filtered or unexported fields
}

UserTweetClient is a client for the UserTweet schema.

func NewUserTweetClient

func NewUserTweetClient(c config) *UserTweetClient

NewUserTweetClient returns a client for the UserTweet from the given config.

func (*UserTweetClient) Create

func (c *UserTweetClient) Create() *UserTweetCreate

Create returns a builder for creating a UserTweet entity.

func (*UserTweetClient) CreateBulk

func (c *UserTweetClient) CreateBulk(builders ...*UserTweetCreate) *UserTweetCreateBulk

CreateBulk returns a builder for creating a bulk of UserTweet entities.

func (*UserTweetClient) Delete

func (c *UserTweetClient) Delete() *UserTweetDelete

Delete returns a delete builder for UserTweet.

func (*UserTweetClient) DeleteOne

func (c *UserTweetClient) DeleteOne(ut *UserTweet) *UserTweetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserTweetClient) DeleteOneID

func (c *UserTweetClient) DeleteOneID(id int) *UserTweetDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserTweetClient) Get

func (c *UserTweetClient) Get(ctx context.Context, id int) (*UserTweet, error)

Get returns a UserTweet entity by its id.

func (*UserTweetClient) GetX

func (c *UserTweetClient) GetX(ctx context.Context, id int) *UserTweet

GetX is like Get, but panics if an error occurs.

func (*UserTweetClient) Hooks

func (c *UserTweetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserTweetClient) Intercept added in v0.11.5

func (c *UserTweetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usertweet.Intercept(f(g(h())))`.

func (*UserTweetClient) Interceptors added in v0.11.5

func (c *UserTweetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserTweetClient) Query

func (c *UserTweetClient) Query() *UserTweetQuery

Query returns a query builder for UserTweet.

func (*UserTweetClient) QueryTweet

func (c *UserTweetClient) QueryTweet(ut *UserTweet) *TweetQuery

QueryTweet queries the tweet edge of a UserTweet.

func (*UserTweetClient) QueryUser

func (c *UserTweetClient) QueryUser(ut *UserTweet) *UserQuery

QueryUser queries the user edge of a UserTweet.

func (*UserTweetClient) Update

func (c *UserTweetClient) Update() *UserTweetUpdate

Update returns an update builder for UserTweet.

func (*UserTweetClient) UpdateOne

func (c *UserTweetClient) UpdateOne(ut *UserTweet) *UserTweetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserTweetClient) UpdateOneID

func (c *UserTweetClient) UpdateOneID(id int) *UserTweetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserTweetClient) Use

func (c *UserTweetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usertweet.Hooks(f(g(h())))`.

type UserTweetCreate

type UserTweetCreate struct {
	// contains filtered or unexported fields
}

UserTweetCreate is the builder for creating a UserTweet entity.

func (*UserTweetCreate) Exec

func (utc *UserTweetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTweetCreate) ExecX

func (utc *UserTweetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetCreate) Mutation

func (utc *UserTweetCreate) Mutation() *UserTweetMutation

Mutation returns the UserTweetMutation object of the builder.

func (*UserTweetCreate) OnConflict

func (utc *UserTweetCreate) OnConflict(opts ...sql.ConflictOption) *UserTweetUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserTweet.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserTweetUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserTweetCreate) OnConflictColumns

func (utc *UserTweetCreate) OnConflictColumns(columns ...string) *UserTweetUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserTweet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserTweetCreate) Save

func (utc *UserTweetCreate) Save(ctx context.Context) (*UserTweet, error)

Save creates the UserTweet in the database.

func (*UserTweetCreate) SaveX

func (utc *UserTweetCreate) SaveX(ctx context.Context) *UserTweet

SaveX calls Save and panics if Save returns an error.

func (*UserTweetCreate) SetCreatedAt

func (utc *UserTweetCreate) SetCreatedAt(t time.Time) *UserTweetCreate

SetCreatedAt sets the "created_at" field.

func (*UserTweetCreate) SetNillableCreatedAt

func (utc *UserTweetCreate) SetNillableCreatedAt(t *time.Time) *UserTweetCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserTweetCreate) SetTweet

func (utc *UserTweetCreate) SetTweet(t *Tweet) *UserTweetCreate

SetTweet sets the "tweet" edge to the Tweet entity.

func (*UserTweetCreate) SetTweetID

func (utc *UserTweetCreate) SetTweetID(i int) *UserTweetCreate

SetTweetID sets the "tweet_id" field.

func (*UserTweetCreate) SetUser

func (utc *UserTweetCreate) SetUser(u *User) *UserTweetCreate

SetUser sets the "user" edge to the User entity.

func (*UserTweetCreate) SetUserID

func (utc *UserTweetCreate) SetUserID(i int) *UserTweetCreate

SetUserID sets the "user_id" field.

type UserTweetCreateBulk

type UserTweetCreateBulk struct {
	// contains filtered or unexported fields
}

UserTweetCreateBulk is the builder for creating many UserTweet entities in bulk.

func (*UserTweetCreateBulk) Exec

func (utcb *UserTweetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTweetCreateBulk) ExecX

func (utcb *UserTweetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetCreateBulk) OnConflict

func (utcb *UserTweetCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserTweetUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserTweet.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserTweetUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserTweetCreateBulk) OnConflictColumns

func (utcb *UserTweetCreateBulk) OnConflictColumns(columns ...string) *UserTweetUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserTweet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserTweetCreateBulk) Save

func (utcb *UserTweetCreateBulk) Save(ctx context.Context) ([]*UserTweet, error)

Save creates the UserTweet entities in the database.

func (*UserTweetCreateBulk) SaveX

func (utcb *UserTweetCreateBulk) SaveX(ctx context.Context) []*UserTweet

SaveX is like Save, but panics if an error occurs.

type UserTweetDelete

type UserTweetDelete struct {
	// contains filtered or unexported fields
}

UserTweetDelete is the builder for deleting a UserTweet entity.

func (*UserTweetDelete) Exec

func (utd *UserTweetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserTweetDelete) ExecX

func (utd *UserTweetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetDelete) Where

Where appends a list predicates to the UserTweetDelete builder.

type UserTweetDeleteOne

type UserTweetDeleteOne struct {
	// contains filtered or unexported fields
}

UserTweetDeleteOne is the builder for deleting a single UserTweet entity.

func (*UserTweetDeleteOne) Exec

func (utdo *UserTweetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserTweetDeleteOne) ExecX

func (utdo *UserTweetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetDeleteOne) Where added in v0.11.7

Where appends a list predicates to the UserTweetDelete builder.

type UserTweetEdges

type UserTweetEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Tweet holds the value of the tweet edge.
	Tweet *Tweet `json:"tweet,omitempty"`
	// contains filtered or unexported fields
}

UserTweetEdges holds the relations/edges for other nodes in the graph.

func (UserTweetEdges) TweetOrErr

func (e UserTweetEdges) TweetOrErr() (*Tweet, error)

TweetOrErr returns the Tweet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserTweetEdges) UserOrErr

func (e UserTweetEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserTweetFilter added in v0.11.2

type UserTweetFilter struct {
	// contains filtered or unexported fields
}

UserTweetFilter provides a generic filtering capability at runtime for UserTweetQuery.

func (*UserTweetFilter) Where added in v0.11.2

func (f *UserTweetFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*UserTweetFilter) WhereCreatedAt added in v0.11.2

func (f *UserTweetFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*UserTweetFilter) WhereHasTweet added in v0.11.2

func (f *UserTweetFilter) WhereHasTweet()

WhereHasTweet applies a predicate to check if query has an edge tweet.

func (*UserTweetFilter) WhereHasTweetWith added in v0.11.2

func (f *UserTweetFilter) WhereHasTweetWith(preds ...predicate.Tweet)

WhereHasTweetWith applies a predicate to check if query has an edge tweet with a given conditions (other predicates).

func (*UserTweetFilter) WhereHasUser added in v0.11.2

func (f *UserTweetFilter) WhereHasUser()

WhereHasUser applies a predicate to check if query has an edge user.

func (*UserTweetFilter) WhereHasUserWith added in v0.11.2

func (f *UserTweetFilter) WhereHasUserWith(preds ...predicate.User)

WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates).

func (*UserTweetFilter) WhereID added in v0.11.2

func (f *UserTweetFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*UserTweetFilter) WhereTweetID added in v0.11.2

func (f *UserTweetFilter) WhereTweetID(p entql.IntP)

WhereTweetID applies the entql int predicate on the tweet_id field.

func (*UserTweetFilter) WhereUserID added in v0.11.2

func (f *UserTweetFilter) WhereUserID(p entql.IntP)

WhereUserID applies the entql int predicate on the user_id field.

type UserTweetGroupBy

type UserTweetGroupBy struct {
	// contains filtered or unexported fields
}

UserTweetGroupBy is the group-by builder for UserTweet entities.

func (*UserTweetGroupBy) Aggregate

func (utgb *UserTweetGroupBy) Aggregate(fns ...AggregateFunc) *UserTweetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserTweetGroupBy) Bool

func (s *UserTweetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) BoolX

func (s *UserTweetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserTweetGroupBy) Bools

func (s *UserTweetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) BoolsX

func (s *UserTweetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserTweetGroupBy) Float64

func (s *UserTweetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) Float64X

func (s *UserTweetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserTweetGroupBy) Float64s

func (s *UserTweetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) Float64sX

func (s *UserTweetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserTweetGroupBy) Int

func (s *UserTweetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) IntX

func (s *UserTweetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserTweetGroupBy) Ints

func (s *UserTweetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) IntsX

func (s *UserTweetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserTweetGroupBy) Scan

func (utgb *UserTweetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserTweetGroupBy) ScanX

func (s *UserTweetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserTweetGroupBy) String

func (s *UserTweetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) StringX

func (s *UserTweetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserTweetGroupBy) Strings

func (s *UserTweetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserTweetGroupBy) StringsX

func (s *UserTweetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserTweetMutation

type UserTweetMutation struct {
	// contains filtered or unexported fields
}

UserTweetMutation represents an operation that mutates the UserTweet nodes in the graph.

func (*UserTweetMutation) AddField

func (m *UserTweetMutation) 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 (*UserTweetMutation) AddedEdges

func (m *UserTweetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserTweetMutation) AddedField

func (m *UserTweetMutation) 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 (*UserTweetMutation) AddedFields

func (m *UserTweetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserTweetMutation) AddedIDs

func (m *UserTweetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserTweetMutation) ClearEdge

func (m *UserTweetMutation) 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 (*UserTweetMutation) ClearField

func (m *UserTweetMutation) 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 (*UserTweetMutation) ClearTweet

func (m *UserTweetMutation) ClearTweet()

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*UserTweetMutation) ClearUser

func (m *UserTweetMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserTweetMutation) ClearedEdges

func (m *UserTweetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserTweetMutation) ClearedFields

func (m *UserTweetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserTweetMutation) Client

func (m UserTweetMutation) 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 (*UserTweetMutation) CreatedAt

func (m *UserTweetMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserTweetMutation) EdgeCleared

func (m *UserTweetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserTweetMutation) Field

func (m *UserTweetMutation) 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 (*UserTweetMutation) FieldCleared

func (m *UserTweetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserTweetMutation) Fields

func (m *UserTweetMutation) 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 (*UserTweetMutation) Filter added in v0.11.2

func (m *UserTweetMutation) Filter() *UserTweetFilter

Filter returns an entql.Where implementation to apply filters on the UserTweetMutation builder.

func (*UserTweetMutation) ID

func (m *UserTweetMutation) 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 (*UserTweetMutation) IDs

func (m *UserTweetMutation) 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 (*UserTweetMutation) OldCreatedAt

func (m *UserTweetMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserTweet entity. If the UserTweet 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 (*UserTweetMutation) OldField

func (m *UserTweetMutation) 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 (*UserTweetMutation) OldTweetID

func (m *UserTweetMutation) OldTweetID(ctx context.Context) (v int, err error)

OldTweetID returns the old "tweet_id" field's value of the UserTweet entity. If the UserTweet 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 (*UserTweetMutation) OldUserID

func (m *UserTweetMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserTweet entity. If the UserTweet 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 (*UserTweetMutation) Op

func (m *UserTweetMutation) Op() Op

Op returns the operation name.

func (*UserTweetMutation) RemovedEdges

func (m *UserTweetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserTweetMutation) RemovedIDs

func (m *UserTweetMutation) 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 (*UserTweetMutation) ResetCreatedAt

func (m *UserTweetMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserTweetMutation) ResetEdge

func (m *UserTweetMutation) 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 (*UserTweetMutation) ResetField

func (m *UserTweetMutation) 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 (*UserTweetMutation) ResetTweet

func (m *UserTweetMutation) ResetTweet()

ResetTweet resets all changes to the "tweet" edge.

func (*UserTweetMutation) ResetTweetID

func (m *UserTweetMutation) ResetTweetID()

ResetTweetID resets all changes to the "tweet_id" field.

func (*UserTweetMutation) ResetUser

func (m *UserTweetMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserTweetMutation) ResetUserID

func (m *UserTweetMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserTweetMutation) SetCreatedAt

func (m *UserTweetMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserTweetMutation) SetField

func (m *UserTweetMutation) 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 (*UserTweetMutation) SetOp added in v0.11.5

func (m *UserTweetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserTweetMutation) SetTweetID

func (m *UserTweetMutation) SetTweetID(i int)

SetTweetID sets the "tweet_id" field.

func (*UserTweetMutation) SetUserID

func (m *UserTweetMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*UserTweetMutation) TweetCleared

func (m *UserTweetMutation) TweetCleared() bool

TweetCleared reports if the "tweet" edge to the Tweet entity was cleared.

func (*UserTweetMutation) TweetID

func (m *UserTweetMutation) TweetID() (r int, exists bool)

TweetID returns the value of the "tweet_id" field in the mutation.

func (*UserTweetMutation) TweetIDs

func (m *UserTweetMutation) TweetIDs() (ids []int)

TweetIDs returns the "tweet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TweetID instead. It exists only for internal usage by the builders.

func (UserTweetMutation) Tx

func (m UserTweetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserTweetMutation) Type

func (m *UserTweetMutation) Type() string

Type returns the node type of this mutation (UserTweet).

func (*UserTweetMutation) UserCleared

func (m *UserTweetMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserTweetMutation) UserID

func (m *UserTweetMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserTweetMutation) UserIDs

func (m *UserTweetMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*UserTweetMutation) Where

func (m *UserTweetMutation) Where(ps ...predicate.UserTweet)

Where appends a list predicates to the UserTweetMutation builder.

func (*UserTweetMutation) WhereP added in v0.11.5

func (m *UserTweetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserTweetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserTweetQuery

type UserTweetQuery struct {
	// contains filtered or unexported fields
}

UserTweetQuery is the builder for querying UserTweet entities.

func (*UserTweetQuery) Aggregate added in v0.11.4

func (utq *UserTweetQuery) Aggregate(fns ...AggregateFunc) *UserTweetSelect

Aggregate returns a UserTweetSelect configured with the given aggregations.

func (*UserTweetQuery) All

func (utq *UserTweetQuery) All(ctx context.Context) ([]*UserTweet, error)

All executes the query and returns a list of UserTweets.

func (*UserTweetQuery) AllX

func (utq *UserTweetQuery) AllX(ctx context.Context) []*UserTweet

AllX is like All, but panics if an error occurs.

func (*UserTweetQuery) Clone

func (utq *UserTweetQuery) Clone() *UserTweetQuery

Clone returns a duplicate of the UserTweetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserTweetQuery) Count

func (utq *UserTweetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserTweetQuery) CountX

func (utq *UserTweetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserTweetQuery) Exist

func (utq *UserTweetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserTweetQuery) ExistX

func (utq *UserTweetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserTweetQuery) Filter added in v0.11.2

func (utq *UserTweetQuery) Filter() *UserTweetFilter

Filter returns a Filter implementation to apply filters on the UserTweetQuery builder.

func (*UserTweetQuery) First

func (utq *UserTweetQuery) First(ctx context.Context) (*UserTweet, error)

First returns the first UserTweet entity from the query. Returns a *NotFoundError when no UserTweet was found.

func (*UserTweetQuery) FirstID

func (utq *UserTweetQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserTweet ID from the query. Returns a *NotFoundError when no UserTweet ID was found.

func (*UserTweetQuery) FirstIDX

func (utq *UserTweetQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserTweetQuery) FirstX

func (utq *UserTweetQuery) FirstX(ctx context.Context) *UserTweet

FirstX is like First, but panics if an error occurs.

func (*UserTweetQuery) GroupBy

func (utq *UserTweetQuery) GroupBy(field string, fields ...string) *UserTweetGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserTweet.Query().
	GroupBy(usertweet.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserTweetQuery) IDs

func (utq *UserTweetQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserTweet IDs.

func (*UserTweetQuery) IDsX

func (utq *UserTweetQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserTweetQuery) Limit

func (utq *UserTweetQuery) Limit(limit int) *UserTweetQuery

Limit the number of records to be returned by this query.

func (*UserTweetQuery) Offset

func (utq *UserTweetQuery) Offset(offset int) *UserTweetQuery

Offset to start from.

func (*UserTweetQuery) Only

func (utq *UserTweetQuery) Only(ctx context.Context) (*UserTweet, error)

Only returns a single UserTweet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserTweet entity is found. Returns a *NotFoundError when no UserTweet entities are found.

func (*UserTweetQuery) OnlyID

func (utq *UserTweetQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserTweet ID in the query. Returns a *NotSingularError when more than one UserTweet ID is found. Returns a *NotFoundError when no entities are found.

func (*UserTweetQuery) OnlyIDX

func (utq *UserTweetQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserTweetQuery) OnlyX

func (utq *UserTweetQuery) OnlyX(ctx context.Context) *UserTweet

OnlyX is like Only, but panics if an error occurs.

func (*UserTweetQuery) Order

func (utq *UserTweetQuery) Order(o ...OrderFunc) *UserTweetQuery

Order specifies how the records should be ordered.

func (*UserTweetQuery) QueryTweet

func (utq *UserTweetQuery) QueryTweet() *TweetQuery

QueryTweet chains the current query on the "tweet" edge.

func (*UserTweetQuery) QueryUser

func (utq *UserTweetQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserTweetQuery) Select

func (utq *UserTweetQuery) Select(fields ...string) *UserTweetSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserTweet.Query().
	Select(usertweet.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserTweetQuery) Unique

func (utq *UserTweetQuery) Unique(unique bool) *UserTweetQuery

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 (*UserTweetQuery) Where

func (utq *UserTweetQuery) Where(ps ...predicate.UserTweet) *UserTweetQuery

Where adds a new predicate for the UserTweetQuery builder.

func (*UserTweetQuery) WithTweet

func (utq *UserTweetQuery) WithTweet(opts ...func(*TweetQuery)) *UserTweetQuery

WithTweet tells the query-builder to eager-load the nodes that are connected to the "tweet" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserTweetQuery) WithUser

func (utq *UserTweetQuery) WithUser(opts ...func(*UserQuery)) *UserTweetQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type UserTweetSelect

type UserTweetSelect struct {
	*UserTweetQuery
	// contains filtered or unexported fields
}

UserTweetSelect is the builder for selecting fields of UserTweet entities.

func (*UserTweetSelect) Aggregate added in v0.11.4

func (uts *UserTweetSelect) Aggregate(fns ...AggregateFunc) *UserTweetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserTweetSelect) Bool

func (s *UserTweetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) BoolX

func (s *UserTweetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserTweetSelect) Bools

func (s *UserTweetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) BoolsX

func (s *UserTweetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserTweetSelect) Float64

func (s *UserTweetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) Float64X

func (s *UserTweetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserTweetSelect) Float64s

func (s *UserTweetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) Float64sX

func (s *UserTweetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserTweetSelect) Int

func (s *UserTweetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) IntX

func (s *UserTweetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserTweetSelect) Ints

func (s *UserTweetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) IntsX

func (s *UserTweetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserTweetSelect) Scan

func (uts *UserTweetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserTweetSelect) ScanX

func (s *UserTweetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserTweetSelect) String

func (s *UserTweetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) StringX

func (s *UserTweetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserTweetSelect) Strings

func (s *UserTweetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserTweetSelect) StringsX

func (s *UserTweetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserTweetUpdate

type UserTweetUpdate struct {
	// contains filtered or unexported fields
}

UserTweetUpdate is the builder for updating UserTweet entities.

func (*UserTweetUpdate) ClearTweet

func (utu *UserTweetUpdate) ClearTweet() *UserTweetUpdate

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*UserTweetUpdate) ClearUser

func (utu *UserTweetUpdate) ClearUser() *UserTweetUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserTweetUpdate) Exec

func (utu *UserTweetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTweetUpdate) ExecX

func (utu *UserTweetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetUpdate) Mutation

func (utu *UserTweetUpdate) Mutation() *UserTweetMutation

Mutation returns the UserTweetMutation object of the builder.

func (*UserTweetUpdate) Save

func (utu *UserTweetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserTweetUpdate) SaveX

func (utu *UserTweetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserTweetUpdate) SetCreatedAt

func (utu *UserTweetUpdate) SetCreatedAt(t time.Time) *UserTweetUpdate

SetCreatedAt sets the "created_at" field.

func (*UserTweetUpdate) SetNillableCreatedAt

func (utu *UserTweetUpdate) SetNillableCreatedAt(t *time.Time) *UserTweetUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserTweetUpdate) SetTweet

func (utu *UserTweetUpdate) SetTweet(t *Tweet) *UserTweetUpdate

SetTweet sets the "tweet" edge to the Tweet entity.

func (*UserTweetUpdate) SetTweetID

func (utu *UserTweetUpdate) SetTweetID(i int) *UserTweetUpdate

SetTweetID sets the "tweet_id" field.

func (*UserTweetUpdate) SetUser

func (utu *UserTweetUpdate) SetUser(u *User) *UserTweetUpdate

SetUser sets the "user" edge to the User entity.

func (*UserTweetUpdate) SetUserID

func (utu *UserTweetUpdate) SetUserID(i int) *UserTweetUpdate

SetUserID sets the "user_id" field.

func (*UserTweetUpdate) Where

Where appends a list predicates to the UserTweetUpdate builder.

type UserTweetUpdateOne

type UserTweetUpdateOne struct {
	// contains filtered or unexported fields
}

UserTweetUpdateOne is the builder for updating a single UserTweet entity.

func (*UserTweetUpdateOne) ClearTweet

func (utuo *UserTweetUpdateOne) ClearTweet() *UserTweetUpdateOne

ClearTweet clears the "tweet" edge to the Tweet entity.

func (*UserTweetUpdateOne) ClearUser

func (utuo *UserTweetUpdateOne) ClearUser() *UserTweetUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*UserTweetUpdateOne) Exec

func (utuo *UserTweetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserTweetUpdateOne) ExecX

func (utuo *UserTweetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetUpdateOne) Mutation

func (utuo *UserTweetUpdateOne) Mutation() *UserTweetMutation

Mutation returns the UserTweetMutation object of the builder.

func (*UserTweetUpdateOne) Save

func (utuo *UserTweetUpdateOne) Save(ctx context.Context) (*UserTweet, error)

Save executes the query and returns the updated UserTweet entity.

func (*UserTweetUpdateOne) SaveX

func (utuo *UserTweetUpdateOne) SaveX(ctx context.Context) *UserTweet

SaveX is like Save, but panics if an error occurs.

func (*UserTweetUpdateOne) Select

func (utuo *UserTweetUpdateOne) Select(field string, fields ...string) *UserTweetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserTweetUpdateOne) SetCreatedAt

func (utuo *UserTweetUpdateOne) SetCreatedAt(t time.Time) *UserTweetUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserTweetUpdateOne) SetNillableCreatedAt

func (utuo *UserTweetUpdateOne) SetNillableCreatedAt(t *time.Time) *UserTweetUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserTweetUpdateOne) SetTweet

func (utuo *UserTweetUpdateOne) SetTweet(t *Tweet) *UserTweetUpdateOne

SetTweet sets the "tweet" edge to the Tweet entity.

func (*UserTweetUpdateOne) SetTweetID

func (utuo *UserTweetUpdateOne) SetTweetID(i int) *UserTweetUpdateOne

SetTweetID sets the "tweet_id" field.

func (*UserTweetUpdateOne) SetUser

func (utuo *UserTweetUpdateOne) SetUser(u *User) *UserTweetUpdateOne

SetUser sets the "user" edge to the User entity.

func (*UserTweetUpdateOne) SetUserID

func (utuo *UserTweetUpdateOne) SetUserID(i int) *UserTweetUpdateOne

SetUserID sets the "user_id" field.

func (*UserTweetUpdateOne) Where added in v0.11.8

Where appends a list predicates to the UserTweetUpdate builder.

type UserTweetUpsert

type UserTweetUpsert struct {
	*sql.UpdateSet
}

UserTweetUpsert is the "OnConflict" setter.

func (*UserTweetUpsert) SetCreatedAt

func (u *UserTweetUpsert) SetCreatedAt(v time.Time) *UserTweetUpsert

SetCreatedAt sets the "created_at" field.

func (*UserTweetUpsert) SetTweetID

func (u *UserTweetUpsert) SetTweetID(v int) *UserTweetUpsert

SetTweetID sets the "tweet_id" field.

func (*UserTweetUpsert) SetUserID

func (u *UserTweetUpsert) SetUserID(v int) *UserTweetUpsert

SetUserID sets the "user_id" field.

func (*UserTweetUpsert) UpdateCreatedAt

func (u *UserTweetUpsert) UpdateCreatedAt() *UserTweetUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserTweetUpsert) UpdateTweetID

func (u *UserTweetUpsert) UpdateTweetID() *UserTweetUpsert

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

func (*UserTweetUpsert) UpdateUserID

func (u *UserTweetUpsert) UpdateUserID() *UserTweetUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserTweetUpsertBulk

type UserTweetUpsertBulk struct {
	// contains filtered or unexported fields
}

UserTweetUpsertBulk is the builder for "upsert"-ing a bulk of UserTweet nodes.

func (*UserTweetUpsertBulk) DoNothing

func (u *UserTweetUpsertBulk) DoNothing() *UserTweetUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserTweetUpsertBulk) Exec

Exec executes the query.

func (*UserTweetUpsertBulk) ExecX

func (u *UserTweetUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserTweet.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserTweetUpsertBulk) SetCreatedAt

func (u *UserTweetUpsertBulk) SetCreatedAt(v time.Time) *UserTweetUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*UserTweetUpsertBulk) SetTweetID

func (u *UserTweetUpsertBulk) SetTweetID(v int) *UserTweetUpsertBulk

SetTweetID sets the "tweet_id" field.

func (*UserTweetUpsertBulk) SetUserID

func (u *UserTweetUpsertBulk) SetUserID(v int) *UserTweetUpsertBulk

SetUserID sets the "user_id" field.

func (*UserTweetUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the UserTweetCreateBulk.OnConflict documentation for more info.

func (*UserTweetUpsertBulk) UpdateCreatedAt

func (u *UserTweetUpsertBulk) UpdateCreatedAt() *UserTweetUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserTweetUpsertBulk) UpdateNewValues

func (u *UserTweetUpsertBulk) UpdateNewValues() *UserTweetUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserTweet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserTweetUpsertBulk) UpdateTweetID

func (u *UserTweetUpsertBulk) UpdateTweetID() *UserTweetUpsertBulk

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

func (*UserTweetUpsertBulk) UpdateUserID

func (u *UserTweetUpsertBulk) UpdateUserID() *UserTweetUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserTweetUpsertOne

type UserTweetUpsertOne struct {
	// contains filtered or unexported fields
}

UserTweetUpsertOne is the builder for "upsert"-ing

one UserTweet node.

func (*UserTweetUpsertOne) DoNothing

func (u *UserTweetUpsertOne) DoNothing() *UserTweetUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserTweetUpsertOne) Exec

func (u *UserTweetUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTweetUpsertOne) ExecX

func (u *UserTweetUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTweetUpsertOne) ID

func (u *UserTweetUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserTweetUpsertOne) IDX

func (u *UserTweetUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*UserTweetUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserTweet.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserTweetUpsertOne) SetCreatedAt

func (u *UserTweetUpsertOne) SetCreatedAt(v time.Time) *UserTweetUpsertOne

SetCreatedAt sets the "created_at" field.

func (*UserTweetUpsertOne) SetTweetID

func (u *UserTweetUpsertOne) SetTweetID(v int) *UserTweetUpsertOne

SetTweetID sets the "tweet_id" field.

func (*UserTweetUpsertOne) SetUserID

func (u *UserTweetUpsertOne) SetUserID(v int) *UserTweetUpsertOne

SetUserID sets the "user_id" field.

func (*UserTweetUpsertOne) Update

func (u *UserTweetUpsertOne) Update(set func(*UserTweetUpsert)) *UserTweetUpsertOne

Update allows overriding fields `UPDATE` values. See the UserTweetCreate.OnConflict documentation for more info.

func (*UserTweetUpsertOne) UpdateCreatedAt

func (u *UserTweetUpsertOne) UpdateCreatedAt() *UserTweetUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserTweetUpsertOne) UpdateNewValues

func (u *UserTweetUpsertOne) UpdateNewValues() *UserTweetUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserTweet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserTweetUpsertOne) UpdateTweetID

func (u *UserTweetUpsertOne) UpdateTweetID() *UserTweetUpsertOne

UpdateTweetID sets the "tweet_id" field to the value that was provided on create.

func (*UserTweetUpsertOne) UpdateUserID

func (u *UserTweetUpsertOne) UpdateUserID() *UserTweetUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserTweets

type UserTweets []*UserTweet

UserTweets is a parsable slice of UserTweet.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddFriendIDs

func (uu *UserUpdate) AddFriendIDs(ids ...int) *UserUpdate

AddFriendIDs adds the "friends" edge to the User entity by IDs.

func (*UserUpdate) AddFriends

func (uu *UserUpdate) AddFriends(u ...*User) *UserUpdate

AddFriends adds the "friends" edges to the User entity.

func (*UserUpdate) AddFriendshipIDs

func (uu *UserUpdate) AddFriendshipIDs(ids ...int) *UserUpdate

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.

func (*UserUpdate) AddFriendships

func (uu *UserUpdate) AddFriendships(f ...*Friendship) *UserUpdate

AddFriendships adds the "friendships" edges to the Friendship entity.

func (*UserUpdate) AddGroupIDs

func (uu *UserUpdate) AddGroupIDs(ids ...int) *UserUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdate) AddGroups

func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdate) AddJoinedGroupIDs

func (uu *UserUpdate) AddJoinedGroupIDs(ids ...int) *UserUpdate

AddJoinedGroupIDs adds the "joined_groups" edge to the UserGroup entity by IDs.

func (*UserUpdate) AddJoinedGroups

func (uu *UserUpdate) AddJoinedGroups(u ...*UserGroup) *UserUpdate

AddJoinedGroups adds the "joined_groups" edges to the UserGroup entity.

func (*UserUpdate) AddLikedTweetIDs

func (uu *UserUpdate) AddLikedTweetIDs(ids ...int) *UserUpdate

AddLikedTweetIDs adds the "liked_tweets" edge to the Tweet entity by IDs.

func (*UserUpdate) AddLikedTweets

func (uu *UserUpdate) AddLikedTweets(t ...*Tweet) *UserUpdate

AddLikedTweets adds the "liked_tweets" edges to the Tweet entity.

func (*UserUpdate) AddRelativeIDs

func (uu *UserUpdate) AddRelativeIDs(ids ...int) *UserUpdate

AddRelativeIDs adds the "relatives" edge to the User entity by IDs.

func (*UserUpdate) AddRelatives

func (uu *UserUpdate) AddRelatives(u ...*User) *UserUpdate

AddRelatives adds the "relatives" edges to the User entity.

func (*UserUpdate) AddRoleIDs added in v0.11.1

func (uu *UserUpdate) AddRoleIDs(ids ...int) *UserUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdate) AddRoles added in v0.11.1

func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdate) AddTweetIDs

func (uu *UserUpdate) AddTweetIDs(ids ...int) *UserUpdate

AddTweetIDs adds the "tweets" edge to the Tweet entity by IDs.

func (*UserUpdate) AddTweets

func (uu *UserUpdate) AddTweets(t ...*Tweet) *UserUpdate

AddTweets adds the "tweets" edges to the Tweet entity.

func (*UserUpdate) AddUserTweetIDs

func (uu *UserUpdate) AddUserTweetIDs(ids ...int) *UserUpdate

AddUserTweetIDs adds the "user_tweets" edge to the UserTweet entity by IDs.

func (*UserUpdate) AddUserTweets

func (uu *UserUpdate) AddUserTweets(u ...*UserTweet) *UserUpdate

AddUserTweets adds the "user_tweets" edges to the UserTweet entity.

func (*UserUpdate) ClearFriends

func (uu *UserUpdate) ClearFriends() *UserUpdate

ClearFriends clears all "friends" edges to the User entity.

func (*UserUpdate) ClearFriendships

func (uu *UserUpdate) ClearFriendships() *UserUpdate

ClearFriendships clears all "friendships" edges to the Friendship entity.

func (*UserUpdate) ClearGroups

func (uu *UserUpdate) ClearGroups() *UserUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdate) ClearJoinedGroups

func (uu *UserUpdate) ClearJoinedGroups() *UserUpdate

ClearJoinedGroups clears all "joined_groups" edges to the UserGroup entity.

func (*UserUpdate) ClearLikedTweets

func (uu *UserUpdate) ClearLikedTweets() *UserUpdate

ClearLikedTweets clears all "liked_tweets" edges to the Tweet entity.

func (*UserUpdate) ClearRelatives

func (uu *UserUpdate) ClearRelatives() *UserUpdate

ClearRelatives clears all "relatives" edges to the User entity.

func (*UserUpdate) ClearRoles added in v0.11.1

func (uu *UserUpdate) ClearRoles() *UserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdate) ClearTweets

func (uu *UserUpdate) ClearTweets() *UserUpdate

ClearTweets clears all "tweets" edges to the Tweet entity.

func (*UserUpdate) ClearUserTweets

func (uu *UserUpdate) ClearUserTweets() *UserUpdate

ClearUserTweets clears all "user_tweets" edges to the UserTweet entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveFriendIDs

func (uu *UserUpdate) RemoveFriendIDs(ids ...int) *UserUpdate

RemoveFriendIDs removes the "friends" edge to User entities by IDs.

func (*UserUpdate) RemoveFriends

func (uu *UserUpdate) RemoveFriends(u ...*User) *UserUpdate

RemoveFriends removes "friends" edges to User entities.

func (*UserUpdate) RemoveFriendshipIDs

func (uu *UserUpdate) RemoveFriendshipIDs(ids ...int) *UserUpdate

RemoveFriendshipIDs removes the "friendships" edge to Friendship entities by IDs.

func (*UserUpdate) RemoveFriendships

func (uu *UserUpdate) RemoveFriendships(f ...*Friendship) *UserUpdate

RemoveFriendships removes "friendships" edges to Friendship entities.

func (*UserUpdate) RemoveGroupIDs

func (uu *UserUpdate) RemoveGroupIDs(ids ...int) *UserUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdate) RemoveGroups

func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdate) RemoveJoinedGroupIDs

func (uu *UserUpdate) RemoveJoinedGroupIDs(ids ...int) *UserUpdate

RemoveJoinedGroupIDs removes the "joined_groups" edge to UserGroup entities by IDs.

func (*UserUpdate) RemoveJoinedGroups

func (uu *UserUpdate) RemoveJoinedGroups(u ...*UserGroup) *UserUpdate

RemoveJoinedGroups removes "joined_groups" edges to UserGroup entities.

func (*UserUpdate) RemoveLikedTweetIDs

func (uu *UserUpdate) RemoveLikedTweetIDs(ids ...int) *UserUpdate

RemoveLikedTweetIDs removes the "liked_tweets" edge to Tweet entities by IDs.

func (*UserUpdate) RemoveLikedTweets

func (uu *UserUpdate) RemoveLikedTweets(t ...*Tweet) *UserUpdate

RemoveLikedTweets removes "liked_tweets" edges to Tweet entities.

func (*UserUpdate) RemoveRelativeIDs

func (uu *UserUpdate) RemoveRelativeIDs(ids ...int) *UserUpdate

RemoveRelativeIDs removes the "relatives" edge to User entities by IDs.

func (*UserUpdate) RemoveRelatives

func (uu *UserUpdate) RemoveRelatives(u ...*User) *UserUpdate

RemoveRelatives removes "relatives" edges to User entities.

func (*UserUpdate) RemoveRoleIDs added in v0.11.1

func (uu *UserUpdate) RemoveRoleIDs(ids ...int) *UserUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdate) RemoveRoles added in v0.11.1

func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdate) RemoveTweetIDs

func (uu *UserUpdate) RemoveTweetIDs(ids ...int) *UserUpdate

RemoveTweetIDs removes the "tweets" edge to Tweet entities by IDs.

func (*UserUpdate) RemoveTweets

func (uu *UserUpdate) RemoveTweets(t ...*Tweet) *UserUpdate

RemoveTweets removes "tweets" edges to Tweet entities.

func (*UserUpdate) RemoveUserTweetIDs

func (uu *UserUpdate) RemoveUserTweetIDs(ids ...int) *UserUpdate

RemoveUserTweetIDs removes the "user_tweets" edge to UserTweet entities by IDs.

func (*UserUpdate) RemoveUserTweets

func (uu *UserUpdate) RemoveUserTweets(u ...*UserTweet) *UserUpdate

RemoveUserTweets removes "user_tweets" edges to UserTweet entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddFriendIDs

func (uuo *UserUpdateOne) AddFriendIDs(ids ...int) *UserUpdateOne

AddFriendIDs adds the "friends" edge to the User entity by IDs.

func (*UserUpdateOne) AddFriends

func (uuo *UserUpdateOne) AddFriends(u ...*User) *UserUpdateOne

AddFriends adds the "friends" edges to the User entity.

func (*UserUpdateOne) AddFriendshipIDs

func (uuo *UserUpdateOne) AddFriendshipIDs(ids ...int) *UserUpdateOne

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.

func (*UserUpdateOne) AddFriendships

func (uuo *UserUpdateOne) AddFriendships(f ...*Friendship) *UserUpdateOne

AddFriendships adds the "friendships" edges to the Friendship entity.

func (*UserUpdateOne) AddGroupIDs

func (uuo *UserUpdateOne) AddGroupIDs(ids ...int) *UserUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdateOne) AddGroups

func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdateOne) AddJoinedGroupIDs

func (uuo *UserUpdateOne) AddJoinedGroupIDs(ids ...int) *UserUpdateOne

AddJoinedGroupIDs adds the "joined_groups" edge to the UserGroup entity by IDs.

func (*UserUpdateOne) AddJoinedGroups

func (uuo *UserUpdateOne) AddJoinedGroups(u ...*UserGroup) *UserUpdateOne

AddJoinedGroups adds the "joined_groups" edges to the UserGroup entity.

func (*UserUpdateOne) AddLikedTweetIDs

func (uuo *UserUpdateOne) AddLikedTweetIDs(ids ...int) *UserUpdateOne

AddLikedTweetIDs adds the "liked_tweets" edge to the Tweet entity by IDs.

func (*UserUpdateOne) AddLikedTweets

func (uuo *UserUpdateOne) AddLikedTweets(t ...*Tweet) *UserUpdateOne

AddLikedTweets adds the "liked_tweets" edges to the Tweet entity.

func (*UserUpdateOne) AddRelativeIDs

func (uuo *UserUpdateOne) AddRelativeIDs(ids ...int) *UserUpdateOne

AddRelativeIDs adds the "relatives" edge to the User entity by IDs.

func (*UserUpdateOne) AddRelatives

func (uuo *UserUpdateOne) AddRelatives(u ...*User) *UserUpdateOne

AddRelatives adds the "relatives" edges to the User entity.

func (*UserUpdateOne) AddRoleIDs added in v0.11.1

func (uuo *UserUpdateOne) AddRoleIDs(ids ...int) *UserUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdateOne) AddRoles added in v0.11.1

func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdateOne) AddTweetIDs

func (uuo *UserUpdateOne) AddTweetIDs(ids ...int) *UserUpdateOne

AddTweetIDs adds the "tweets" edge to the Tweet entity by IDs.

func (*UserUpdateOne) AddTweets

func (uuo *UserUpdateOne) AddTweets(t ...*Tweet) *UserUpdateOne

AddTweets adds the "tweets" edges to the Tweet entity.

func (*UserUpdateOne) AddUserTweetIDs

func (uuo *UserUpdateOne) AddUserTweetIDs(ids ...int) *UserUpdateOne

AddUserTweetIDs adds the "user_tweets" edge to the UserTweet entity by IDs.

func (*UserUpdateOne) AddUserTweets

func (uuo *UserUpdateOne) AddUserTweets(u ...*UserTweet) *UserUpdateOne

AddUserTweets adds the "user_tweets" edges to the UserTweet entity.

func (*UserUpdateOne) ClearFriends

func (uuo *UserUpdateOne) ClearFriends() *UserUpdateOne

ClearFriends clears all "friends" edges to the User entity.

func (*UserUpdateOne) ClearFriendships

func (uuo *UserUpdateOne) ClearFriendships() *UserUpdateOne

ClearFriendships clears all "friendships" edges to the Friendship entity.

func (*UserUpdateOne) ClearGroups

func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdateOne) ClearJoinedGroups

func (uuo *UserUpdateOne) ClearJoinedGroups() *UserUpdateOne

ClearJoinedGroups clears all "joined_groups" edges to the UserGroup entity.

func (*UserUpdateOne) ClearLikedTweets

func (uuo *UserUpdateOne) ClearLikedTweets() *UserUpdateOne

ClearLikedTweets clears all "liked_tweets" edges to the Tweet entity.

func (*UserUpdateOne) ClearRelatives

func (uuo *UserUpdateOne) ClearRelatives() *UserUpdateOne

ClearRelatives clears all "relatives" edges to the User entity.

func (*UserUpdateOne) ClearRoles added in v0.11.1

func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdateOne) ClearTweets

func (uuo *UserUpdateOne) ClearTweets() *UserUpdateOne

ClearTweets clears all "tweets" edges to the Tweet entity.

func (*UserUpdateOne) ClearUserTweets

func (uuo *UserUpdateOne) ClearUserTweets() *UserUpdateOne

ClearUserTweets clears all "user_tweets" edges to the UserTweet entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveFriendIDs

func (uuo *UserUpdateOne) RemoveFriendIDs(ids ...int) *UserUpdateOne

RemoveFriendIDs removes the "friends" edge to User entities by IDs.

func (*UserUpdateOne) RemoveFriends

func (uuo *UserUpdateOne) RemoveFriends(u ...*User) *UserUpdateOne

RemoveFriends removes "friends" edges to User entities.

func (*UserUpdateOne) RemoveFriendshipIDs

func (uuo *UserUpdateOne) RemoveFriendshipIDs(ids ...int) *UserUpdateOne

RemoveFriendshipIDs removes the "friendships" edge to Friendship entities by IDs.

func (*UserUpdateOne) RemoveFriendships

func (uuo *UserUpdateOne) RemoveFriendships(f ...*Friendship) *UserUpdateOne

RemoveFriendships removes "friendships" edges to Friendship entities.

func (*UserUpdateOne) RemoveGroupIDs

func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...int) *UserUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdateOne) RemoveGroups

func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdateOne) RemoveJoinedGroupIDs

func (uuo *UserUpdateOne) RemoveJoinedGroupIDs(ids ...int) *UserUpdateOne

RemoveJoinedGroupIDs removes the "joined_groups" edge to UserGroup entities by IDs.

func (*UserUpdateOne) RemoveJoinedGroups

func (uuo *UserUpdateOne) RemoveJoinedGroups(u ...*UserGroup) *UserUpdateOne

RemoveJoinedGroups removes "joined_groups" edges to UserGroup entities.

func (*UserUpdateOne) RemoveLikedTweetIDs

func (uuo *UserUpdateOne) RemoveLikedTweetIDs(ids ...int) *UserUpdateOne

RemoveLikedTweetIDs removes the "liked_tweets" edge to Tweet entities by IDs.

func (*UserUpdateOne) RemoveLikedTweets

func (uuo *UserUpdateOne) RemoveLikedTweets(t ...*Tweet) *UserUpdateOne

RemoveLikedTweets removes "liked_tweets" edges to Tweet entities.

func (*UserUpdateOne) RemoveRelativeIDs

func (uuo *UserUpdateOne) RemoveRelativeIDs(ids ...int) *UserUpdateOne

RemoveRelativeIDs removes the "relatives" edge to User entities by IDs.

func (*UserUpdateOne) RemoveRelatives

func (uuo *UserUpdateOne) RemoveRelatives(u ...*User) *UserUpdateOne

RemoveRelatives removes "relatives" edges to User entities.

func (*UserUpdateOne) RemoveRoleIDs added in v0.11.1

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int) *UserUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdateOne) RemoveRoles added in v0.11.1

func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdateOne) RemoveTweetIDs

func (uuo *UserUpdateOne) RemoveTweetIDs(ids ...int) *UserUpdateOne

RemoveTweetIDs removes the "tweets" edge to Tweet entities by IDs.

func (*UserUpdateOne) RemoveTweets

func (uuo *UserUpdateOne) RemoveTweets(t ...*Tweet) *UserUpdateOne

RemoveTweets removes "tweets" edges to Tweet entities.

func (*UserUpdateOne) RemoveUserTweetIDs

func (uuo *UserUpdateOne) RemoveUserTweetIDs(ids ...int) *UserUpdateOne

RemoveUserTweetIDs removes the "user_tweets" edge to UserTweet entities by IDs.

func (*UserUpdateOne) RemoveUserTweets

func (uuo *UserUpdateOne) RemoveUserTweets(u ...*UserTweet) *UserUpdateOne

RemoveUserTweets removes "user_tweets" edges to UserTweet entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) Where added in v0.11.8

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) SetName

func (u *UserUpsert) SetName(v string) *UserUpsert

SetName sets the "name" field.

func (*UserUpsert) UpdateName

func (u *UserUpsert) UpdateName() *UserUpsert

UpdateName sets the "name" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetName

func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk

SetName sets the "name" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateName

func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetName

func (u *UserUpsertOne) SetName(v string) *UserUpsertOne

SetName sets the "name" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateName

func (u *UserUpsertOne) UpdateName() *UserUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL