ent

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 30 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.
	TypeFriendship       = "Friendship"
	TypeGroup            = "Group"
	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 Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Friendship is the client for interacting with the Friendship builders.
	Friendship *FriendshipClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// 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().
	Friendship.
	Query().
	Count(ctx)

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 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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*FriendshipGroupBy) ScanX

func (s *FriendshipGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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.

type FriendshipQuery

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

FriendshipQuery is the builder for querying Friendship entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*FriendshipQuery) Offset

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

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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) ClearFriend

func (fu *FriendshipUpdate) ClearFriend() *FriendshipUpdate

ClearFriend clears the "friend" edge to the User entity.

func (*FriendshipUpdate) ClearUser

func (fu *FriendshipUpdate) ClearUser() *FriendshipUpdate

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

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) SetFriend

func (fu *FriendshipUpdate) SetFriend(u *User) *FriendshipUpdate

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

func (*FriendshipUpdate) SetFriendID

func (fu *FriendshipUpdate) SetFriendID(i int) *FriendshipUpdate

SetFriendID sets the "friend_id" 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) SetUser

func (fu *FriendshipUpdate) SetUser(u *User) *FriendshipUpdate

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

func (*FriendshipUpdate) SetUserID

func (fu *FriendshipUpdate) SetUserID(i int) *FriendshipUpdate

SetUserID sets the "user_id" field.

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) ClearFriend

func (fuo *FriendshipUpdateOne) ClearFriend() *FriendshipUpdateOne

ClearFriend clears the "friend" edge to the User entity.

func (*FriendshipUpdateOne) ClearUser

func (fuo *FriendshipUpdateOne) ClearUser() *FriendshipUpdateOne

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

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) SetFriend

func (fuo *FriendshipUpdateOne) SetFriend(u *User) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetFriendID

func (fuo *FriendshipUpdateOne) SetFriendID(i int) *FriendshipUpdateOne

SetFriendID sets the "friend_id" 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) SetUser

func (fuo *FriendshipUpdateOne) SetUser(u *User) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetUserID

func (fuo *FriendshipUpdateOne) SetUserID(i int) *FriendshipUpdateOne

SetUserID sets the "user_id" field.

func (*FriendshipUpdateOne) SetWeight

func (fuo *FriendshipUpdateOne) SetWeight(i int) *FriendshipUpdateOne

SetWeight sets the "weight" field.

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) SetFriendID

func (u *FriendshipUpsert) SetFriendID(v int) *FriendshipUpsert

SetFriendID sets the "friend_id" field.

func (*FriendshipUpsert) SetUserID

func (u *FriendshipUpsert) SetUserID(v int) *FriendshipUpsert

SetUserID sets the "user_id" 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) UpdateFriendID

func (u *FriendshipUpsert) UpdateFriendID() *FriendshipUpsert

UpdateFriendID sets the "friend_id" field to the value that was provided on create.

func (*FriendshipUpsert) UpdateUserID

func (u *FriendshipUpsert) UpdateUserID() *FriendshipUpsert

UpdateUserID sets the "user_id" 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) SetFriendID

func (u *FriendshipUpsertBulk) SetFriendID(v int) *FriendshipUpsertBulk

SetFriendID sets the "friend_id" field.

func (*FriendshipUpsertBulk) SetUserID

SetUserID sets the "user_id" 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) UpdateFriendID

func (u *FriendshipUpsertBulk) UpdateFriendID() *FriendshipUpsertBulk

UpdateFriendID sets the "friend_id" 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) UpdateUserID

func (u *FriendshipUpsertBulk) UpdateUserID() *FriendshipUpsertBulk

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

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) SetFriendID

func (u *FriendshipUpsertOne) SetFriendID(v int) *FriendshipUpsertOne

SetFriendID sets the "friend_id" field.

func (*FriendshipUpsertOne) SetUserID

func (u *FriendshipUpsertOne) SetUserID(v int) *FriendshipUpsertOne

SetUserID sets the "user_id" 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) UpdateFriendID

func (u *FriendshipUpsertOne) UpdateFriendID() *FriendshipUpsertOne

UpdateFriendID sets the "friend_id" 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) UpdateUserID

func (u *FriendshipUpsertOne) UpdateUserID() *FriendshipUpsertOne

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

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) QueryJoinedUsers

func (gr *Group) QueryJoinedUsers() *UserGroupQuery

QueryJoinedUsers queries the "joined_users" 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

DeleteOne 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) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryJoinedUsers

func (c *GroupClient) QueryJoinedUsers(gr *Group) *UserGroupQuery

QueryJoinedUsers queries the joined_users 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) 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) 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.

type GroupEdges

type GroupEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// JoinedUsers holds the value of the joined_users edge.
	JoinedUsers []*UserGroup `json:"joined_users,omitempty"`
	// contains filtered or unexported fields
}

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

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) 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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*GroupGroupBy) ScanX

func (s *GroupGroupBy) ScanX(ctx context.Context, v interface{})

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) AddJoinedUserIDs

func (m *GroupMutation) AddJoinedUserIDs(ids ...int)

AddJoinedUserIDs adds the "joined_users" edge to the UserGroup 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) ClearJoinedUsers

func (m *GroupMutation) ClearJoinedUsers()

ClearJoinedUsers clears the "joined_users" edge to the UserGroup 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) 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) RemoveJoinedUserIDs

func (m *GroupMutation) RemoveJoinedUserIDs(ids ...int)

RemoveJoinedUserIDs removes the "joined_users" edge to the UserGroup 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) 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) 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) 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) 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) 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.

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

func (*GroupQuery) QueryJoinedUsers

func (gq *GroupQuery) QueryJoinedUsers() *UserGroupQuery

QueryJoinedUsers chains the current query on the "joined_users" 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) 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) 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) 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 interface{}) 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 interface{})

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 GroupUpdate

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

GroupUpdate is the builder for updating Group entities.

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) 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) ClearJoinedUsers

func (gu *GroupUpdate) ClearJoinedUsers() *GroupUpdate

ClearJoinedUsers clears all "joined_users" edges to the UserGroup 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) 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) 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) 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) 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) ClearJoinedUsers

func (guo *GroupUpdateOne) ClearJoinedUsers() *GroupUpdateOne

ClearJoinedUsers clears all "joined_users" edges to the UserGroup 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) 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) 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.

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 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(...interface{})) 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 Query

type Query = ent.Query

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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*RelationshipGroupBy) ScanX

func (s *RelationshipGroupBy) ScanX(ctx context.Context, v interface{})

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

DeleteOne 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) 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.

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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*RelationshipInfoGroupBy) ScanX

func (s *RelationshipInfoGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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.

type RelationshipInfoQuery

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

RelationshipInfoQuery is the builder for querying RelationshipInfo entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*RelationshipInfoQuery) Offset

func (riq *RelationshipInfoQuery) Offset(offset int) *RelationshipInfoQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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) 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) 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.

type RelationshipQuery

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

RelationshipQuery is the builder for querying Relationship entities.

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) 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 adds a limit step to the query.

func (*RelationshipQuery) Offset

func (rq *RelationshipQuery) Offset(offset int) *RelationshipQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by 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 interface{})

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) 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) 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.

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) 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) 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) ([]int, 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 adds a limit step to the query.

func (*RoleQuery) Offset added in v0.11.1

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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) 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.

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 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 interface{}) error

Scan applies the group-by 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 interface{})

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) 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) 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.

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) 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) 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 adds a limit step to the query.

func (*RoleUserQuery) Offset added in v0.11.1

func (ruq *RoleUserQuery) Offset(offset int) *RoleUserQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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) 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

DeleteOne 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) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for 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) 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.

type TagEdges

type TagEdges struct {
	// Tweets holds the value of the tweets edge.
	Tweets []*Tweet `json:"tweets,omitempty"`
	// TweetTags holds the value of the tweet_tags edge.
	TweetTags []*TweetTag `json:"tweet_tags,omitempty"`
	// contains filtered or unexported fields
}

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

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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) 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) 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) 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) 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) 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.

type TagQuery

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

TagQuery is the builder for querying Tag entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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) 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 interface{}) 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 interface{})

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) 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) 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) 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) 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) 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) 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.

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 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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TweetGroupBy) ScanX

func (s *TweetGroupBy) ScanX(ctx context.Context, v interface{})

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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TweetLikeGroupBy) ScanX

func (s *TweetLikeGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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.

type TweetLikeQuery

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

TweetLikeQuery is the builder for querying TweetLike entities.

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) 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 adds a limit step to the query.

func (*TweetLikeQuery) Offset

func (tlq *TweetLikeQuery) Offset(offset int) *TweetLikeQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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) 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) 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.

type TweetQuery

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

TweetQuery is the builder for querying Tweet entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*TweetQuery) Offset

func (tq *TweetQuery) Offset(offset int) *TweetQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TweetTagGroupBy) ScanX

func (s *TweetTagGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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.

type TweetTagQuery

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

TweetTagQuery is the builder for querying TweetTag entities.

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) 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) ([]uuid.UUID, 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 adds a limit step to the query.

func (*TweetTagQuery) Offset

func (ttq *TweetTagQuery) Offset(offset int) *TweetTagQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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.

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 {

	// Friendship is the client for interacting with the Friendship builders.
	Friendship *FriendshipClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// 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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupGroupBy) ScanX

func (s *UserGroupGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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.

type UserGroupQuery

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

UserGroupQuery is the builder for querying UserGroup entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*UserGroupQuery) Offset

func (ugq *UserGroupQuery) Offset(offset int) *UserGroupQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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) 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) 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.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id 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) ([]int, 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 adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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

DeleteOne 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) 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.

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 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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserTweetGroupBy) ScanX

func (s *UserTweetGroupBy) ScanX(ctx context.Context, v interface{})

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) 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) 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.

type UserTweetQuery

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

UserTweetQuery is the builder for querying UserTweet entities.

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) 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) ([]int, 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 adds a limit step to the query.

func (*UserTweetQuery) Offset

func (utq *UserTweetQuery) Offset(offset int) *UserTweetQuery

Offset adds an offset step to the query.

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 adds an order step to the query.

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) 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 interface{}) 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 interface{})

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.

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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL