ent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: GPL-3.0 Imports: 24 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.
	TypeFeed         = "Feed"
	TypeItem         = "Item"
	TypeRead         = "Read"
	TypeSubscription = "Subscription"
	TypeToken        = "Token"
	TypeUser         = "User"
)

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
	// Feed is the client for interacting with the Feed builders.
	Feed *FeedClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// Read is the client for interacting with the Read builders.
	Read *ReadClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	Feed.
	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 Feed

type Feed struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"-"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// FeedTitle holds the value of the "feed_title" field.
	FeedTitle string `json:"feed_title,omitempty"`
	// FeedDescription holds the value of the "feed_description" field.
	FeedDescription string `json:"feed_description,omitempty"`
	// FeedLink holds the value of the "feed_link" field.
	FeedLink string `json:"feed_link,omitempty"`
	// FeedFeedLink holds the value of the "feed_feed_link" field.
	FeedFeedLink string `json:"feed_feed_link,omitempty"`
	// FeedUpdated holds the value of the "feed_updated" field.
	FeedUpdated time.Time `json:"feed_updated,omitempty"`
	// FeedPublished holds the value of the "feed_published" field.
	FeedPublished time.Time `json:"feed_published,omitempty"`
	// FeedAuthorName holds the value of the "feed_author_name" field.
	FeedAuthorName string `json:"feed_author_name,omitempty"`
	// FeedAuthorEmail holds the value of the "feed_author_email" field.
	FeedAuthorEmail string `json:"feed_author_email,omitempty"`
	// FeedLanguage holds the value of the "feed_language" field.
	FeedLanguage string `json:"feed_language,omitempty"`
	// FeedImageTitle holds the value of the "feed_image_title" field.
	FeedImageTitle string `json:"feed_image_title,omitempty"`
	// FeedImageURL holds the value of the "feed_image_url" field.
	FeedImageURL string `json:"feed_image_url,omitempty"`
	// FeedCopyright holds the value of the "feed_copyright" field.
	FeedCopyright string `json:"feed_copyright,omitempty"`
	// FeedGenerator holds the value of the "feed_generator" field.
	FeedGenerator string `json:"feed_generator,omitempty"`
	// FeedCategories holds the value of the "feed_categories" field.
	FeedCategories string `json:"feed_categories,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FeedQuery when eager-loading is set.
	Edges FeedEdges `json:"edges"`
	// contains filtered or unexported fields
}

Feed is the model entity for the Feed schema.

func (*Feed) QueryItems

func (f *Feed) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Feed entity.

func (*Feed) QuerySubscribedUsers

func (f *Feed) QuerySubscribedUsers() *UserQuery

QuerySubscribedUsers queries the "subscribed_users" edge of the Feed entity.

func (*Feed) QuerySubscriptions

func (f *Feed) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions queries the "subscriptions" edge of the Feed entity.

func (*Feed) String

func (f *Feed) String() string

String implements the fmt.Stringer.

func (*Feed) Unwrap

func (f *Feed) Unwrap() *Feed

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

func (f *Feed) Update() *FeedUpdateOne

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

type FeedClient

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

FeedClient is a client for the Feed schema.

func NewFeedClient

func NewFeedClient(c config) *FeedClient

NewFeedClient returns a client for the Feed from the given config.

func (*FeedClient) Create

func (c *FeedClient) Create() *FeedCreate

Create returns a builder for creating a Feed entity.

func (*FeedClient) CreateBulk

func (c *FeedClient) CreateBulk(builders ...*FeedCreate) *FeedCreateBulk

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

func (*FeedClient) Delete

func (c *FeedClient) Delete() *FeedDelete

Delete returns a delete builder for Feed.

func (*FeedClient) DeleteOne

func (c *FeedClient) DeleteOne(f *Feed) *FeedDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FeedClient) DeleteOneID

func (c *FeedClient) DeleteOneID(id uuid.UUID) *FeedDeleteOne

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

func (*FeedClient) Get

func (c *FeedClient) Get(ctx context.Context, id uuid.UUID) (*Feed, error)

Get returns a Feed entity by its id.

func (*FeedClient) GetX

func (c *FeedClient) GetX(ctx context.Context, id uuid.UUID) *Feed

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

func (*FeedClient) Hooks

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

Hooks returns the client hooks.

func (*FeedClient) Query

func (c *FeedClient) Query() *FeedQuery

Query returns a query builder for Feed.

func (*FeedClient) QueryItems

func (c *FeedClient) QueryItems(f *Feed) *ItemQuery

QueryItems queries the items edge of a Feed.

func (*FeedClient) QuerySubscribedUsers

func (c *FeedClient) QuerySubscribedUsers(f *Feed) *UserQuery

QuerySubscribedUsers queries the subscribed_users edge of a Feed.

func (*FeedClient) QuerySubscriptions

func (c *FeedClient) QuerySubscriptions(f *Feed) *SubscriptionQuery

QuerySubscriptions queries the subscriptions edge of a Feed.

func (*FeedClient) Update

func (c *FeedClient) Update() *FeedUpdate

Update returns an update builder for Feed.

func (*FeedClient) UpdateOne

func (c *FeedClient) UpdateOne(f *Feed) *FeedUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FeedClient) UpdateOneID

func (c *FeedClient) UpdateOneID(id uuid.UUID) *FeedUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FeedClient) Use

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

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

type FeedCreate

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

FeedCreate is the builder for creating a Feed entity.

func (*FeedCreate) AddItemIDs

func (fc *FeedCreate) AddItemIDs(ids ...uuid.UUID) *FeedCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*FeedCreate) AddItems

func (fc *FeedCreate) AddItems(i ...*Item) *FeedCreate

AddItems adds the "items" edges to the Item entity.

func (*FeedCreate) AddSubscribedUserIDs

func (fc *FeedCreate) AddSubscribedUserIDs(ids ...uuid.UUID) *FeedCreate

AddSubscribedUserIDs adds the "subscribed_users" edge to the User entity by IDs.

func (*FeedCreate) AddSubscribedUsers

func (fc *FeedCreate) AddSubscribedUsers(u ...*User) *FeedCreate

AddSubscribedUsers adds the "subscribed_users" edges to the User entity.

func (*FeedCreate) AddSubscriptionIDs

func (fc *FeedCreate) AddSubscriptionIDs(ids ...uuid.UUID) *FeedCreate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*FeedCreate) AddSubscriptions

func (fc *FeedCreate) AddSubscriptions(s ...*Subscription) *FeedCreate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*FeedCreate) Exec

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

Exec executes the query.

func (*FeedCreate) ExecX

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

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

func (*FeedCreate) Mutation

func (fc *FeedCreate) Mutation() *FeedMutation

Mutation returns the FeedMutation object of the builder.

func (*FeedCreate) OnConflict

func (fc *FeedCreate) OnConflict(opts ...sql.ConflictOption) *FeedUpsertOne

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

client.Feed.Create().
	SetURL(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.FeedUpsert) {
		SetURL(v+v).
	}).
	Exec(ctx)

func (*FeedCreate) OnConflictColumns

func (fc *FeedCreate) OnConflictColumns(columns ...string) *FeedUpsertOne

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

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

func (*FeedCreate) Save

func (fc *FeedCreate) Save(ctx context.Context) (*Feed, error)

Save creates the Feed in the database.

func (*FeedCreate) SaveX

func (fc *FeedCreate) SaveX(ctx context.Context) *Feed

SaveX calls Save and panics if Save returns an error.

func (*FeedCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedCreate) SetDeletedAt

func (fc *FeedCreate) SetDeletedAt(t time.Time) *FeedCreate

SetDeletedAt sets the "deleted_at" field.

func (*FeedCreate) SetFeedAuthorEmail

func (fc *FeedCreate) SetFeedAuthorEmail(s string) *FeedCreate

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedCreate) SetFeedAuthorName

func (fc *FeedCreate) SetFeedAuthorName(s string) *FeedCreate

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedCreate) SetFeedCategories

func (fc *FeedCreate) SetFeedCategories(s string) *FeedCreate

SetFeedCategories sets the "feed_categories" field.

func (*FeedCreate) SetFeedCopyright

func (fc *FeedCreate) SetFeedCopyright(s string) *FeedCreate

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedCreate) SetFeedDescription

func (fc *FeedCreate) SetFeedDescription(s string) *FeedCreate

SetFeedDescription sets the "feed_description" field.

func (fc *FeedCreate) SetFeedFeedLink(s string) *FeedCreate

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedCreate) SetFeedGenerator

func (fc *FeedCreate) SetFeedGenerator(s string) *FeedCreate

SetFeedGenerator sets the "feed_generator" field.

func (*FeedCreate) SetFeedImageTitle

func (fc *FeedCreate) SetFeedImageTitle(s string) *FeedCreate

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedCreate) SetFeedImageURL

func (fc *FeedCreate) SetFeedImageURL(s string) *FeedCreate

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedCreate) SetFeedLanguage

func (fc *FeedCreate) SetFeedLanguage(s string) *FeedCreate

SetFeedLanguage sets the "feed_language" field.

func (fc *FeedCreate) SetFeedLink(s string) *FeedCreate

SetFeedLink sets the "feed_link" field.

func (*FeedCreate) SetFeedPublished

func (fc *FeedCreate) SetFeedPublished(t time.Time) *FeedCreate

SetFeedPublished sets the "feed_published" field.

func (*FeedCreate) SetFeedTitle

func (fc *FeedCreate) SetFeedTitle(s string) *FeedCreate

SetFeedTitle sets the "feed_title" field.

func (*FeedCreate) SetFeedUpdated

func (fc *FeedCreate) SetFeedUpdated(t time.Time) *FeedCreate

SetFeedUpdated sets the "feed_updated" field.

func (*FeedCreate) SetID

func (fc *FeedCreate) SetID(u uuid.UUID) *FeedCreate

SetID sets the "id" field.

func (*FeedCreate) SetNillableCreatedAt

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

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

func (*FeedCreate) SetNillableDeletedAt

func (fc *FeedCreate) SetNillableDeletedAt(t *time.Time) *FeedCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FeedCreate) SetNillableFeedAuthorEmail

func (fc *FeedCreate) SetNillableFeedAuthorEmail(s *string) *FeedCreate

SetNillableFeedAuthorEmail sets the "feed_author_email" field if the given value is not nil.

func (*FeedCreate) SetNillableFeedAuthorName

func (fc *FeedCreate) SetNillableFeedAuthorName(s *string) *FeedCreate

SetNillableFeedAuthorName sets the "feed_author_name" field if the given value is not nil.

func (*FeedCreate) SetNillableFeedImageTitle

func (fc *FeedCreate) SetNillableFeedImageTitle(s *string) *FeedCreate

SetNillableFeedImageTitle sets the "feed_image_title" field if the given value is not nil.

func (*FeedCreate) SetNillableFeedImageURL

func (fc *FeedCreate) SetNillableFeedImageURL(s *string) *FeedCreate

SetNillableFeedImageURL sets the "feed_image_url" field if the given value is not nil.

func (*FeedCreate) SetNillableID

func (fc *FeedCreate) SetNillableID(u *uuid.UUID) *FeedCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*FeedCreate) SetNillablePassword

func (fc *FeedCreate) SetNillablePassword(s *string) *FeedCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*FeedCreate) SetNillableUpdatedAt

func (fc *FeedCreate) SetNillableUpdatedAt(t *time.Time) *FeedCreate

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

func (*FeedCreate) SetNillableUsername

func (fc *FeedCreate) SetNillableUsername(s *string) *FeedCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*FeedCreate) SetPassword

func (fc *FeedCreate) SetPassword(s string) *FeedCreate

SetPassword sets the "password" field.

func (*FeedCreate) SetURL

func (fc *FeedCreate) SetURL(s string) *FeedCreate

SetURL sets the "url" field.

func (*FeedCreate) SetUpdatedAt

func (fc *FeedCreate) SetUpdatedAt(t time.Time) *FeedCreate

SetUpdatedAt sets the "updated_at" field.

func (*FeedCreate) SetUsername

func (fc *FeedCreate) SetUsername(s string) *FeedCreate

SetUsername sets the "username" field.

type FeedCreateBulk

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

FeedCreateBulk is the builder for creating many Feed entities in bulk.

func (*FeedCreateBulk) Exec

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

Exec executes the query.

func (*FeedCreateBulk) ExecX

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

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

func (*FeedCreateBulk) OnConflict

func (fcb *FeedCreateBulk) OnConflict(opts ...sql.ConflictOption) *FeedUpsertBulk

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

client.Feed.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.FeedUpsert) {
		SetURL(v+v).
	}).
	Exec(ctx)

func (*FeedCreateBulk) OnConflictColumns

func (fcb *FeedCreateBulk) OnConflictColumns(columns ...string) *FeedUpsertBulk

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

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

func (*FeedCreateBulk) Save

func (fcb *FeedCreateBulk) Save(ctx context.Context) ([]*Feed, error)

Save creates the Feed entities in the database.

func (*FeedCreateBulk) SaveX

func (fcb *FeedCreateBulk) SaveX(ctx context.Context) []*Feed

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

type FeedDelete

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

FeedDelete is the builder for deleting a Feed entity.

func (*FeedDelete) Exec

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

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

func (*FeedDelete) ExecX

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

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

func (*FeedDelete) Where

func (fd *FeedDelete) Where(ps ...predicate.Feed) *FeedDelete

Where appends a list predicates to the FeedDelete builder.

type FeedDeleteOne

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

FeedDeleteOne is the builder for deleting a single Feed entity.

func (*FeedDeleteOne) Exec

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

Exec executes the deletion query.

func (*FeedDeleteOne) ExecX

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

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

type FeedEdges

type FeedEdges struct {
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// SubscribedUsers holds the value of the subscribed_users edge.
	SubscribedUsers []*User `json:"subscribed_users,omitempty"`
	// Subscriptions holds the value of the subscriptions edge.
	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
	// contains filtered or unexported fields
}

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

func (FeedEdges) ItemsOrErr

func (e FeedEdges) ItemsOrErr() ([]*Item, error)

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

func (FeedEdges) SubscribedUsersOrErr

func (e FeedEdges) SubscribedUsersOrErr() ([]*User, error)

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

func (FeedEdges) SubscriptionsOrErr

func (e FeedEdges) SubscriptionsOrErr() ([]*Subscription, error)

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

type FeedGroupBy

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

FeedGroupBy is the group-by builder for Feed entities.

func (*FeedGroupBy) Aggregate

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

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

func (*FeedGroupBy) Bool

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

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

func (*FeedGroupBy) BoolX

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

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

func (*FeedGroupBy) Bools

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

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

func (*FeedGroupBy) BoolsX

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

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

func (*FeedGroupBy) Float64

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

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

func (*FeedGroupBy) Float64X

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

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

func (*FeedGroupBy) Float64s

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

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

func (*FeedGroupBy) Float64sX

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

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

func (*FeedGroupBy) Int

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

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

func (*FeedGroupBy) IntX

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

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

func (*FeedGroupBy) Ints

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

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

func (*FeedGroupBy) IntsX

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

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

func (*FeedGroupBy) Scan

func (fgb *FeedGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*FeedGroupBy) ScanX

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

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

func (*FeedGroupBy) String

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

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

func (*FeedGroupBy) StringX

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

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

func (*FeedGroupBy) Strings

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

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

func (*FeedGroupBy) StringsX

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

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

type FeedMutation

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

FeedMutation represents an operation that mutates the Feed nodes in the graph.

func (*FeedMutation) AddField

func (m *FeedMutation) 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 (*FeedMutation) AddItemIDs

func (m *FeedMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*FeedMutation) AddSubscribedUserIDs

func (m *FeedMutation) AddSubscribedUserIDs(ids ...uuid.UUID)

AddSubscribedUserIDs adds the "subscribed_users" edge to the User entity by ids.

func (*FeedMutation) AddSubscriptionIDs

func (m *FeedMutation) AddSubscriptionIDs(ids ...uuid.UUID)

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by ids.

func (*FeedMutation) AddedEdges

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

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

func (*FeedMutation) AddedField

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

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

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

func (*FeedMutation) AddedIDs

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

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

func (*FeedMutation) ClearDeletedAt

func (m *FeedMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeedMutation) ClearEdge

func (m *FeedMutation) 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 (*FeedMutation) ClearFeedAuthorEmail

func (m *FeedMutation) ClearFeedAuthorEmail()

ClearFeedAuthorEmail clears the value of the "feed_author_email" field.

func (*FeedMutation) ClearFeedAuthorName

func (m *FeedMutation) ClearFeedAuthorName()

ClearFeedAuthorName clears the value of the "feed_author_name" field.

func (*FeedMutation) ClearFeedImageTitle

func (m *FeedMutation) ClearFeedImageTitle()

ClearFeedImageTitle clears the value of the "feed_image_title" field.

func (*FeedMutation) ClearFeedImageURL

func (m *FeedMutation) ClearFeedImageURL()

ClearFeedImageURL clears the value of the "feed_image_url" field.

func (*FeedMutation) ClearField

func (m *FeedMutation) 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 (*FeedMutation) ClearItems

func (m *FeedMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*FeedMutation) ClearSubscribedUsers

func (m *FeedMutation) ClearSubscribedUsers()

ClearSubscribedUsers clears the "subscribed_users" edge to the User entity.

func (*FeedMutation) ClearSubscriptions

func (m *FeedMutation) ClearSubscriptions()

ClearSubscriptions clears the "subscriptions" edge to the Subscription entity.

func (*FeedMutation) ClearedEdges

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

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

func (*FeedMutation) ClearedFields

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

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

func (FeedMutation) Client

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

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

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

func (*FeedMutation) DeletedAt

func (m *FeedMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*FeedMutation) DeletedAtCleared

func (m *FeedMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*FeedMutation) EdgeCleared

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

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

func (*FeedMutation) FeedAuthorEmail

func (m *FeedMutation) FeedAuthorEmail() (r string, exists bool)

FeedAuthorEmail returns the value of the "feed_author_email" field in the mutation.

func (*FeedMutation) FeedAuthorEmailCleared

func (m *FeedMutation) FeedAuthorEmailCleared() bool

FeedAuthorEmailCleared returns if the "feed_author_email" field was cleared in this mutation.

func (*FeedMutation) FeedAuthorName

func (m *FeedMutation) FeedAuthorName() (r string, exists bool)

FeedAuthorName returns the value of the "feed_author_name" field in the mutation.

func (*FeedMutation) FeedAuthorNameCleared

func (m *FeedMutation) FeedAuthorNameCleared() bool

FeedAuthorNameCleared returns if the "feed_author_name" field was cleared in this mutation.

func (*FeedMutation) FeedCategories

func (m *FeedMutation) FeedCategories() (r string, exists bool)

FeedCategories returns the value of the "feed_categories" field in the mutation.

func (*FeedMutation) FeedCopyright

func (m *FeedMutation) FeedCopyright() (r string, exists bool)

FeedCopyright returns the value of the "feed_copyright" field in the mutation.

func (*FeedMutation) FeedDescription

func (m *FeedMutation) FeedDescription() (r string, exists bool)

FeedDescription returns the value of the "feed_description" field in the mutation.

func (m *FeedMutation) FeedFeedLink() (r string, exists bool)

FeedFeedLink returns the value of the "feed_feed_link" field in the mutation.

func (*FeedMutation) FeedGenerator

func (m *FeedMutation) FeedGenerator() (r string, exists bool)

FeedGenerator returns the value of the "feed_generator" field in the mutation.

func (*FeedMutation) FeedImageTitle

func (m *FeedMutation) FeedImageTitle() (r string, exists bool)

FeedImageTitle returns the value of the "feed_image_title" field in the mutation.

func (*FeedMutation) FeedImageTitleCleared

func (m *FeedMutation) FeedImageTitleCleared() bool

FeedImageTitleCleared returns if the "feed_image_title" field was cleared in this mutation.

func (*FeedMutation) FeedImageURL

func (m *FeedMutation) FeedImageURL() (r string, exists bool)

FeedImageURL returns the value of the "feed_image_url" field in the mutation.

func (*FeedMutation) FeedImageURLCleared

func (m *FeedMutation) FeedImageURLCleared() bool

FeedImageURLCleared returns if the "feed_image_url" field was cleared in this mutation.

func (*FeedMutation) FeedLanguage

func (m *FeedMutation) FeedLanguage() (r string, exists bool)

FeedLanguage returns the value of the "feed_language" field in the mutation.

func (m *FeedMutation) FeedLink() (r string, exists bool)

FeedLink returns the value of the "feed_link" field in the mutation.

func (*FeedMutation) FeedPublished

func (m *FeedMutation) FeedPublished() (r time.Time, exists bool)

FeedPublished returns the value of the "feed_published" field in the mutation.

func (*FeedMutation) FeedTitle

func (m *FeedMutation) FeedTitle() (r string, exists bool)

FeedTitle returns the value of the "feed_title" field in the mutation.

func (*FeedMutation) FeedUpdated

func (m *FeedMutation) FeedUpdated() (r time.Time, exists bool)

FeedUpdated returns the value of the "feed_updated" field in the mutation.

func (*FeedMutation) Field

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

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

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

func (*FeedMutation) Fields

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

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

func (m *FeedMutation) 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 (*FeedMutation) ItemsCleared

func (m *FeedMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*FeedMutation) ItemsIDs

func (m *FeedMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*FeedMutation) OldCreatedAt

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

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

func (m *FeedMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedAuthorEmail

func (m *FeedMutation) OldFeedAuthorEmail(ctx context.Context) (v string, err error)

OldFeedAuthorEmail returns the old "feed_author_email" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedAuthorName

func (m *FeedMutation) OldFeedAuthorName(ctx context.Context) (v string, err error)

OldFeedAuthorName returns the old "feed_author_name" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedCategories

func (m *FeedMutation) OldFeedCategories(ctx context.Context) (v string, err error)

OldFeedCategories returns the old "feed_categories" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedCopyright

func (m *FeedMutation) OldFeedCopyright(ctx context.Context) (v string, err error)

OldFeedCopyright returns the old "feed_copyright" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedDescription

func (m *FeedMutation) OldFeedDescription(ctx context.Context) (v string, err error)

OldFeedDescription returns the old "feed_description" field's value of the Feed entity. If the Feed 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 (m *FeedMutation) OldFeedFeedLink(ctx context.Context) (v string, err error)

OldFeedFeedLink returns the old "feed_feed_link" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedGenerator

func (m *FeedMutation) OldFeedGenerator(ctx context.Context) (v string, err error)

OldFeedGenerator returns the old "feed_generator" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedImageTitle

func (m *FeedMutation) OldFeedImageTitle(ctx context.Context) (v string, err error)

OldFeedImageTitle returns the old "feed_image_title" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedImageURL

func (m *FeedMutation) OldFeedImageURL(ctx context.Context) (v string, err error)

OldFeedImageURL returns the old "feed_image_url" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedLanguage

func (m *FeedMutation) OldFeedLanguage(ctx context.Context) (v string, err error)

OldFeedLanguage returns the old "feed_language" field's value of the Feed entity. If the Feed 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 (m *FeedMutation) OldFeedLink(ctx context.Context) (v string, err error)

OldFeedLink returns the old "feed_link" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedPublished

func (m *FeedMutation) OldFeedPublished(ctx context.Context) (v time.Time, err error)

OldFeedPublished returns the old "feed_published" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedTitle

func (m *FeedMutation) OldFeedTitle(ctx context.Context) (v string, err error)

OldFeedTitle returns the old "feed_title" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldFeedUpdated

func (m *FeedMutation) OldFeedUpdated(ctx context.Context) (v time.Time, err error)

OldFeedUpdated returns the old "feed_updated" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldField

func (m *FeedMutation) 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 (*FeedMutation) OldPassword

func (m *FeedMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldURL

func (m *FeedMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldUpdatedAt

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

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

func (m *FeedMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Feed entity. If the Feed 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 (*FeedMutation) Op

func (m *FeedMutation) Op() Op

Op returns the operation name.

func (*FeedMutation) Password

func (m *FeedMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*FeedMutation) RemoveItemIDs

func (m *FeedMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*FeedMutation) RemoveSubscribedUserIDs

func (m *FeedMutation) RemoveSubscribedUserIDs(ids ...uuid.UUID)

RemoveSubscribedUserIDs removes the "subscribed_users" edge to the User entity by IDs.

func (*FeedMutation) RemoveSubscriptionIDs

func (m *FeedMutation) RemoveSubscriptionIDs(ids ...uuid.UUID)

RemoveSubscriptionIDs removes the "subscriptions" edge to the Subscription entity by IDs.

func (*FeedMutation) RemovedEdges

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

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

func (*FeedMutation) RemovedIDs

func (m *FeedMutation) 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 (*FeedMutation) RemovedItemsIDs

func (m *FeedMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*FeedMutation) RemovedSubscribedUsersIDs

func (m *FeedMutation) RemovedSubscribedUsersIDs() (ids []uuid.UUID)

RemovedSubscribedUsers returns the removed IDs of the "subscribed_users" edge to the User entity.

func (*FeedMutation) RemovedSubscriptionsIDs

func (m *FeedMutation) RemovedSubscriptionsIDs() (ids []uuid.UUID)

RemovedSubscriptions returns the removed IDs of the "subscriptions" edge to the Subscription entity.

func (*FeedMutation) ResetCreatedAt

func (m *FeedMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FeedMutation) ResetDeletedAt

func (m *FeedMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*FeedMutation) ResetEdge

func (m *FeedMutation) 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 (*FeedMutation) ResetFeedAuthorEmail

func (m *FeedMutation) ResetFeedAuthorEmail()

ResetFeedAuthorEmail resets all changes to the "feed_author_email" field.

func (*FeedMutation) ResetFeedAuthorName

func (m *FeedMutation) ResetFeedAuthorName()

ResetFeedAuthorName resets all changes to the "feed_author_name" field.

func (*FeedMutation) ResetFeedCategories

func (m *FeedMutation) ResetFeedCategories()

ResetFeedCategories resets all changes to the "feed_categories" field.

func (*FeedMutation) ResetFeedCopyright

func (m *FeedMutation) ResetFeedCopyright()

ResetFeedCopyright resets all changes to the "feed_copyright" field.

func (*FeedMutation) ResetFeedDescription

func (m *FeedMutation) ResetFeedDescription()

ResetFeedDescription resets all changes to the "feed_description" field.

func (m *FeedMutation) ResetFeedFeedLink()

ResetFeedFeedLink resets all changes to the "feed_feed_link" field.

func (*FeedMutation) ResetFeedGenerator

func (m *FeedMutation) ResetFeedGenerator()

ResetFeedGenerator resets all changes to the "feed_generator" field.

func (*FeedMutation) ResetFeedImageTitle

func (m *FeedMutation) ResetFeedImageTitle()

ResetFeedImageTitle resets all changes to the "feed_image_title" field.

func (*FeedMutation) ResetFeedImageURL

func (m *FeedMutation) ResetFeedImageURL()

ResetFeedImageURL resets all changes to the "feed_image_url" field.

func (*FeedMutation) ResetFeedLanguage

func (m *FeedMutation) ResetFeedLanguage()

ResetFeedLanguage resets all changes to the "feed_language" field.

func (m *FeedMutation) ResetFeedLink()

ResetFeedLink resets all changes to the "feed_link" field.

func (*FeedMutation) ResetFeedPublished

func (m *FeedMutation) ResetFeedPublished()

ResetFeedPublished resets all changes to the "feed_published" field.

func (*FeedMutation) ResetFeedTitle

func (m *FeedMutation) ResetFeedTitle()

ResetFeedTitle resets all changes to the "feed_title" field.

func (*FeedMutation) ResetFeedUpdated

func (m *FeedMutation) ResetFeedUpdated()

ResetFeedUpdated resets all changes to the "feed_updated" field.

func (*FeedMutation) ResetField

func (m *FeedMutation) 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 (*FeedMutation) ResetItems

func (m *FeedMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*FeedMutation) ResetPassword

func (m *FeedMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*FeedMutation) ResetSubscribedUsers

func (m *FeedMutation) ResetSubscribedUsers()

ResetSubscribedUsers resets all changes to the "subscribed_users" edge.

func (*FeedMutation) ResetSubscriptions

func (m *FeedMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*FeedMutation) ResetURL

func (m *FeedMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*FeedMutation) ResetUpdatedAt

func (m *FeedMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FeedMutation) ResetUsername

func (m *FeedMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*FeedMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedMutation) SetDeletedAt

func (m *FeedMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*FeedMutation) SetFeedAuthorEmail

func (m *FeedMutation) SetFeedAuthorEmail(s string)

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedMutation) SetFeedAuthorName

func (m *FeedMutation) SetFeedAuthorName(s string)

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedMutation) SetFeedCategories

func (m *FeedMutation) SetFeedCategories(s string)

SetFeedCategories sets the "feed_categories" field.

func (*FeedMutation) SetFeedCopyright

func (m *FeedMutation) SetFeedCopyright(s string)

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedMutation) SetFeedDescription

func (m *FeedMutation) SetFeedDescription(s string)

SetFeedDescription sets the "feed_description" field.

func (m *FeedMutation) SetFeedFeedLink(s string)

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedMutation) SetFeedGenerator

func (m *FeedMutation) SetFeedGenerator(s string)

SetFeedGenerator sets the "feed_generator" field.

func (*FeedMutation) SetFeedImageTitle

func (m *FeedMutation) SetFeedImageTitle(s string)

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedMutation) SetFeedImageURL

func (m *FeedMutation) SetFeedImageURL(s string)

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedMutation) SetFeedLanguage

func (m *FeedMutation) SetFeedLanguage(s string)

SetFeedLanguage sets the "feed_language" field.

func (m *FeedMutation) SetFeedLink(s string)

SetFeedLink sets the "feed_link" field.

func (*FeedMutation) SetFeedPublished

func (m *FeedMutation) SetFeedPublished(t time.Time)

SetFeedPublished sets the "feed_published" field.

func (*FeedMutation) SetFeedTitle

func (m *FeedMutation) SetFeedTitle(s string)

SetFeedTitle sets the "feed_title" field.

func (*FeedMutation) SetFeedUpdated

func (m *FeedMutation) SetFeedUpdated(t time.Time)

SetFeedUpdated sets the "feed_updated" field.

func (*FeedMutation) SetField

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

func (m *FeedMutation) SetID(id uuid.UUID)

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

func (*FeedMutation) SetPassword

func (m *FeedMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*FeedMutation) SetURL

func (m *FeedMutation) SetURL(s string)

SetURL sets the "url" field.

func (*FeedMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedMutation) SetUsername

func (m *FeedMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*FeedMutation) SubscribedUsersCleared

func (m *FeedMutation) SubscribedUsersCleared() bool

SubscribedUsersCleared reports if the "subscribed_users" edge to the User entity was cleared.

func (*FeedMutation) SubscribedUsersIDs

func (m *FeedMutation) SubscribedUsersIDs() (ids []uuid.UUID)

SubscribedUsersIDs returns the "subscribed_users" edge IDs in the mutation.

func (*FeedMutation) SubscriptionsCleared

func (m *FeedMutation) SubscriptionsCleared() bool

SubscriptionsCleared reports if the "subscriptions" edge to the Subscription entity was cleared.

func (*FeedMutation) SubscriptionsIDs

func (m *FeedMutation) SubscriptionsIDs() (ids []uuid.UUID)

SubscriptionsIDs returns the "subscriptions" edge IDs in the mutation.

func (FeedMutation) Tx

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

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

func (*FeedMutation) Type

func (m *FeedMutation) Type() string

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

func (*FeedMutation) URL

func (m *FeedMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*FeedMutation) UpdatedAt

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

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

func (*FeedMutation) Username

func (m *FeedMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*FeedMutation) Where

func (m *FeedMutation) Where(ps ...predicate.Feed)

Where appends a list predicates to the FeedMutation builder.

type FeedQuery

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

FeedQuery is the builder for querying Feed entities.

func (*FeedQuery) All

func (fq *FeedQuery) All(ctx context.Context) ([]*Feed, error)

All executes the query and returns a list of Feeds.

func (*FeedQuery) AllX

func (fq *FeedQuery) AllX(ctx context.Context) []*Feed

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

func (*FeedQuery) Clone

func (fq *FeedQuery) Clone() *FeedQuery

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

func (*FeedQuery) Count

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

Count returns the count of the given query.

func (*FeedQuery) CountX

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

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

func (*FeedQuery) Exist

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

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

func (*FeedQuery) ExistX

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

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

func (*FeedQuery) First

func (fq *FeedQuery) First(ctx context.Context) (*Feed, error)

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

func (*FeedQuery) FirstID

func (fq *FeedQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FeedQuery) FirstIDX

func (fq *FeedQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*FeedQuery) FirstX

func (fq *FeedQuery) FirstX(ctx context.Context) *Feed

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

func (*FeedQuery) GroupBy

func (fq *FeedQuery) GroupBy(field string, fields ...string) *FeedGroupBy

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

client.Feed.Query().
	GroupBy(feed.FieldURL).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FeedQuery) IDs

func (fq *FeedQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*FeedQuery) IDsX

func (fq *FeedQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*FeedQuery) Limit

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

Limit adds a limit step to the query.

func (*FeedQuery) Offset

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

Offset adds an offset step to the query.

func (*FeedQuery) Only

func (fq *FeedQuery) Only(ctx context.Context) (*Feed, error)

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

func (*FeedQuery) OnlyID

func (fq *FeedQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FeedQuery) OnlyIDX

func (fq *FeedQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*FeedQuery) OnlyX

func (fq *FeedQuery) OnlyX(ctx context.Context) *Feed

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

func (*FeedQuery) Order

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

Order adds an order step to the query.

func (*FeedQuery) QueryItems

func (fq *FeedQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*FeedQuery) QuerySubscribedUsers

func (fq *FeedQuery) QuerySubscribedUsers() *UserQuery

QuerySubscribedUsers chains the current query on the "subscribed_users" edge.

func (*FeedQuery) QuerySubscriptions

func (fq *FeedQuery) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions chains the current query on the "subscriptions" edge.

func (*FeedQuery) Select

func (fq *FeedQuery) Select(fields ...string) *FeedSelect

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

client.Feed.Query().
	Select(feed.FieldURL).
	Scan(ctx, &v)

func (*FeedQuery) Unique

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

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

func (fq *FeedQuery) Where(ps ...predicate.Feed) *FeedQuery

Where adds a new predicate for the FeedQuery builder.

func (*FeedQuery) WithItems

func (fq *FeedQuery) WithItems(opts ...func(*ItemQuery)) *FeedQuery

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

func (*FeedQuery) WithSubscribedUsers

func (fq *FeedQuery) WithSubscribedUsers(opts ...func(*UserQuery)) *FeedQuery

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

func (*FeedQuery) WithSubscriptions

func (fq *FeedQuery) WithSubscriptions(opts ...func(*SubscriptionQuery)) *FeedQuery

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

type FeedSelect

type FeedSelect struct {
	*FeedQuery
	// contains filtered or unexported fields
}

FeedSelect is the builder for selecting fields of Feed entities.

func (*FeedSelect) Bool

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

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

func (*FeedSelect) BoolX

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

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

func (*FeedSelect) Bools

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

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

func (*FeedSelect) BoolsX

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

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

func (*FeedSelect) Float64

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

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

func (*FeedSelect) Float64X

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

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

func (*FeedSelect) Float64s

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

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

func (*FeedSelect) Float64sX

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

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

func (*FeedSelect) Int

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

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

func (*FeedSelect) IntX

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

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

func (*FeedSelect) Ints

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

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

func (*FeedSelect) IntsX

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

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

func (*FeedSelect) Scan

func (fs *FeedSelect) Scan(ctx context.Context, v interface{}) error

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

func (*FeedSelect) ScanX

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

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

func (*FeedSelect) String

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

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

func (*FeedSelect) StringX

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

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

func (*FeedSelect) Strings

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

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

func (*FeedSelect) StringsX

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

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

type FeedUpdate

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

FeedUpdate is the builder for updating Feed entities.

func (*FeedUpdate) AddItemIDs

func (fu *FeedUpdate) AddItemIDs(ids ...uuid.UUID) *FeedUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*FeedUpdate) AddItems

func (fu *FeedUpdate) AddItems(i ...*Item) *FeedUpdate

AddItems adds the "items" edges to the Item entity.

func (*FeedUpdate) AddSubscribedUserIDs

func (fu *FeedUpdate) AddSubscribedUserIDs(ids ...uuid.UUID) *FeedUpdate

AddSubscribedUserIDs adds the "subscribed_users" edge to the User entity by IDs.

func (*FeedUpdate) AddSubscribedUsers

func (fu *FeedUpdate) AddSubscribedUsers(u ...*User) *FeedUpdate

AddSubscribedUsers adds the "subscribed_users" edges to the User entity.

func (*FeedUpdate) AddSubscriptionIDs

func (fu *FeedUpdate) AddSubscriptionIDs(ids ...uuid.UUID) *FeedUpdate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*FeedUpdate) AddSubscriptions

func (fu *FeedUpdate) AddSubscriptions(s ...*Subscription) *FeedUpdate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*FeedUpdate) ClearDeletedAt

func (fu *FeedUpdate) ClearDeletedAt() *FeedUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeedUpdate) ClearFeedAuthorEmail

func (fu *FeedUpdate) ClearFeedAuthorEmail() *FeedUpdate

ClearFeedAuthorEmail clears the value of the "feed_author_email" field.

func (*FeedUpdate) ClearFeedAuthorName

func (fu *FeedUpdate) ClearFeedAuthorName() *FeedUpdate

ClearFeedAuthorName clears the value of the "feed_author_name" field.

func (*FeedUpdate) ClearFeedImageTitle

func (fu *FeedUpdate) ClearFeedImageTitle() *FeedUpdate

ClearFeedImageTitle clears the value of the "feed_image_title" field.

func (*FeedUpdate) ClearFeedImageURL

func (fu *FeedUpdate) ClearFeedImageURL() *FeedUpdate

ClearFeedImageURL clears the value of the "feed_image_url" field.

func (*FeedUpdate) ClearItems

func (fu *FeedUpdate) ClearItems() *FeedUpdate

ClearItems clears all "items" edges to the Item entity.

func (*FeedUpdate) ClearSubscribedUsers

func (fu *FeedUpdate) ClearSubscribedUsers() *FeedUpdate

ClearSubscribedUsers clears all "subscribed_users" edges to the User entity.

func (*FeedUpdate) ClearSubscriptions

func (fu *FeedUpdate) ClearSubscriptions() *FeedUpdate

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*FeedUpdate) Exec

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

Exec executes the query.

func (*FeedUpdate) ExecX

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

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

func (*FeedUpdate) Mutation

func (fu *FeedUpdate) Mutation() *FeedMutation

Mutation returns the FeedMutation object of the builder.

func (*FeedUpdate) RemoveItemIDs

func (fu *FeedUpdate) RemoveItemIDs(ids ...uuid.UUID) *FeedUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*FeedUpdate) RemoveItems

func (fu *FeedUpdate) RemoveItems(i ...*Item) *FeedUpdate

RemoveItems removes "items" edges to Item entities.

func (*FeedUpdate) RemoveSubscribedUserIDs

func (fu *FeedUpdate) RemoveSubscribedUserIDs(ids ...uuid.UUID) *FeedUpdate

RemoveSubscribedUserIDs removes the "subscribed_users" edge to User entities by IDs.

func (*FeedUpdate) RemoveSubscribedUsers

func (fu *FeedUpdate) RemoveSubscribedUsers(u ...*User) *FeedUpdate

RemoveSubscribedUsers removes "subscribed_users" edges to User entities.

func (*FeedUpdate) RemoveSubscriptionIDs

func (fu *FeedUpdate) RemoveSubscriptionIDs(ids ...uuid.UUID) *FeedUpdate

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*FeedUpdate) RemoveSubscriptions

func (fu *FeedUpdate) RemoveSubscriptions(s ...*Subscription) *FeedUpdate

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*FeedUpdate) Save

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

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

func (*FeedUpdate) SaveX

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

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

func (*FeedUpdate) SetCreatedAt

func (fu *FeedUpdate) SetCreatedAt(t time.Time) *FeedUpdate

SetCreatedAt sets the "created_at" field.

func (*FeedUpdate) SetDeletedAt

func (fu *FeedUpdate) SetDeletedAt(t time.Time) *FeedUpdate

SetDeletedAt sets the "deleted_at" field.

func (*FeedUpdate) SetFeedAuthorEmail

func (fu *FeedUpdate) SetFeedAuthorEmail(s string) *FeedUpdate

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedUpdate) SetFeedAuthorName

func (fu *FeedUpdate) SetFeedAuthorName(s string) *FeedUpdate

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedUpdate) SetFeedCategories

func (fu *FeedUpdate) SetFeedCategories(s string) *FeedUpdate

SetFeedCategories sets the "feed_categories" field.

func (*FeedUpdate) SetFeedCopyright

func (fu *FeedUpdate) SetFeedCopyright(s string) *FeedUpdate

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedUpdate) SetFeedDescription

func (fu *FeedUpdate) SetFeedDescription(s string) *FeedUpdate

SetFeedDescription sets the "feed_description" field.

func (fu *FeedUpdate) SetFeedFeedLink(s string) *FeedUpdate

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedUpdate) SetFeedGenerator

func (fu *FeedUpdate) SetFeedGenerator(s string) *FeedUpdate

SetFeedGenerator sets the "feed_generator" field.

func (*FeedUpdate) SetFeedImageTitle

func (fu *FeedUpdate) SetFeedImageTitle(s string) *FeedUpdate

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedUpdate) SetFeedImageURL

func (fu *FeedUpdate) SetFeedImageURL(s string) *FeedUpdate

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedUpdate) SetFeedLanguage

func (fu *FeedUpdate) SetFeedLanguage(s string) *FeedUpdate

SetFeedLanguage sets the "feed_language" field.

func (fu *FeedUpdate) SetFeedLink(s string) *FeedUpdate

SetFeedLink sets the "feed_link" field.

func (*FeedUpdate) SetFeedPublished

func (fu *FeedUpdate) SetFeedPublished(t time.Time) *FeedUpdate

SetFeedPublished sets the "feed_published" field.

func (*FeedUpdate) SetFeedTitle

func (fu *FeedUpdate) SetFeedTitle(s string) *FeedUpdate

SetFeedTitle sets the "feed_title" field.

func (*FeedUpdate) SetFeedUpdated

func (fu *FeedUpdate) SetFeedUpdated(t time.Time) *FeedUpdate

SetFeedUpdated sets the "feed_updated" field.

func (*FeedUpdate) SetNillableCreatedAt

func (fu *FeedUpdate) SetNillableCreatedAt(t *time.Time) *FeedUpdate

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

func (*FeedUpdate) SetNillableDeletedAt

func (fu *FeedUpdate) SetNillableDeletedAt(t *time.Time) *FeedUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FeedUpdate) SetNillableFeedAuthorEmail

func (fu *FeedUpdate) SetNillableFeedAuthorEmail(s *string) *FeedUpdate

SetNillableFeedAuthorEmail sets the "feed_author_email" field if the given value is not nil.

func (*FeedUpdate) SetNillableFeedAuthorName

func (fu *FeedUpdate) SetNillableFeedAuthorName(s *string) *FeedUpdate

SetNillableFeedAuthorName sets the "feed_author_name" field if the given value is not nil.

func (*FeedUpdate) SetNillableFeedImageTitle

func (fu *FeedUpdate) SetNillableFeedImageTitle(s *string) *FeedUpdate

SetNillableFeedImageTitle sets the "feed_image_title" field if the given value is not nil.

func (*FeedUpdate) SetNillableFeedImageURL

func (fu *FeedUpdate) SetNillableFeedImageURL(s *string) *FeedUpdate

SetNillableFeedImageURL sets the "feed_image_url" field if the given value is not nil.

func (*FeedUpdate) SetNillablePassword

func (fu *FeedUpdate) SetNillablePassword(s *string) *FeedUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*FeedUpdate) SetNillableUsername

func (fu *FeedUpdate) SetNillableUsername(s *string) *FeedUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*FeedUpdate) SetPassword

func (fu *FeedUpdate) SetPassword(s string) *FeedUpdate

SetPassword sets the "password" field.

func (*FeedUpdate) SetURL

func (fu *FeedUpdate) SetURL(s string) *FeedUpdate

SetURL sets the "url" field.

func (*FeedUpdate) SetUpdatedAt

func (fu *FeedUpdate) SetUpdatedAt(t time.Time) *FeedUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpdate) SetUsername

func (fu *FeedUpdate) SetUsername(s string) *FeedUpdate

SetUsername sets the "username" field.

func (*FeedUpdate) Where

func (fu *FeedUpdate) Where(ps ...predicate.Feed) *FeedUpdate

Where appends a list predicates to the FeedUpdate builder.

type FeedUpdateOne

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

FeedUpdateOne is the builder for updating a single Feed entity.

func (*FeedUpdateOne) AddItemIDs

func (fuo *FeedUpdateOne) AddItemIDs(ids ...uuid.UUID) *FeedUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*FeedUpdateOne) AddItems

func (fuo *FeedUpdateOne) AddItems(i ...*Item) *FeedUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*FeedUpdateOne) AddSubscribedUserIDs

func (fuo *FeedUpdateOne) AddSubscribedUserIDs(ids ...uuid.UUID) *FeedUpdateOne

AddSubscribedUserIDs adds the "subscribed_users" edge to the User entity by IDs.

func (*FeedUpdateOne) AddSubscribedUsers

func (fuo *FeedUpdateOne) AddSubscribedUsers(u ...*User) *FeedUpdateOne

AddSubscribedUsers adds the "subscribed_users" edges to the User entity.

func (*FeedUpdateOne) AddSubscriptionIDs

func (fuo *FeedUpdateOne) AddSubscriptionIDs(ids ...uuid.UUID) *FeedUpdateOne

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*FeedUpdateOne) AddSubscriptions

func (fuo *FeedUpdateOne) AddSubscriptions(s ...*Subscription) *FeedUpdateOne

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*FeedUpdateOne) ClearDeletedAt

func (fuo *FeedUpdateOne) ClearDeletedAt() *FeedUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeedUpdateOne) ClearFeedAuthorEmail

func (fuo *FeedUpdateOne) ClearFeedAuthorEmail() *FeedUpdateOne

ClearFeedAuthorEmail clears the value of the "feed_author_email" field.

func (*FeedUpdateOne) ClearFeedAuthorName

func (fuo *FeedUpdateOne) ClearFeedAuthorName() *FeedUpdateOne

ClearFeedAuthorName clears the value of the "feed_author_name" field.

func (*FeedUpdateOne) ClearFeedImageTitle

func (fuo *FeedUpdateOne) ClearFeedImageTitle() *FeedUpdateOne

ClearFeedImageTitle clears the value of the "feed_image_title" field.

func (*FeedUpdateOne) ClearFeedImageURL

func (fuo *FeedUpdateOne) ClearFeedImageURL() *FeedUpdateOne

ClearFeedImageURL clears the value of the "feed_image_url" field.

func (*FeedUpdateOne) ClearItems

func (fuo *FeedUpdateOne) ClearItems() *FeedUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*FeedUpdateOne) ClearSubscribedUsers

func (fuo *FeedUpdateOne) ClearSubscribedUsers() *FeedUpdateOne

ClearSubscribedUsers clears all "subscribed_users" edges to the User entity.

func (*FeedUpdateOne) ClearSubscriptions

func (fuo *FeedUpdateOne) ClearSubscriptions() *FeedUpdateOne

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*FeedUpdateOne) Exec

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

Exec executes the query on the entity.

func (*FeedUpdateOne) ExecX

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

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

func (*FeedUpdateOne) Mutation

func (fuo *FeedUpdateOne) Mutation() *FeedMutation

Mutation returns the FeedMutation object of the builder.

func (*FeedUpdateOne) RemoveItemIDs

func (fuo *FeedUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *FeedUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*FeedUpdateOne) RemoveItems

func (fuo *FeedUpdateOne) RemoveItems(i ...*Item) *FeedUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*FeedUpdateOne) RemoveSubscribedUserIDs

func (fuo *FeedUpdateOne) RemoveSubscribedUserIDs(ids ...uuid.UUID) *FeedUpdateOne

RemoveSubscribedUserIDs removes the "subscribed_users" edge to User entities by IDs.

func (*FeedUpdateOne) RemoveSubscribedUsers

func (fuo *FeedUpdateOne) RemoveSubscribedUsers(u ...*User) *FeedUpdateOne

RemoveSubscribedUsers removes "subscribed_users" edges to User entities.

func (*FeedUpdateOne) RemoveSubscriptionIDs

func (fuo *FeedUpdateOne) RemoveSubscriptionIDs(ids ...uuid.UUID) *FeedUpdateOne

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*FeedUpdateOne) RemoveSubscriptions

func (fuo *FeedUpdateOne) RemoveSubscriptions(s ...*Subscription) *FeedUpdateOne

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*FeedUpdateOne) Save

func (fuo *FeedUpdateOne) Save(ctx context.Context) (*Feed, error)

Save executes the query and returns the updated Feed entity.

func (*FeedUpdateOne) SaveX

func (fuo *FeedUpdateOne) SaveX(ctx context.Context) *Feed

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

func (*FeedUpdateOne) Select

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

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

func (*FeedUpdateOne) SetCreatedAt

func (fuo *FeedUpdateOne) SetCreatedAt(t time.Time) *FeedUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FeedUpdateOne) SetDeletedAt

func (fuo *FeedUpdateOne) SetDeletedAt(t time.Time) *FeedUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*FeedUpdateOne) SetFeedAuthorEmail

func (fuo *FeedUpdateOne) SetFeedAuthorEmail(s string) *FeedUpdateOne

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedUpdateOne) SetFeedAuthorName

func (fuo *FeedUpdateOne) SetFeedAuthorName(s string) *FeedUpdateOne

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedUpdateOne) SetFeedCategories

func (fuo *FeedUpdateOne) SetFeedCategories(s string) *FeedUpdateOne

SetFeedCategories sets the "feed_categories" field.

func (*FeedUpdateOne) SetFeedCopyright

func (fuo *FeedUpdateOne) SetFeedCopyright(s string) *FeedUpdateOne

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedUpdateOne) SetFeedDescription

func (fuo *FeedUpdateOne) SetFeedDescription(s string) *FeedUpdateOne

SetFeedDescription sets the "feed_description" field.

func (fuo *FeedUpdateOne) SetFeedFeedLink(s string) *FeedUpdateOne

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedUpdateOne) SetFeedGenerator

func (fuo *FeedUpdateOne) SetFeedGenerator(s string) *FeedUpdateOne

SetFeedGenerator sets the "feed_generator" field.

func (*FeedUpdateOne) SetFeedImageTitle

func (fuo *FeedUpdateOne) SetFeedImageTitle(s string) *FeedUpdateOne

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedUpdateOne) SetFeedImageURL

func (fuo *FeedUpdateOne) SetFeedImageURL(s string) *FeedUpdateOne

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedUpdateOne) SetFeedLanguage

func (fuo *FeedUpdateOne) SetFeedLanguage(s string) *FeedUpdateOne

SetFeedLanguage sets the "feed_language" field.

func (fuo *FeedUpdateOne) SetFeedLink(s string) *FeedUpdateOne

SetFeedLink sets the "feed_link" field.

func (*FeedUpdateOne) SetFeedPublished

func (fuo *FeedUpdateOne) SetFeedPublished(t time.Time) *FeedUpdateOne

SetFeedPublished sets the "feed_published" field.

func (*FeedUpdateOne) SetFeedTitle

func (fuo *FeedUpdateOne) SetFeedTitle(s string) *FeedUpdateOne

SetFeedTitle sets the "feed_title" field.

func (*FeedUpdateOne) SetFeedUpdated

func (fuo *FeedUpdateOne) SetFeedUpdated(t time.Time) *FeedUpdateOne

SetFeedUpdated sets the "feed_updated" field.

func (*FeedUpdateOne) SetNillableCreatedAt

func (fuo *FeedUpdateOne) SetNillableCreatedAt(t *time.Time) *FeedUpdateOne

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

func (*FeedUpdateOne) SetNillableDeletedAt

func (fuo *FeedUpdateOne) SetNillableDeletedAt(t *time.Time) *FeedUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableFeedAuthorEmail

func (fuo *FeedUpdateOne) SetNillableFeedAuthorEmail(s *string) *FeedUpdateOne

SetNillableFeedAuthorEmail sets the "feed_author_email" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableFeedAuthorName

func (fuo *FeedUpdateOne) SetNillableFeedAuthorName(s *string) *FeedUpdateOne

SetNillableFeedAuthorName sets the "feed_author_name" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableFeedImageTitle

func (fuo *FeedUpdateOne) SetNillableFeedImageTitle(s *string) *FeedUpdateOne

SetNillableFeedImageTitle sets the "feed_image_title" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableFeedImageURL

func (fuo *FeedUpdateOne) SetNillableFeedImageURL(s *string) *FeedUpdateOne

SetNillableFeedImageURL sets the "feed_image_url" field if the given value is not nil.

func (*FeedUpdateOne) SetNillablePassword

func (fuo *FeedUpdateOne) SetNillablePassword(s *string) *FeedUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableUsername

func (fuo *FeedUpdateOne) SetNillableUsername(s *string) *FeedUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*FeedUpdateOne) SetPassword

func (fuo *FeedUpdateOne) SetPassword(s string) *FeedUpdateOne

SetPassword sets the "password" field.

func (*FeedUpdateOne) SetURL

func (fuo *FeedUpdateOne) SetURL(s string) *FeedUpdateOne

SetURL sets the "url" field.

func (*FeedUpdateOne) SetUpdatedAt

func (fuo *FeedUpdateOne) SetUpdatedAt(t time.Time) *FeedUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpdateOne) SetUsername

func (fuo *FeedUpdateOne) SetUsername(s string) *FeedUpdateOne

SetUsername sets the "username" field.

type FeedUpsert

type FeedUpsert struct {
	*sql.UpdateSet
}

FeedUpsert is the "OnConflict" setter.

func (*FeedUpsert) ClearDeletedAt

func (u *FeedUpsert) ClearDeletedAt() *FeedUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeedUpsert) ClearFeedAuthorEmail

func (u *FeedUpsert) ClearFeedAuthorEmail() *FeedUpsert

ClearFeedAuthorEmail clears the value of the "feed_author_email" field.

func (*FeedUpsert) ClearFeedAuthorName

func (u *FeedUpsert) ClearFeedAuthorName() *FeedUpsert

ClearFeedAuthorName clears the value of the "feed_author_name" field.

func (*FeedUpsert) ClearFeedImageTitle

func (u *FeedUpsert) ClearFeedImageTitle() *FeedUpsert

ClearFeedImageTitle clears the value of the "feed_image_title" field.

func (*FeedUpsert) ClearFeedImageURL

func (u *FeedUpsert) ClearFeedImageURL() *FeedUpsert

ClearFeedImageURL clears the value of the "feed_image_url" field.

func (*FeedUpsert) SetCreatedAt

func (u *FeedUpsert) SetCreatedAt(v time.Time) *FeedUpsert

SetCreatedAt sets the "created_at" field.

func (*FeedUpsert) SetDeletedAt

func (u *FeedUpsert) SetDeletedAt(v time.Time) *FeedUpsert

SetDeletedAt sets the "deleted_at" field.

func (*FeedUpsert) SetFeedAuthorEmail

func (u *FeedUpsert) SetFeedAuthorEmail(v string) *FeedUpsert

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedUpsert) SetFeedAuthorName

func (u *FeedUpsert) SetFeedAuthorName(v string) *FeedUpsert

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedUpsert) SetFeedCategories

func (u *FeedUpsert) SetFeedCategories(v string) *FeedUpsert

SetFeedCategories sets the "feed_categories" field.

func (*FeedUpsert) SetFeedCopyright

func (u *FeedUpsert) SetFeedCopyright(v string) *FeedUpsert

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedUpsert) SetFeedDescription

func (u *FeedUpsert) SetFeedDescription(v string) *FeedUpsert

SetFeedDescription sets the "feed_description" field.

func (u *FeedUpsert) SetFeedFeedLink(v string) *FeedUpsert

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedUpsert) SetFeedGenerator

func (u *FeedUpsert) SetFeedGenerator(v string) *FeedUpsert

SetFeedGenerator sets the "feed_generator" field.

func (*FeedUpsert) SetFeedImageTitle

func (u *FeedUpsert) SetFeedImageTitle(v string) *FeedUpsert

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedUpsert) SetFeedImageURL

func (u *FeedUpsert) SetFeedImageURL(v string) *FeedUpsert

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedUpsert) SetFeedLanguage

func (u *FeedUpsert) SetFeedLanguage(v string) *FeedUpsert

SetFeedLanguage sets the "feed_language" field.

func (u *FeedUpsert) SetFeedLink(v string) *FeedUpsert

SetFeedLink sets the "feed_link" field.

func (*FeedUpsert) SetFeedPublished

func (u *FeedUpsert) SetFeedPublished(v time.Time) *FeedUpsert

SetFeedPublished sets the "feed_published" field.

func (*FeedUpsert) SetFeedTitle

func (u *FeedUpsert) SetFeedTitle(v string) *FeedUpsert

SetFeedTitle sets the "feed_title" field.

func (*FeedUpsert) SetFeedUpdated

func (u *FeedUpsert) SetFeedUpdated(v time.Time) *FeedUpsert

SetFeedUpdated sets the "feed_updated" field.

func (*FeedUpsert) SetPassword

func (u *FeedUpsert) SetPassword(v string) *FeedUpsert

SetPassword sets the "password" field.

func (*FeedUpsert) SetURL

func (u *FeedUpsert) SetURL(v string) *FeedUpsert

SetURL sets the "url" field.

func (*FeedUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpsert) SetUsername

func (u *FeedUpsert) SetUsername(v string) *FeedUpsert

SetUsername sets the "username" field.

func (*FeedUpsert) UpdateCreatedAt

func (u *FeedUpsert) UpdateCreatedAt() *FeedUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FeedUpsert) UpdateDeletedAt

func (u *FeedUpsert) UpdateDeletedAt() *FeedUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedAuthorEmail

func (u *FeedUpsert) UpdateFeedAuthorEmail() *FeedUpsert

UpdateFeedAuthorEmail sets the "feed_author_email" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedAuthorName

func (u *FeedUpsert) UpdateFeedAuthorName() *FeedUpsert

UpdateFeedAuthorName sets the "feed_author_name" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedCategories

func (u *FeedUpsert) UpdateFeedCategories() *FeedUpsert

UpdateFeedCategories sets the "feed_categories" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedCopyright

func (u *FeedUpsert) UpdateFeedCopyright() *FeedUpsert

UpdateFeedCopyright sets the "feed_copyright" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedDescription

func (u *FeedUpsert) UpdateFeedDescription() *FeedUpsert

UpdateFeedDescription sets the "feed_description" field to the value that was provided on create.

func (u *FeedUpsert) UpdateFeedFeedLink() *FeedUpsert

UpdateFeedFeedLink sets the "feed_feed_link" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedGenerator

func (u *FeedUpsert) UpdateFeedGenerator() *FeedUpsert

UpdateFeedGenerator sets the "feed_generator" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedImageTitle

func (u *FeedUpsert) UpdateFeedImageTitle() *FeedUpsert

UpdateFeedImageTitle sets the "feed_image_title" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedImageURL

func (u *FeedUpsert) UpdateFeedImageURL() *FeedUpsert

UpdateFeedImageURL sets the "feed_image_url" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedLanguage

func (u *FeedUpsert) UpdateFeedLanguage() *FeedUpsert

UpdateFeedLanguage sets the "feed_language" field to the value that was provided on create.

func (u *FeedUpsert) UpdateFeedLink() *FeedUpsert

UpdateFeedLink sets the "feed_link" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedPublished

func (u *FeedUpsert) UpdateFeedPublished() *FeedUpsert

UpdateFeedPublished sets the "feed_published" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedTitle

func (u *FeedUpsert) UpdateFeedTitle() *FeedUpsert

UpdateFeedTitle sets the "feed_title" field to the value that was provided on create.

func (*FeedUpsert) UpdateFeedUpdated

func (u *FeedUpsert) UpdateFeedUpdated() *FeedUpsert

UpdateFeedUpdated sets the "feed_updated" field to the value that was provided on create.

func (*FeedUpsert) UpdatePassword

func (u *FeedUpsert) UpdatePassword() *FeedUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*FeedUpsert) UpdateURL

func (u *FeedUpsert) UpdateURL() *FeedUpsert

UpdateURL sets the "url" field to the value that was provided on create.

func (*FeedUpsert) UpdateUpdatedAt

func (u *FeedUpsert) UpdateUpdatedAt() *FeedUpsert

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

func (*FeedUpsert) UpdateUsername

func (u *FeedUpsert) UpdateUsername() *FeedUpsert

UpdateUsername sets the "username" field to the value that was provided on create.

type FeedUpsertBulk

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

FeedUpsertBulk is the builder for "upsert"-ing a bulk of Feed nodes.

func (*FeedUpsertBulk) ClearDeletedAt

func (u *FeedUpsertBulk) ClearDeletedAt() *FeedUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeedUpsertBulk) ClearFeedAuthorEmail

func (u *FeedUpsertBulk) ClearFeedAuthorEmail() *FeedUpsertBulk

ClearFeedAuthorEmail clears the value of the "feed_author_email" field.

func (*FeedUpsertBulk) ClearFeedAuthorName

func (u *FeedUpsertBulk) ClearFeedAuthorName() *FeedUpsertBulk

ClearFeedAuthorName clears the value of the "feed_author_name" field.

func (*FeedUpsertBulk) ClearFeedImageTitle

func (u *FeedUpsertBulk) ClearFeedImageTitle() *FeedUpsertBulk

ClearFeedImageTitle clears the value of the "feed_image_title" field.

func (*FeedUpsertBulk) ClearFeedImageURL

func (u *FeedUpsertBulk) ClearFeedImageURL() *FeedUpsertBulk

ClearFeedImageURL clears the value of the "feed_image_url" field.

func (*FeedUpsertBulk) DoNothing

func (u *FeedUpsertBulk) DoNothing() *FeedUpsertBulk

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

func (*FeedUpsertBulk) Exec

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

Exec executes the query.

func (*FeedUpsertBulk) ExecX

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

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

func (*FeedUpsertBulk) Ignore

func (u *FeedUpsertBulk) Ignore() *FeedUpsertBulk

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

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

func (*FeedUpsertBulk) SetCreatedAt

func (u *FeedUpsertBulk) SetCreatedAt(v time.Time) *FeedUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*FeedUpsertBulk) SetDeletedAt

func (u *FeedUpsertBulk) SetDeletedAt(v time.Time) *FeedUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*FeedUpsertBulk) SetFeedAuthorEmail

func (u *FeedUpsertBulk) SetFeedAuthorEmail(v string) *FeedUpsertBulk

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedUpsertBulk) SetFeedAuthorName

func (u *FeedUpsertBulk) SetFeedAuthorName(v string) *FeedUpsertBulk

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedUpsertBulk) SetFeedCategories

func (u *FeedUpsertBulk) SetFeedCategories(v string) *FeedUpsertBulk

SetFeedCategories sets the "feed_categories" field.

func (*FeedUpsertBulk) SetFeedCopyright

func (u *FeedUpsertBulk) SetFeedCopyright(v string) *FeedUpsertBulk

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedUpsertBulk) SetFeedDescription

func (u *FeedUpsertBulk) SetFeedDescription(v string) *FeedUpsertBulk

SetFeedDescription sets the "feed_description" field.

func (u *FeedUpsertBulk) SetFeedFeedLink(v string) *FeedUpsertBulk

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedUpsertBulk) SetFeedGenerator

func (u *FeedUpsertBulk) SetFeedGenerator(v string) *FeedUpsertBulk

SetFeedGenerator sets the "feed_generator" field.

func (*FeedUpsertBulk) SetFeedImageTitle

func (u *FeedUpsertBulk) SetFeedImageTitle(v string) *FeedUpsertBulk

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedUpsertBulk) SetFeedImageURL

func (u *FeedUpsertBulk) SetFeedImageURL(v string) *FeedUpsertBulk

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedUpsertBulk) SetFeedLanguage

func (u *FeedUpsertBulk) SetFeedLanguage(v string) *FeedUpsertBulk

SetFeedLanguage sets the "feed_language" field.

func (u *FeedUpsertBulk) SetFeedLink(v string) *FeedUpsertBulk

SetFeedLink sets the "feed_link" field.

func (*FeedUpsertBulk) SetFeedPublished

func (u *FeedUpsertBulk) SetFeedPublished(v time.Time) *FeedUpsertBulk

SetFeedPublished sets the "feed_published" field.

func (*FeedUpsertBulk) SetFeedTitle

func (u *FeedUpsertBulk) SetFeedTitle(v string) *FeedUpsertBulk

SetFeedTitle sets the "feed_title" field.

func (*FeedUpsertBulk) SetFeedUpdated

func (u *FeedUpsertBulk) SetFeedUpdated(v time.Time) *FeedUpsertBulk

SetFeedUpdated sets the "feed_updated" field.

func (*FeedUpsertBulk) SetPassword

func (u *FeedUpsertBulk) SetPassword(v string) *FeedUpsertBulk

SetPassword sets the "password" field.

func (*FeedUpsertBulk) SetURL

func (u *FeedUpsertBulk) SetURL(v string) *FeedUpsertBulk

SetURL sets the "url" field.

func (*FeedUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpsertBulk) SetUsername

func (u *FeedUpsertBulk) SetUsername(v string) *FeedUpsertBulk

SetUsername sets the "username" field.

func (*FeedUpsertBulk) Update

func (u *FeedUpsertBulk) Update(set func(*FeedUpsert)) *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateCreatedAt

func (u *FeedUpsertBulk) UpdateCreatedAt() *FeedUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateDeletedAt

func (u *FeedUpsertBulk) UpdateDeletedAt() *FeedUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedAuthorEmail

func (u *FeedUpsertBulk) UpdateFeedAuthorEmail() *FeedUpsertBulk

UpdateFeedAuthorEmail sets the "feed_author_email" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedAuthorName

func (u *FeedUpsertBulk) UpdateFeedAuthorName() *FeedUpsertBulk

UpdateFeedAuthorName sets the "feed_author_name" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedCategories

func (u *FeedUpsertBulk) UpdateFeedCategories() *FeedUpsertBulk

UpdateFeedCategories sets the "feed_categories" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedCopyright

func (u *FeedUpsertBulk) UpdateFeedCopyright() *FeedUpsertBulk

UpdateFeedCopyright sets the "feed_copyright" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedDescription

func (u *FeedUpsertBulk) UpdateFeedDescription() *FeedUpsertBulk

UpdateFeedDescription sets the "feed_description" field to the value that was provided on create.

func (u *FeedUpsertBulk) UpdateFeedFeedLink() *FeedUpsertBulk

UpdateFeedFeedLink sets the "feed_feed_link" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedGenerator

func (u *FeedUpsertBulk) UpdateFeedGenerator() *FeedUpsertBulk

UpdateFeedGenerator sets the "feed_generator" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedImageTitle

func (u *FeedUpsertBulk) UpdateFeedImageTitle() *FeedUpsertBulk

UpdateFeedImageTitle sets the "feed_image_title" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedImageURL

func (u *FeedUpsertBulk) UpdateFeedImageURL() *FeedUpsertBulk

UpdateFeedImageURL sets the "feed_image_url" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedLanguage

func (u *FeedUpsertBulk) UpdateFeedLanguage() *FeedUpsertBulk

UpdateFeedLanguage sets the "feed_language" field to the value that was provided on create.

func (u *FeedUpsertBulk) UpdateFeedLink() *FeedUpsertBulk

UpdateFeedLink sets the "feed_link" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedPublished

func (u *FeedUpsertBulk) UpdateFeedPublished() *FeedUpsertBulk

UpdateFeedPublished sets the "feed_published" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedTitle

func (u *FeedUpsertBulk) UpdateFeedTitle() *FeedUpsertBulk

UpdateFeedTitle sets the "feed_title" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateFeedUpdated

func (u *FeedUpsertBulk) UpdateFeedUpdated() *FeedUpsertBulk

UpdateFeedUpdated sets the "feed_updated" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateNewValues

func (u *FeedUpsertBulk) UpdateNewValues() *FeedUpsertBulk

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

client.Feed.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(feed.FieldID)
		}),
	).
	Exec(ctx)

func (*FeedUpsertBulk) UpdatePassword

func (u *FeedUpsertBulk) UpdatePassword() *FeedUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateURL

func (u *FeedUpsertBulk) UpdateURL() *FeedUpsertBulk

UpdateURL sets the "url" field to the value that was provided on create.

func (*FeedUpsertBulk) UpdateUpdatedAt

func (u *FeedUpsertBulk) UpdateUpdatedAt() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateUsername

func (u *FeedUpsertBulk) UpdateUsername() *FeedUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type FeedUpsertOne

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

FeedUpsertOne is the builder for "upsert"-ing

one Feed node.

func (*FeedUpsertOne) ClearDeletedAt

func (u *FeedUpsertOne) ClearDeletedAt() *FeedUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeedUpsertOne) ClearFeedAuthorEmail

func (u *FeedUpsertOne) ClearFeedAuthorEmail() *FeedUpsertOne

ClearFeedAuthorEmail clears the value of the "feed_author_email" field.

func (*FeedUpsertOne) ClearFeedAuthorName

func (u *FeedUpsertOne) ClearFeedAuthorName() *FeedUpsertOne

ClearFeedAuthorName clears the value of the "feed_author_name" field.

func (*FeedUpsertOne) ClearFeedImageTitle

func (u *FeedUpsertOne) ClearFeedImageTitle() *FeedUpsertOne

ClearFeedImageTitle clears the value of the "feed_image_title" field.

func (*FeedUpsertOne) ClearFeedImageURL

func (u *FeedUpsertOne) ClearFeedImageURL() *FeedUpsertOne

ClearFeedImageURL clears the value of the "feed_image_url" field.

func (*FeedUpsertOne) DoNothing

func (u *FeedUpsertOne) DoNothing() *FeedUpsertOne

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

func (*FeedUpsertOne) Exec

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

Exec executes the query.

func (*FeedUpsertOne) ExecX

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

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

func (*FeedUpsertOne) ID

func (u *FeedUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FeedUpsertOne) IDX

func (u *FeedUpsertOne) IDX(ctx context.Context) uuid.UUID

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

func (*FeedUpsertOne) Ignore

func (u *FeedUpsertOne) Ignore() *FeedUpsertOne

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

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

func (*FeedUpsertOne) SetCreatedAt

func (u *FeedUpsertOne) SetCreatedAt(v time.Time) *FeedUpsertOne

SetCreatedAt sets the "created_at" field.

func (*FeedUpsertOne) SetDeletedAt

func (u *FeedUpsertOne) SetDeletedAt(v time.Time) *FeedUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*FeedUpsertOne) SetFeedAuthorEmail

func (u *FeedUpsertOne) SetFeedAuthorEmail(v string) *FeedUpsertOne

SetFeedAuthorEmail sets the "feed_author_email" field.

func (*FeedUpsertOne) SetFeedAuthorName

func (u *FeedUpsertOne) SetFeedAuthorName(v string) *FeedUpsertOne

SetFeedAuthorName sets the "feed_author_name" field.

func (*FeedUpsertOne) SetFeedCategories

func (u *FeedUpsertOne) SetFeedCategories(v string) *FeedUpsertOne

SetFeedCategories sets the "feed_categories" field.

func (*FeedUpsertOne) SetFeedCopyright

func (u *FeedUpsertOne) SetFeedCopyright(v string) *FeedUpsertOne

SetFeedCopyright sets the "feed_copyright" field.

func (*FeedUpsertOne) SetFeedDescription

func (u *FeedUpsertOne) SetFeedDescription(v string) *FeedUpsertOne

SetFeedDescription sets the "feed_description" field.

func (u *FeedUpsertOne) SetFeedFeedLink(v string) *FeedUpsertOne

SetFeedFeedLink sets the "feed_feed_link" field.

func (*FeedUpsertOne) SetFeedGenerator

func (u *FeedUpsertOne) SetFeedGenerator(v string) *FeedUpsertOne

SetFeedGenerator sets the "feed_generator" field.

func (*FeedUpsertOne) SetFeedImageTitle

func (u *FeedUpsertOne) SetFeedImageTitle(v string) *FeedUpsertOne

SetFeedImageTitle sets the "feed_image_title" field.

func (*FeedUpsertOne) SetFeedImageURL

func (u *FeedUpsertOne) SetFeedImageURL(v string) *FeedUpsertOne

SetFeedImageURL sets the "feed_image_url" field.

func (*FeedUpsertOne) SetFeedLanguage

func (u *FeedUpsertOne) SetFeedLanguage(v string) *FeedUpsertOne

SetFeedLanguage sets the "feed_language" field.

func (u *FeedUpsertOne) SetFeedLink(v string) *FeedUpsertOne

SetFeedLink sets the "feed_link" field.

func (*FeedUpsertOne) SetFeedPublished

func (u *FeedUpsertOne) SetFeedPublished(v time.Time) *FeedUpsertOne

SetFeedPublished sets the "feed_published" field.

func (*FeedUpsertOne) SetFeedTitle

func (u *FeedUpsertOne) SetFeedTitle(v string) *FeedUpsertOne

SetFeedTitle sets the "feed_title" field.

func (*FeedUpsertOne) SetFeedUpdated

func (u *FeedUpsertOne) SetFeedUpdated(v time.Time) *FeedUpsertOne

SetFeedUpdated sets the "feed_updated" field.

func (*FeedUpsertOne) SetPassword

func (u *FeedUpsertOne) SetPassword(v string) *FeedUpsertOne

SetPassword sets the "password" field.

func (*FeedUpsertOne) SetURL

func (u *FeedUpsertOne) SetURL(v string) *FeedUpsertOne

SetURL sets the "url" field.

func (*FeedUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpsertOne) SetUsername

func (u *FeedUpsertOne) SetUsername(v string) *FeedUpsertOne

SetUsername sets the "username" field.

func (*FeedUpsertOne) Update

func (u *FeedUpsertOne) Update(set func(*FeedUpsert)) *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateCreatedAt

func (u *FeedUpsertOne) UpdateCreatedAt() *FeedUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateDeletedAt

func (u *FeedUpsertOne) UpdateDeletedAt() *FeedUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedAuthorEmail

func (u *FeedUpsertOne) UpdateFeedAuthorEmail() *FeedUpsertOne

UpdateFeedAuthorEmail sets the "feed_author_email" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedAuthorName

func (u *FeedUpsertOne) UpdateFeedAuthorName() *FeedUpsertOne

UpdateFeedAuthorName sets the "feed_author_name" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedCategories

func (u *FeedUpsertOne) UpdateFeedCategories() *FeedUpsertOne

UpdateFeedCategories sets the "feed_categories" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedCopyright

func (u *FeedUpsertOne) UpdateFeedCopyright() *FeedUpsertOne

UpdateFeedCopyright sets the "feed_copyright" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedDescription

func (u *FeedUpsertOne) UpdateFeedDescription() *FeedUpsertOne

UpdateFeedDescription sets the "feed_description" field to the value that was provided on create.

func (u *FeedUpsertOne) UpdateFeedFeedLink() *FeedUpsertOne

UpdateFeedFeedLink sets the "feed_feed_link" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedGenerator

func (u *FeedUpsertOne) UpdateFeedGenerator() *FeedUpsertOne

UpdateFeedGenerator sets the "feed_generator" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedImageTitle

func (u *FeedUpsertOne) UpdateFeedImageTitle() *FeedUpsertOne

UpdateFeedImageTitle sets the "feed_image_title" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedImageURL

func (u *FeedUpsertOne) UpdateFeedImageURL() *FeedUpsertOne

UpdateFeedImageURL sets the "feed_image_url" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedLanguage

func (u *FeedUpsertOne) UpdateFeedLanguage() *FeedUpsertOne

UpdateFeedLanguage sets the "feed_language" field to the value that was provided on create.

func (u *FeedUpsertOne) UpdateFeedLink() *FeedUpsertOne

UpdateFeedLink sets the "feed_link" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedPublished

func (u *FeedUpsertOne) UpdateFeedPublished() *FeedUpsertOne

UpdateFeedPublished sets the "feed_published" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedTitle

func (u *FeedUpsertOne) UpdateFeedTitle() *FeedUpsertOne

UpdateFeedTitle sets the "feed_title" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateFeedUpdated

func (u *FeedUpsertOne) UpdateFeedUpdated() *FeedUpsertOne

UpdateFeedUpdated sets the "feed_updated" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateNewValues

func (u *FeedUpsertOne) UpdateNewValues() *FeedUpsertOne

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.Feed.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(feed.FieldID)
		}),
	).
	Exec(ctx)

func (*FeedUpsertOne) UpdatePassword

func (u *FeedUpsertOne) UpdatePassword() *FeedUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateURL

func (u *FeedUpsertOne) UpdateURL() *FeedUpsertOne

UpdateURL sets the "url" field to the value that was provided on create.

func (*FeedUpsertOne) UpdateUpdatedAt

func (u *FeedUpsertOne) UpdateUpdatedAt() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateUsername

func (u *FeedUpsertOne) UpdateUsername() *FeedUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

type Feeds

type Feeds []*Feed

Feeds is a parsable slice of Feed.

type Hook

type Hook = ent.Hook

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

type Item

type Item struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// ItemGUID holds the value of the "item_guid" field.
	ItemGUID string `json:"item_guid,omitempty"`
	// ItemTitle holds the value of the "item_title" field.
	ItemTitle string `json:"item_title,omitempty"`
	// ItemDescription holds the value of the "item_description" field.
	ItemDescription string `json:"item_description,omitempty"`
	// ItemContent holds the value of the "item_content" field.
	ItemContent string `json:"item_content,omitempty"`
	// ItemLink holds the value of the "item_link" field.
	ItemLink string `json:"item_link,omitempty"`
	// ItemUpdated holds the value of the "item_updated" field.
	ItemUpdated time.Time `json:"item_updated,omitempty"`
	// ItemPublished holds the value of the "item_published" field.
	ItemPublished time.Time `json:"item_published,omitempty"`
	// ItemAuthorName holds the value of the "item_author_name" field.
	ItemAuthorName string `json:"item_author_name,omitempty"`
	// ItemAuthorEmail holds the value of the "item_author_email" field.
	ItemAuthorEmail string `json:"item_author_email,omitempty"`
	// ItemImageTitle holds the value of the "item_image_title" field.
	ItemImageTitle string `json:"item_image_title,omitempty"`
	// ItemImageURL holds the value of the "item_image_url" field.
	ItemImageURL string `json:"item_image_url,omitempty"`
	// ItemCategories holds the value of the "item_categories" field.
	ItemCategories string `json:"item_categories,omitempty"`
	// ItemEnclosures holds the value of the "item_enclosures" field.
	ItemEnclosures string `json:"item_enclosures,omitempty"`
	// CrawlerTitle holds the value of the "crawler_title" field.
	CrawlerTitle string `json:"crawler_title,omitempty"`
	// CrawlerAuthor holds the value of the "crawler_author" field.
	CrawlerAuthor string `json:"crawler_author,omitempty"`
	// CrawlerExcerpt holds the value of the "crawler_excerpt" field.
	CrawlerExcerpt string `json:"crawler_excerpt,omitempty"`
	// CrawlerSiteName holds the value of the "crawler_site_name" field.
	CrawlerSiteName string `json:"crawler_site_name,omitempty"`
	// CrawlerImage holds the value of the "crawler_image" field.
	CrawlerImage string `json:"crawler_image,omitempty"`
	// CrawlerContentHTML holds the value of the "crawler_content_html" field.
	CrawlerContentHTML string `json:"crawler_content_html,omitempty"`
	// CrawlerContentText holds the value of the "crawler_content_text" field.
	CrawlerContentText string `json:"crawler_content_text,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemQuery when eager-loading is set.
	Edges ItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Item is the model entity for the Item schema.

func (*Item) QueryFeed

func (i *Item) QueryFeed() *FeedQuery

QueryFeed queries the "feed" edge of the Item entity.

func (*Item) QueryReadByUsers

func (i *Item) QueryReadByUsers() *UserQuery

QueryReadByUsers queries the "read_by_users" edge of the Item entity.

func (*Item) QueryReads

func (i *Item) QueryReads() *ReadQuery

QueryReads queries the "reads" edge of the Item entity.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

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

func (i *Item) Update() *ItemUpdateOne

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

type ItemClient

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

ItemClient is a client for the Item schema.

func NewItemClient

func NewItemClient(c config) *ItemClient

NewItemClient returns a client for the Item from the given config.

func (*ItemClient) Create

func (c *ItemClient) Create() *ItemCreate

Create returns a builder for creating a Item entity.

func (*ItemClient) CreateBulk

func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk

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

func (*ItemClient) Delete

func (c *ItemClient) Delete() *ItemDelete

Delete returns a delete builder for Item.

func (*ItemClient) DeleteOne

func (c *ItemClient) DeleteOne(i *Item) *ItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemClient) DeleteOneID

func (c *ItemClient) DeleteOneID(id uuid.UUID) *ItemDeleteOne

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

func (*ItemClient) Get

func (c *ItemClient) Get(ctx context.Context, id uuid.UUID) (*Item, error)

Get returns a Item entity by its id.

func (*ItemClient) GetX

func (c *ItemClient) GetX(ctx context.Context, id uuid.UUID) *Item

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

func (*ItemClient) Hooks

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

Hooks returns the client hooks.

func (*ItemClient) Query

func (c *ItemClient) Query() *ItemQuery

Query returns a query builder for Item.

func (*ItemClient) QueryFeed

func (c *ItemClient) QueryFeed(i *Item) *FeedQuery

QueryFeed queries the feed edge of a Item.

func (*ItemClient) QueryReadByUsers

func (c *ItemClient) QueryReadByUsers(i *Item) *UserQuery

QueryReadByUsers queries the read_by_users edge of a Item.

func (*ItemClient) QueryReads

func (c *ItemClient) QueryReads(i *Item) *ReadQuery

QueryReads queries the reads edge of a Item.

func (*ItemClient) Update

func (c *ItemClient) Update() *ItemUpdate

Update returns an update builder for Item.

func (*ItemClient) UpdateOne

func (c *ItemClient) UpdateOne(i *Item) *ItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemClient) UpdateOneID

func (c *ItemClient) UpdateOneID(id uuid.UUID) *ItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemClient) Use

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

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

type ItemCreate

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

ItemCreate is the builder for creating a Item entity.

func (*ItemCreate) AddReadByUserIDs

func (ic *ItemCreate) AddReadByUserIDs(ids ...uuid.UUID) *ItemCreate

AddReadByUserIDs adds the "read_by_users" edge to the User entity by IDs.

func (*ItemCreate) AddReadByUsers

func (ic *ItemCreate) AddReadByUsers(u ...*User) *ItemCreate

AddReadByUsers adds the "read_by_users" edges to the User entity.

func (*ItemCreate) AddReadIDs

func (ic *ItemCreate) AddReadIDs(ids ...uuid.UUID) *ItemCreate

AddReadIDs adds the "reads" edge to the Read entity by IDs.

func (*ItemCreate) AddReads

func (ic *ItemCreate) AddReads(r ...*Read) *ItemCreate

AddReads adds the "reads" edges to the Read entity.

func (*ItemCreate) Exec

func (ic *ItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreate) ExecX

func (ic *ItemCreate) ExecX(ctx context.Context)

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

func (*ItemCreate) Mutation

func (ic *ItemCreate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemCreate) OnConflict

func (ic *ItemCreate) OnConflict(opts ...sql.ConflictOption) *ItemUpsertOne

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

client.Item.Create().
	SetItemGUID(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.ItemUpsert) {
		SetItemGUID(v+v).
	}).
	Exec(ctx)

func (*ItemCreate) OnConflictColumns

func (ic *ItemCreate) OnConflictColumns(columns ...string) *ItemUpsertOne

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

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

func (*ItemCreate) Save

func (ic *ItemCreate) Save(ctx context.Context) (*Item, error)

Save creates the Item in the database.

func (*ItemCreate) SaveX

func (ic *ItemCreate) SaveX(ctx context.Context) *Item

SaveX calls Save and panics if Save returns an error.

func (*ItemCreate) SetCrawlerAuthor

func (ic *ItemCreate) SetCrawlerAuthor(s string) *ItemCreate

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemCreate) SetCrawlerContentHTML

func (ic *ItemCreate) SetCrawlerContentHTML(s string) *ItemCreate

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemCreate) SetCrawlerContentText

func (ic *ItemCreate) SetCrawlerContentText(s string) *ItemCreate

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemCreate) SetCrawlerExcerpt

func (ic *ItemCreate) SetCrawlerExcerpt(s string) *ItemCreate

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemCreate) SetCrawlerImage

func (ic *ItemCreate) SetCrawlerImage(s string) *ItemCreate

SetCrawlerImage sets the "crawler_image" field.

func (*ItemCreate) SetCrawlerSiteName

func (ic *ItemCreate) SetCrawlerSiteName(s string) *ItemCreate

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemCreate) SetCrawlerTitle

func (ic *ItemCreate) SetCrawlerTitle(s string) *ItemCreate

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemCreate) SetCreatedAt

func (ic *ItemCreate) SetCreatedAt(t time.Time) *ItemCreate

SetCreatedAt sets the "created_at" field.

func (*ItemCreate) SetFeed

func (ic *ItemCreate) SetFeed(f *Feed) *ItemCreate

SetFeed sets the "feed" edge to the Feed entity.

func (*ItemCreate) SetFeedID

func (ic *ItemCreate) SetFeedID(id uuid.UUID) *ItemCreate

SetFeedID sets the "feed" edge to the Feed entity by ID.

func (*ItemCreate) SetID

func (ic *ItemCreate) SetID(u uuid.UUID) *ItemCreate

SetID sets the "id" field.

func (*ItemCreate) SetItemAuthorEmail

func (ic *ItemCreate) SetItemAuthorEmail(s string) *ItemCreate

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemCreate) SetItemAuthorName

func (ic *ItemCreate) SetItemAuthorName(s string) *ItemCreate

SetItemAuthorName sets the "item_author_name" field.

func (*ItemCreate) SetItemCategories

func (ic *ItemCreate) SetItemCategories(s string) *ItemCreate

SetItemCategories sets the "item_categories" field.

func (*ItemCreate) SetItemContent

func (ic *ItemCreate) SetItemContent(s string) *ItemCreate

SetItemContent sets the "item_content" field.

func (*ItemCreate) SetItemDescription

func (ic *ItemCreate) SetItemDescription(s string) *ItemCreate

SetItemDescription sets the "item_description" field.

func (*ItemCreate) SetItemEnclosures

func (ic *ItemCreate) SetItemEnclosures(s string) *ItemCreate

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemCreate) SetItemGUID

func (ic *ItemCreate) SetItemGUID(s string) *ItemCreate

SetItemGUID sets the "item_guid" field.

func (*ItemCreate) SetItemImageTitle

func (ic *ItemCreate) SetItemImageTitle(s string) *ItemCreate

SetItemImageTitle sets the "item_image_title" field.

func (*ItemCreate) SetItemImageURL

func (ic *ItemCreate) SetItemImageURL(s string) *ItemCreate

SetItemImageURL sets the "item_image_url" field.

func (ic *ItemCreate) SetItemLink(s string) *ItemCreate

SetItemLink sets the "item_link" field.

func (*ItemCreate) SetItemPublished

func (ic *ItemCreate) SetItemPublished(t time.Time) *ItemCreate

SetItemPublished sets the "item_published" field.

func (*ItemCreate) SetItemTitle

func (ic *ItemCreate) SetItemTitle(s string) *ItemCreate

SetItemTitle sets the "item_title" field.

func (*ItemCreate) SetItemUpdated

func (ic *ItemCreate) SetItemUpdated(t time.Time) *ItemCreate

SetItemUpdated sets the "item_updated" field.

func (*ItemCreate) SetNillableCrawlerAuthor

func (ic *ItemCreate) SetNillableCrawlerAuthor(s *string) *ItemCreate

SetNillableCrawlerAuthor sets the "crawler_author" field if the given value is not nil.

func (*ItemCreate) SetNillableCrawlerContentHTML

func (ic *ItemCreate) SetNillableCrawlerContentHTML(s *string) *ItemCreate

SetNillableCrawlerContentHTML sets the "crawler_content_html" field if the given value is not nil.

func (*ItemCreate) SetNillableCrawlerContentText

func (ic *ItemCreate) SetNillableCrawlerContentText(s *string) *ItemCreate

SetNillableCrawlerContentText sets the "crawler_content_text" field if the given value is not nil.

func (*ItemCreate) SetNillableCrawlerExcerpt

func (ic *ItemCreate) SetNillableCrawlerExcerpt(s *string) *ItemCreate

SetNillableCrawlerExcerpt sets the "crawler_excerpt" field if the given value is not nil.

func (*ItemCreate) SetNillableCrawlerImage

func (ic *ItemCreate) SetNillableCrawlerImage(s *string) *ItemCreate

SetNillableCrawlerImage sets the "crawler_image" field if the given value is not nil.

func (*ItemCreate) SetNillableCrawlerSiteName

func (ic *ItemCreate) SetNillableCrawlerSiteName(s *string) *ItemCreate

SetNillableCrawlerSiteName sets the "crawler_site_name" field if the given value is not nil.

func (*ItemCreate) SetNillableCrawlerTitle

func (ic *ItemCreate) SetNillableCrawlerTitle(s *string) *ItemCreate

SetNillableCrawlerTitle sets the "crawler_title" field if the given value is not nil.

func (*ItemCreate) SetNillableCreatedAt

func (ic *ItemCreate) SetNillableCreatedAt(t *time.Time) *ItemCreate

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

func (*ItemCreate) SetNillableFeedID

func (ic *ItemCreate) SetNillableFeedID(id *uuid.UUID) *ItemCreate

SetNillableFeedID sets the "feed" edge to the Feed entity by ID if the given value is not nil.

func (*ItemCreate) SetNillableID

func (ic *ItemCreate) SetNillableID(u *uuid.UUID) *ItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ItemCreate) SetNillableItemAuthorEmail

func (ic *ItemCreate) SetNillableItemAuthorEmail(s *string) *ItemCreate

SetNillableItemAuthorEmail sets the "item_author_email" field if the given value is not nil.

func (*ItemCreate) SetNillableItemAuthorName

func (ic *ItemCreate) SetNillableItemAuthorName(s *string) *ItemCreate

SetNillableItemAuthorName sets the "item_author_name" field if the given value is not nil.

func (*ItemCreate) SetNillableItemImageTitle

func (ic *ItemCreate) SetNillableItemImageTitle(s *string) *ItemCreate

SetNillableItemImageTitle sets the "item_image_title" field if the given value is not nil.

func (*ItemCreate) SetNillableItemImageURL

func (ic *ItemCreate) SetNillableItemImageURL(s *string) *ItemCreate

SetNillableItemImageURL sets the "item_image_url" field if the given value is not nil.

func (*ItemCreate) SetNillableUpdatedAt

func (ic *ItemCreate) SetNillableUpdatedAt(t *time.Time) *ItemCreate

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

func (*ItemCreate) SetUpdatedAt

func (ic *ItemCreate) SetUpdatedAt(t time.Time) *ItemCreate

SetUpdatedAt sets the "updated_at" field.

type ItemCreateBulk

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

ItemCreateBulk is the builder for creating many Item entities in bulk.

func (*ItemCreateBulk) Exec

func (icb *ItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreateBulk) ExecX

func (icb *ItemCreateBulk) ExecX(ctx context.Context)

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

func (*ItemCreateBulk) OnConflict

func (icb *ItemCreateBulk) OnConflict(opts ...sql.ConflictOption) *ItemUpsertBulk

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

client.Item.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.ItemUpsert) {
		SetItemGUID(v+v).
	}).
	Exec(ctx)

func (*ItemCreateBulk) OnConflictColumns

func (icb *ItemCreateBulk) OnConflictColumns(columns ...string) *ItemUpsertBulk

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

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

func (*ItemCreateBulk) Save

func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error)

Save creates the Item entities in the database.

func (*ItemCreateBulk) SaveX

func (icb *ItemCreateBulk) SaveX(ctx context.Context) []*Item

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

type ItemDelete

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

ItemDelete is the builder for deleting a Item entity.

func (*ItemDelete) Exec

func (id *ItemDelete) Exec(ctx context.Context) (int, error)

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

func (*ItemDelete) ExecX

func (id *ItemDelete) ExecX(ctx context.Context) int

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

func (*ItemDelete) Where

func (id *ItemDelete) Where(ps ...predicate.Item) *ItemDelete

Where appends a list predicates to the ItemDelete builder.

type ItemDeleteOne

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

ItemDeleteOne is the builder for deleting a single Item entity.

func (*ItemDeleteOne) Exec

func (ido *ItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemDeleteOne) ExecX

func (ido *ItemDeleteOne) ExecX(ctx context.Context)

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

type ItemEdges

type ItemEdges struct {
	// Feed holds the value of the feed edge.
	Feed *Feed `json:"feed,omitempty"`
	// ReadByUsers holds the value of the read_by_users edge.
	ReadByUsers []*User `json:"read_by_users,omitempty"`
	// Reads holds the value of the reads edge.
	Reads []*Read `json:"reads,omitempty"`
	// contains filtered or unexported fields
}

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

func (ItemEdges) FeedOrErr

func (e ItemEdges) FeedOrErr() (*Feed, error)

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

func (ItemEdges) ReadByUsersOrErr

func (e ItemEdges) ReadByUsersOrErr() ([]*User, error)

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

func (ItemEdges) ReadsOrErr

func (e ItemEdges) ReadsOrErr() ([]*Read, error)

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

type ItemGroupBy

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

ItemGroupBy is the group-by builder for Item entities.

func (*ItemGroupBy) Aggregate

func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy

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

func (*ItemGroupBy) Bool

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

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

func (*ItemGroupBy) BoolX

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

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

func (*ItemGroupBy) Bools

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

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

func (*ItemGroupBy) BoolsX

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

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

func (*ItemGroupBy) Float64

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

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

func (*ItemGroupBy) Float64X

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

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

func (*ItemGroupBy) Float64s

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

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

func (*ItemGroupBy) Float64sX

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

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

func (*ItemGroupBy) Int

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

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

func (*ItemGroupBy) IntX

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

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

func (*ItemGroupBy) Ints

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

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

func (*ItemGroupBy) IntsX

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

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

func (*ItemGroupBy) Scan

func (igb *ItemGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ItemGroupBy) ScanX

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

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

func (*ItemGroupBy) String

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

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

func (*ItemGroupBy) StringX

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

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

func (*ItemGroupBy) Strings

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

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

func (*ItemGroupBy) StringsX

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

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

type ItemMutation

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

ItemMutation represents an operation that mutates the Item nodes in the graph.

func (*ItemMutation) AddField

func (m *ItemMutation) 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 (*ItemMutation) AddReadByUserIDs

func (m *ItemMutation) AddReadByUserIDs(ids ...uuid.UUID)

AddReadByUserIDs adds the "read_by_users" edge to the User entity by ids.

func (*ItemMutation) AddReadIDs

func (m *ItemMutation) AddReadIDs(ids ...uuid.UUID)

AddReadIDs adds the "reads" edge to the Read entity by ids.

func (*ItemMutation) AddedEdges

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

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

func (*ItemMutation) AddedField

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

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

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

func (*ItemMutation) AddedIDs

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

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

func (*ItemMutation) ClearCrawlerAuthor

func (m *ItemMutation) ClearCrawlerAuthor()

ClearCrawlerAuthor clears the value of the "crawler_author" field.

func (*ItemMutation) ClearCrawlerContentHTML

func (m *ItemMutation) ClearCrawlerContentHTML()

ClearCrawlerContentHTML clears the value of the "crawler_content_html" field.

func (*ItemMutation) ClearCrawlerContentText

func (m *ItemMutation) ClearCrawlerContentText()

ClearCrawlerContentText clears the value of the "crawler_content_text" field.

func (*ItemMutation) ClearCrawlerExcerpt

func (m *ItemMutation) ClearCrawlerExcerpt()

ClearCrawlerExcerpt clears the value of the "crawler_excerpt" field.

func (*ItemMutation) ClearCrawlerImage

func (m *ItemMutation) ClearCrawlerImage()

ClearCrawlerImage clears the value of the "crawler_image" field.

func (*ItemMutation) ClearCrawlerSiteName

func (m *ItemMutation) ClearCrawlerSiteName()

ClearCrawlerSiteName clears the value of the "crawler_site_name" field.

func (*ItemMutation) ClearCrawlerTitle

func (m *ItemMutation) ClearCrawlerTitle()

ClearCrawlerTitle clears the value of the "crawler_title" field.

func (*ItemMutation) ClearEdge

func (m *ItemMutation) 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 (*ItemMutation) ClearFeed

func (m *ItemMutation) ClearFeed()

ClearFeed clears the "feed" edge to the Feed entity.

func (*ItemMutation) ClearField

func (m *ItemMutation) 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 (*ItemMutation) ClearItemAuthorEmail

func (m *ItemMutation) ClearItemAuthorEmail()

ClearItemAuthorEmail clears the value of the "item_author_email" field.

func (*ItemMutation) ClearItemAuthorName

func (m *ItemMutation) ClearItemAuthorName()

ClearItemAuthorName clears the value of the "item_author_name" field.

func (*ItemMutation) ClearItemImageTitle

func (m *ItemMutation) ClearItemImageTitle()

ClearItemImageTitle clears the value of the "item_image_title" field.

func (*ItemMutation) ClearItemImageURL

func (m *ItemMutation) ClearItemImageURL()

ClearItemImageURL clears the value of the "item_image_url" field.

func (*ItemMutation) ClearReadByUsers

func (m *ItemMutation) ClearReadByUsers()

ClearReadByUsers clears the "read_by_users" edge to the User entity.

func (*ItemMutation) ClearReads

func (m *ItemMutation) ClearReads()

ClearReads clears the "reads" edge to the Read entity.

func (*ItemMutation) ClearedEdges

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

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

func (*ItemMutation) ClearedFields

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

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

func (ItemMutation) Client

func (m ItemMutation) 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 (*ItemMutation) CrawlerAuthor

func (m *ItemMutation) CrawlerAuthor() (r string, exists bool)

CrawlerAuthor returns the value of the "crawler_author" field in the mutation.

func (*ItemMutation) CrawlerAuthorCleared

func (m *ItemMutation) CrawlerAuthorCleared() bool

CrawlerAuthorCleared returns if the "crawler_author" field was cleared in this mutation.

func (*ItemMutation) CrawlerContentHTML

func (m *ItemMutation) CrawlerContentHTML() (r string, exists bool)

CrawlerContentHTML returns the value of the "crawler_content_html" field in the mutation.

func (*ItemMutation) CrawlerContentHTMLCleared

func (m *ItemMutation) CrawlerContentHTMLCleared() bool

CrawlerContentHTMLCleared returns if the "crawler_content_html" field was cleared in this mutation.

func (*ItemMutation) CrawlerContentText

func (m *ItemMutation) CrawlerContentText() (r string, exists bool)

CrawlerContentText returns the value of the "crawler_content_text" field in the mutation.

func (*ItemMutation) CrawlerContentTextCleared

func (m *ItemMutation) CrawlerContentTextCleared() bool

CrawlerContentTextCleared returns if the "crawler_content_text" field was cleared in this mutation.

func (*ItemMutation) CrawlerExcerpt

func (m *ItemMutation) CrawlerExcerpt() (r string, exists bool)

CrawlerExcerpt returns the value of the "crawler_excerpt" field in the mutation.

func (*ItemMutation) CrawlerExcerptCleared

func (m *ItemMutation) CrawlerExcerptCleared() bool

CrawlerExcerptCleared returns if the "crawler_excerpt" field was cleared in this mutation.

func (*ItemMutation) CrawlerImage

func (m *ItemMutation) CrawlerImage() (r string, exists bool)

CrawlerImage returns the value of the "crawler_image" field in the mutation.

func (*ItemMutation) CrawlerImageCleared

func (m *ItemMutation) CrawlerImageCleared() bool

CrawlerImageCleared returns if the "crawler_image" field was cleared in this mutation.

func (*ItemMutation) CrawlerSiteName

func (m *ItemMutation) CrawlerSiteName() (r string, exists bool)

CrawlerSiteName returns the value of the "crawler_site_name" field in the mutation.

func (*ItemMutation) CrawlerSiteNameCleared

func (m *ItemMutation) CrawlerSiteNameCleared() bool

CrawlerSiteNameCleared returns if the "crawler_site_name" field was cleared in this mutation.

func (*ItemMutation) CrawlerTitle

func (m *ItemMutation) CrawlerTitle() (r string, exists bool)

CrawlerTitle returns the value of the "crawler_title" field in the mutation.

func (*ItemMutation) CrawlerTitleCleared

func (m *ItemMutation) CrawlerTitleCleared() bool

CrawlerTitleCleared returns if the "crawler_title" field was cleared in this mutation.

func (*ItemMutation) CreatedAt

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

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

func (*ItemMutation) EdgeCleared

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

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

func (*ItemMutation) FeedCleared

func (m *ItemMutation) FeedCleared() bool

FeedCleared reports if the "feed" edge to the Feed entity was cleared.

func (*ItemMutation) FeedID

func (m *ItemMutation) FeedID() (id uuid.UUID, exists bool)

FeedID returns the "feed" edge ID in the mutation.

func (*ItemMutation) FeedIDs

func (m *ItemMutation) FeedIDs() (ids []uuid.UUID)

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

func (*ItemMutation) Field

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

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

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

func (*ItemMutation) Fields

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

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

func (m *ItemMutation) 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 (*ItemMutation) ItemAuthorEmail

func (m *ItemMutation) ItemAuthorEmail() (r string, exists bool)

ItemAuthorEmail returns the value of the "item_author_email" field in the mutation.

func (*ItemMutation) ItemAuthorEmailCleared

func (m *ItemMutation) ItemAuthorEmailCleared() bool

ItemAuthorEmailCleared returns if the "item_author_email" field was cleared in this mutation.

func (*ItemMutation) ItemAuthorName

func (m *ItemMutation) ItemAuthorName() (r string, exists bool)

ItemAuthorName returns the value of the "item_author_name" field in the mutation.

func (*ItemMutation) ItemAuthorNameCleared

func (m *ItemMutation) ItemAuthorNameCleared() bool

ItemAuthorNameCleared returns if the "item_author_name" field was cleared in this mutation.

func (*ItemMutation) ItemCategories

func (m *ItemMutation) ItemCategories() (r string, exists bool)

ItemCategories returns the value of the "item_categories" field in the mutation.

func (*ItemMutation) ItemContent

func (m *ItemMutation) ItemContent() (r string, exists bool)

ItemContent returns the value of the "item_content" field in the mutation.

func (*ItemMutation) ItemDescription

func (m *ItemMutation) ItemDescription() (r string, exists bool)

ItemDescription returns the value of the "item_description" field in the mutation.

func (*ItemMutation) ItemEnclosures

func (m *ItemMutation) ItemEnclosures() (r string, exists bool)

ItemEnclosures returns the value of the "item_enclosures" field in the mutation.

func (*ItemMutation) ItemGUID

func (m *ItemMutation) ItemGUID() (r string, exists bool)

ItemGUID returns the value of the "item_guid" field in the mutation.

func (*ItemMutation) ItemImageTitle

func (m *ItemMutation) ItemImageTitle() (r string, exists bool)

ItemImageTitle returns the value of the "item_image_title" field in the mutation.

func (*ItemMutation) ItemImageTitleCleared

func (m *ItemMutation) ItemImageTitleCleared() bool

ItemImageTitleCleared returns if the "item_image_title" field was cleared in this mutation.

func (*ItemMutation) ItemImageURL

func (m *ItemMutation) ItemImageURL() (r string, exists bool)

ItemImageURL returns the value of the "item_image_url" field in the mutation.

func (*ItemMutation) ItemImageURLCleared

func (m *ItemMutation) ItemImageURLCleared() bool

ItemImageURLCleared returns if the "item_image_url" field was cleared in this mutation.

func (m *ItemMutation) ItemLink() (r string, exists bool)

ItemLink returns the value of the "item_link" field in the mutation.

func (*ItemMutation) ItemPublished

func (m *ItemMutation) ItemPublished() (r time.Time, exists bool)

ItemPublished returns the value of the "item_published" field in the mutation.

func (*ItemMutation) ItemTitle

func (m *ItemMutation) ItemTitle() (r string, exists bool)

ItemTitle returns the value of the "item_title" field in the mutation.

func (*ItemMutation) ItemUpdated

func (m *ItemMutation) ItemUpdated() (r time.Time, exists bool)

ItemUpdated returns the value of the "item_updated" field in the mutation.

func (*ItemMutation) OldCrawlerAuthor

func (m *ItemMutation) OldCrawlerAuthor(ctx context.Context) (v string, err error)

OldCrawlerAuthor returns the old "crawler_author" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCrawlerContentHTML

func (m *ItemMutation) OldCrawlerContentHTML(ctx context.Context) (v string, err error)

OldCrawlerContentHTML returns the old "crawler_content_html" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCrawlerContentText

func (m *ItemMutation) OldCrawlerContentText(ctx context.Context) (v string, err error)

OldCrawlerContentText returns the old "crawler_content_text" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCrawlerExcerpt

func (m *ItemMutation) OldCrawlerExcerpt(ctx context.Context) (v string, err error)

OldCrawlerExcerpt returns the old "crawler_excerpt" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCrawlerImage

func (m *ItemMutation) OldCrawlerImage(ctx context.Context) (v string, err error)

OldCrawlerImage returns the old "crawler_image" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCrawlerSiteName

func (m *ItemMutation) OldCrawlerSiteName(ctx context.Context) (v string, err error)

OldCrawlerSiteName returns the old "crawler_site_name" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCrawlerTitle

func (m *ItemMutation) OldCrawlerTitle(ctx context.Context) (v string, err error)

OldCrawlerTitle returns the old "crawler_title" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCreatedAt

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

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

func (m *ItemMutation) 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 (*ItemMutation) OldItemAuthorEmail

func (m *ItemMutation) OldItemAuthorEmail(ctx context.Context) (v string, err error)

OldItemAuthorEmail returns the old "item_author_email" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemAuthorName

func (m *ItemMutation) OldItemAuthorName(ctx context.Context) (v string, err error)

OldItemAuthorName returns the old "item_author_name" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemCategories

func (m *ItemMutation) OldItemCategories(ctx context.Context) (v string, err error)

OldItemCategories returns the old "item_categories" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemContent

func (m *ItemMutation) OldItemContent(ctx context.Context) (v string, err error)

OldItemContent returns the old "item_content" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemDescription

func (m *ItemMutation) OldItemDescription(ctx context.Context) (v string, err error)

OldItemDescription returns the old "item_description" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemEnclosures

func (m *ItemMutation) OldItemEnclosures(ctx context.Context) (v string, err error)

OldItemEnclosures returns the old "item_enclosures" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemGUID

func (m *ItemMutation) OldItemGUID(ctx context.Context) (v string, err error)

OldItemGUID returns the old "item_guid" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemImageTitle

func (m *ItemMutation) OldItemImageTitle(ctx context.Context) (v string, err error)

OldItemImageTitle returns the old "item_image_title" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemImageURL

func (m *ItemMutation) OldItemImageURL(ctx context.Context) (v string, err error)

OldItemImageURL returns the old "item_image_url" field's value of the Item entity. If the Item 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 (m *ItemMutation) OldItemLink(ctx context.Context) (v string, err error)

OldItemLink returns the old "item_link" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemPublished

func (m *ItemMutation) OldItemPublished(ctx context.Context) (v time.Time, err error)

OldItemPublished returns the old "item_published" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemTitle

func (m *ItemMutation) OldItemTitle(ctx context.Context) (v string, err error)

OldItemTitle returns the old "item_title" field's value of the Item entity. If the Item 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 (*ItemMutation) OldItemUpdated

func (m *ItemMutation) OldItemUpdated(ctx context.Context) (v time.Time, err error)

OldItemUpdated returns the old "item_updated" field's value of the Item entity. If the Item 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 (*ItemMutation) OldUpdatedAt

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

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

func (m *ItemMutation) Op() Op

Op returns the operation name.

func (*ItemMutation) ReadByUsersCleared

func (m *ItemMutation) ReadByUsersCleared() bool

ReadByUsersCleared reports if the "read_by_users" edge to the User entity was cleared.

func (*ItemMutation) ReadByUsersIDs

func (m *ItemMutation) ReadByUsersIDs() (ids []uuid.UUID)

ReadByUsersIDs returns the "read_by_users" edge IDs in the mutation.

func (*ItemMutation) ReadsCleared

func (m *ItemMutation) ReadsCleared() bool

ReadsCleared reports if the "reads" edge to the Read entity was cleared.

func (*ItemMutation) ReadsIDs

func (m *ItemMutation) ReadsIDs() (ids []uuid.UUID)

ReadsIDs returns the "reads" edge IDs in the mutation.

func (*ItemMutation) RemoveReadByUserIDs

func (m *ItemMutation) RemoveReadByUserIDs(ids ...uuid.UUID)

RemoveReadByUserIDs removes the "read_by_users" edge to the User entity by IDs.

func (*ItemMutation) RemoveReadIDs

func (m *ItemMutation) RemoveReadIDs(ids ...uuid.UUID)

RemoveReadIDs removes the "reads" edge to the Read entity by IDs.

func (*ItemMutation) RemovedEdges

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

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

func (*ItemMutation) RemovedIDs

func (m *ItemMutation) 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 (*ItemMutation) RemovedReadByUsersIDs

func (m *ItemMutation) RemovedReadByUsersIDs() (ids []uuid.UUID)

RemovedReadByUsers returns the removed IDs of the "read_by_users" edge to the User entity.

func (*ItemMutation) RemovedReadsIDs

func (m *ItemMutation) RemovedReadsIDs() (ids []uuid.UUID)

RemovedReads returns the removed IDs of the "reads" edge to the Read entity.

func (*ItemMutation) ResetCrawlerAuthor

func (m *ItemMutation) ResetCrawlerAuthor()

ResetCrawlerAuthor resets all changes to the "crawler_author" field.

func (*ItemMutation) ResetCrawlerContentHTML

func (m *ItemMutation) ResetCrawlerContentHTML()

ResetCrawlerContentHTML resets all changes to the "crawler_content_html" field.

func (*ItemMutation) ResetCrawlerContentText

func (m *ItemMutation) ResetCrawlerContentText()

ResetCrawlerContentText resets all changes to the "crawler_content_text" field.

func (*ItemMutation) ResetCrawlerExcerpt

func (m *ItemMutation) ResetCrawlerExcerpt()

ResetCrawlerExcerpt resets all changes to the "crawler_excerpt" field.

func (*ItemMutation) ResetCrawlerImage

func (m *ItemMutation) ResetCrawlerImage()

ResetCrawlerImage resets all changes to the "crawler_image" field.

func (*ItemMutation) ResetCrawlerSiteName

func (m *ItemMutation) ResetCrawlerSiteName()

ResetCrawlerSiteName resets all changes to the "crawler_site_name" field.

func (*ItemMutation) ResetCrawlerTitle

func (m *ItemMutation) ResetCrawlerTitle()

ResetCrawlerTitle resets all changes to the "crawler_title" field.

func (*ItemMutation) ResetCreatedAt

func (m *ItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ItemMutation) ResetEdge

func (m *ItemMutation) 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 (*ItemMutation) ResetFeed

func (m *ItemMutation) ResetFeed()

ResetFeed resets all changes to the "feed" edge.

func (*ItemMutation) ResetField

func (m *ItemMutation) 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 (*ItemMutation) ResetItemAuthorEmail

func (m *ItemMutation) ResetItemAuthorEmail()

ResetItemAuthorEmail resets all changes to the "item_author_email" field.

func (*ItemMutation) ResetItemAuthorName

func (m *ItemMutation) ResetItemAuthorName()

ResetItemAuthorName resets all changes to the "item_author_name" field.

func (*ItemMutation) ResetItemCategories

func (m *ItemMutation) ResetItemCategories()

ResetItemCategories resets all changes to the "item_categories" field.

func (*ItemMutation) ResetItemContent

func (m *ItemMutation) ResetItemContent()

ResetItemContent resets all changes to the "item_content" field.

func (*ItemMutation) ResetItemDescription

func (m *ItemMutation) ResetItemDescription()

ResetItemDescription resets all changes to the "item_description" field.

func (*ItemMutation) ResetItemEnclosures

func (m *ItemMutation) ResetItemEnclosures()

ResetItemEnclosures resets all changes to the "item_enclosures" field.

func (*ItemMutation) ResetItemGUID

func (m *ItemMutation) ResetItemGUID()

ResetItemGUID resets all changes to the "item_guid" field.

func (*ItemMutation) ResetItemImageTitle

func (m *ItemMutation) ResetItemImageTitle()

ResetItemImageTitle resets all changes to the "item_image_title" field.

func (*ItemMutation) ResetItemImageURL

func (m *ItemMutation) ResetItemImageURL()

ResetItemImageURL resets all changes to the "item_image_url" field.

func (m *ItemMutation) ResetItemLink()

ResetItemLink resets all changes to the "item_link" field.

func (*ItemMutation) ResetItemPublished

func (m *ItemMutation) ResetItemPublished()

ResetItemPublished resets all changes to the "item_published" field.

func (*ItemMutation) ResetItemTitle

func (m *ItemMutation) ResetItemTitle()

ResetItemTitle resets all changes to the "item_title" field.

func (*ItemMutation) ResetItemUpdated

func (m *ItemMutation) ResetItemUpdated()

ResetItemUpdated resets all changes to the "item_updated" field.

func (*ItemMutation) ResetReadByUsers

func (m *ItemMutation) ResetReadByUsers()

ResetReadByUsers resets all changes to the "read_by_users" edge.

func (*ItemMutation) ResetReads

func (m *ItemMutation) ResetReads()

ResetReads resets all changes to the "reads" edge.

func (*ItemMutation) ResetUpdatedAt

func (m *ItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ItemMutation) SetCrawlerAuthor

func (m *ItemMutation) SetCrawlerAuthor(s string)

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemMutation) SetCrawlerContentHTML

func (m *ItemMutation) SetCrawlerContentHTML(s string)

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemMutation) SetCrawlerContentText

func (m *ItemMutation) SetCrawlerContentText(s string)

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemMutation) SetCrawlerExcerpt

func (m *ItemMutation) SetCrawlerExcerpt(s string)

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemMutation) SetCrawlerImage

func (m *ItemMutation) SetCrawlerImage(s string)

SetCrawlerImage sets the "crawler_image" field.

func (*ItemMutation) SetCrawlerSiteName

func (m *ItemMutation) SetCrawlerSiteName(s string)

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemMutation) SetCrawlerTitle

func (m *ItemMutation) SetCrawlerTitle(s string)

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ItemMutation) SetFeedID

func (m *ItemMutation) SetFeedID(id uuid.UUID)

SetFeedID sets the "feed" edge to the Feed entity by id.

func (*ItemMutation) SetField

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

func (m *ItemMutation) SetID(id uuid.UUID)

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

func (*ItemMutation) SetItemAuthorEmail

func (m *ItemMutation) SetItemAuthorEmail(s string)

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemMutation) SetItemAuthorName

func (m *ItemMutation) SetItemAuthorName(s string)

SetItemAuthorName sets the "item_author_name" field.

func (*ItemMutation) SetItemCategories

func (m *ItemMutation) SetItemCategories(s string)

SetItemCategories sets the "item_categories" field.

func (*ItemMutation) SetItemContent

func (m *ItemMutation) SetItemContent(s string)

SetItemContent sets the "item_content" field.

func (*ItemMutation) SetItemDescription

func (m *ItemMutation) SetItemDescription(s string)

SetItemDescription sets the "item_description" field.

func (*ItemMutation) SetItemEnclosures

func (m *ItemMutation) SetItemEnclosures(s string)

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemMutation) SetItemGUID

func (m *ItemMutation) SetItemGUID(s string)

SetItemGUID sets the "item_guid" field.

func (*ItemMutation) SetItemImageTitle

func (m *ItemMutation) SetItemImageTitle(s string)

SetItemImageTitle sets the "item_image_title" field.

func (*ItemMutation) SetItemImageURL

func (m *ItemMutation) SetItemImageURL(s string)

SetItemImageURL sets the "item_image_url" field.

func (m *ItemMutation) SetItemLink(s string)

SetItemLink sets the "item_link" field.

func (*ItemMutation) SetItemPublished

func (m *ItemMutation) SetItemPublished(t time.Time)

SetItemPublished sets the "item_published" field.

func (*ItemMutation) SetItemTitle

func (m *ItemMutation) SetItemTitle(s string)

SetItemTitle sets the "item_title" field.

func (*ItemMutation) SetItemUpdated

func (m *ItemMutation) SetItemUpdated(t time.Time)

SetItemUpdated sets the "item_updated" field.

func (*ItemMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (ItemMutation) Tx

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

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

func (*ItemMutation) Type

func (m *ItemMutation) Type() string

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

func (*ItemMutation) UpdatedAt

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

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

func (*ItemMutation) Where

func (m *ItemMutation) Where(ps ...predicate.Item)

Where appends a list predicates to the ItemMutation builder.

type ItemQuery

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

ItemQuery is the builder for querying Item entities.

func (*ItemQuery) All

func (iq *ItemQuery) All(ctx context.Context) ([]*Item, error)

All executes the query and returns a list of Items.

func (*ItemQuery) AllX

func (iq *ItemQuery) AllX(ctx context.Context) []*Item

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

func (*ItemQuery) Clone

func (iq *ItemQuery) Clone() *ItemQuery

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

func (*ItemQuery) Count

func (iq *ItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemQuery) CountX

func (iq *ItemQuery) CountX(ctx context.Context) int

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

func (*ItemQuery) Exist

func (iq *ItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*ItemQuery) ExistX

func (iq *ItemQuery) ExistX(ctx context.Context) bool

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

func (*ItemQuery) First

func (iq *ItemQuery) First(ctx context.Context) (*Item, error)

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

func (*ItemQuery) FirstID

func (iq *ItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemQuery) FirstIDX

func (iq *ItemQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ItemQuery) FirstX

func (iq *ItemQuery) FirstX(ctx context.Context) *Item

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

func (*ItemQuery) GroupBy

func (iq *ItemQuery) GroupBy(field string, fields ...string) *ItemGroupBy

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

client.Item.Query().
	GroupBy(item.FieldItemGUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemQuery) IDs

func (iq *ItemQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ItemQuery) IDsX

func (iq *ItemQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ItemQuery) Limit

func (iq *ItemQuery) Limit(limit int) *ItemQuery

Limit adds a limit step to the query.

func (*ItemQuery) Offset

func (iq *ItemQuery) Offset(offset int) *ItemQuery

Offset adds an offset step to the query.

func (*ItemQuery) Only

func (iq *ItemQuery) Only(ctx context.Context) (*Item, error)

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

func (*ItemQuery) OnlyID

func (iq *ItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemQuery) OnlyIDX

func (iq *ItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ItemQuery) OnlyX

func (iq *ItemQuery) OnlyX(ctx context.Context) *Item

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

func (*ItemQuery) Order

func (iq *ItemQuery) Order(o ...OrderFunc) *ItemQuery

Order adds an order step to the query.

func (*ItemQuery) QueryFeed

func (iq *ItemQuery) QueryFeed() *FeedQuery

QueryFeed chains the current query on the "feed" edge.

func (*ItemQuery) QueryReadByUsers

func (iq *ItemQuery) QueryReadByUsers() *UserQuery

QueryReadByUsers chains the current query on the "read_by_users" edge.

func (*ItemQuery) QueryReads

func (iq *ItemQuery) QueryReads() *ReadQuery

QueryReads chains the current query on the "reads" edge.

func (*ItemQuery) Select

func (iq *ItemQuery) Select(fields ...string) *ItemSelect

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

client.Item.Query().
	Select(item.FieldItemGUID).
	Scan(ctx, &v)

func (*ItemQuery) Unique

func (iq *ItemQuery) Unique(unique bool) *ItemQuery

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

func (iq *ItemQuery) Where(ps ...predicate.Item) *ItemQuery

Where adds a new predicate for the ItemQuery builder.

func (*ItemQuery) WithFeed

func (iq *ItemQuery) WithFeed(opts ...func(*FeedQuery)) *ItemQuery

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

func (*ItemQuery) WithReadByUsers

func (iq *ItemQuery) WithReadByUsers(opts ...func(*UserQuery)) *ItemQuery

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

func (*ItemQuery) WithReads

func (iq *ItemQuery) WithReads(opts ...func(*ReadQuery)) *ItemQuery

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

type ItemSelect

type ItemSelect struct {
	*ItemQuery
	// contains filtered or unexported fields
}

ItemSelect is the builder for selecting fields of Item entities.

func (*ItemSelect) Bool

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

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

func (*ItemSelect) BoolX

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

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

func (*ItemSelect) Bools

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

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

func (*ItemSelect) BoolsX

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

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

func (*ItemSelect) Float64

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

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

func (*ItemSelect) Float64X

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

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

func (*ItemSelect) Float64s

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

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

func (*ItemSelect) Float64sX

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

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

func (*ItemSelect) Int

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

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

func (*ItemSelect) IntX

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

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

func (*ItemSelect) Ints

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

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

func (*ItemSelect) IntsX

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

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

func (*ItemSelect) Scan

func (is *ItemSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ItemSelect) ScanX

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

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

func (*ItemSelect) String

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

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

func (*ItemSelect) StringX

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

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

func (*ItemSelect) Strings

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

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

func (*ItemSelect) StringsX

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

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

type ItemUpdate

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

ItemUpdate is the builder for updating Item entities.

func (*ItemUpdate) AddReadByUserIDs

func (iu *ItemUpdate) AddReadByUserIDs(ids ...uuid.UUID) *ItemUpdate

AddReadByUserIDs adds the "read_by_users" edge to the User entity by IDs.

func (*ItemUpdate) AddReadByUsers

func (iu *ItemUpdate) AddReadByUsers(u ...*User) *ItemUpdate

AddReadByUsers adds the "read_by_users" edges to the User entity.

func (*ItemUpdate) AddReadIDs

func (iu *ItemUpdate) AddReadIDs(ids ...uuid.UUID) *ItemUpdate

AddReadIDs adds the "reads" edge to the Read entity by IDs.

func (*ItemUpdate) AddReads

func (iu *ItemUpdate) AddReads(r ...*Read) *ItemUpdate

AddReads adds the "reads" edges to the Read entity.

func (*ItemUpdate) ClearCrawlerAuthor

func (iu *ItemUpdate) ClearCrawlerAuthor() *ItemUpdate

ClearCrawlerAuthor clears the value of the "crawler_author" field.

func (*ItemUpdate) ClearCrawlerContentHTML

func (iu *ItemUpdate) ClearCrawlerContentHTML() *ItemUpdate

ClearCrawlerContentHTML clears the value of the "crawler_content_html" field.

func (*ItemUpdate) ClearCrawlerContentText

func (iu *ItemUpdate) ClearCrawlerContentText() *ItemUpdate

ClearCrawlerContentText clears the value of the "crawler_content_text" field.

func (*ItemUpdate) ClearCrawlerExcerpt

func (iu *ItemUpdate) ClearCrawlerExcerpt() *ItemUpdate

ClearCrawlerExcerpt clears the value of the "crawler_excerpt" field.

func (*ItemUpdate) ClearCrawlerImage

func (iu *ItemUpdate) ClearCrawlerImage() *ItemUpdate

ClearCrawlerImage clears the value of the "crawler_image" field.

func (*ItemUpdate) ClearCrawlerSiteName

func (iu *ItemUpdate) ClearCrawlerSiteName() *ItemUpdate

ClearCrawlerSiteName clears the value of the "crawler_site_name" field.

func (*ItemUpdate) ClearCrawlerTitle

func (iu *ItemUpdate) ClearCrawlerTitle() *ItemUpdate

ClearCrawlerTitle clears the value of the "crawler_title" field.

func (*ItemUpdate) ClearFeed

func (iu *ItemUpdate) ClearFeed() *ItemUpdate

ClearFeed clears the "feed" edge to the Feed entity.

func (*ItemUpdate) ClearItemAuthorEmail

func (iu *ItemUpdate) ClearItemAuthorEmail() *ItemUpdate

ClearItemAuthorEmail clears the value of the "item_author_email" field.

func (*ItemUpdate) ClearItemAuthorName

func (iu *ItemUpdate) ClearItemAuthorName() *ItemUpdate

ClearItemAuthorName clears the value of the "item_author_name" field.

func (*ItemUpdate) ClearItemImageTitle

func (iu *ItemUpdate) ClearItemImageTitle() *ItemUpdate

ClearItemImageTitle clears the value of the "item_image_title" field.

func (*ItemUpdate) ClearItemImageURL

func (iu *ItemUpdate) ClearItemImageURL() *ItemUpdate

ClearItemImageURL clears the value of the "item_image_url" field.

func (*ItemUpdate) ClearReadByUsers

func (iu *ItemUpdate) ClearReadByUsers() *ItemUpdate

ClearReadByUsers clears all "read_by_users" edges to the User entity.

func (*ItemUpdate) ClearReads

func (iu *ItemUpdate) ClearReads() *ItemUpdate

ClearReads clears all "reads" edges to the Read entity.

func (*ItemUpdate) Exec

func (iu *ItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpdate) ExecX

func (iu *ItemUpdate) ExecX(ctx context.Context)

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

func (*ItemUpdate) Mutation

func (iu *ItemUpdate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdate) RemoveReadByUserIDs

func (iu *ItemUpdate) RemoveReadByUserIDs(ids ...uuid.UUID) *ItemUpdate

RemoveReadByUserIDs removes the "read_by_users" edge to User entities by IDs.

func (*ItemUpdate) RemoveReadByUsers

func (iu *ItemUpdate) RemoveReadByUsers(u ...*User) *ItemUpdate

RemoveReadByUsers removes "read_by_users" edges to User entities.

func (*ItemUpdate) RemoveReadIDs

func (iu *ItemUpdate) RemoveReadIDs(ids ...uuid.UUID) *ItemUpdate

RemoveReadIDs removes the "reads" edge to Read entities by IDs.

func (*ItemUpdate) RemoveReads

func (iu *ItemUpdate) RemoveReads(r ...*Read) *ItemUpdate

RemoveReads removes "reads" edges to Read entities.

func (*ItemUpdate) Save

func (iu *ItemUpdate) Save(ctx context.Context) (int, error)

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

func (*ItemUpdate) SaveX

func (iu *ItemUpdate) SaveX(ctx context.Context) int

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

func (*ItemUpdate) SetCrawlerAuthor

func (iu *ItemUpdate) SetCrawlerAuthor(s string) *ItemUpdate

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemUpdate) SetCrawlerContentHTML

func (iu *ItemUpdate) SetCrawlerContentHTML(s string) *ItemUpdate

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemUpdate) SetCrawlerContentText

func (iu *ItemUpdate) SetCrawlerContentText(s string) *ItemUpdate

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemUpdate) SetCrawlerExcerpt

func (iu *ItemUpdate) SetCrawlerExcerpt(s string) *ItemUpdate

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemUpdate) SetCrawlerImage

func (iu *ItemUpdate) SetCrawlerImage(s string) *ItemUpdate

SetCrawlerImage sets the "crawler_image" field.

func (*ItemUpdate) SetCrawlerSiteName

func (iu *ItemUpdate) SetCrawlerSiteName(s string) *ItemUpdate

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemUpdate) SetCrawlerTitle

func (iu *ItemUpdate) SetCrawlerTitle(s string) *ItemUpdate

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemUpdate) SetCreatedAt

func (iu *ItemUpdate) SetCreatedAt(t time.Time) *ItemUpdate

SetCreatedAt sets the "created_at" field.

func (*ItemUpdate) SetFeed

func (iu *ItemUpdate) SetFeed(f *Feed) *ItemUpdate

SetFeed sets the "feed" edge to the Feed entity.

func (*ItemUpdate) SetFeedID

func (iu *ItemUpdate) SetFeedID(id uuid.UUID) *ItemUpdate

SetFeedID sets the "feed" edge to the Feed entity by ID.

func (*ItemUpdate) SetItemAuthorEmail

func (iu *ItemUpdate) SetItemAuthorEmail(s string) *ItemUpdate

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemUpdate) SetItemAuthorName

func (iu *ItemUpdate) SetItemAuthorName(s string) *ItemUpdate

SetItemAuthorName sets the "item_author_name" field.

func (*ItemUpdate) SetItemCategories

func (iu *ItemUpdate) SetItemCategories(s string) *ItemUpdate

SetItemCategories sets the "item_categories" field.

func (*ItemUpdate) SetItemContent

func (iu *ItemUpdate) SetItemContent(s string) *ItemUpdate

SetItemContent sets the "item_content" field.

func (*ItemUpdate) SetItemDescription

func (iu *ItemUpdate) SetItemDescription(s string) *ItemUpdate

SetItemDescription sets the "item_description" field.

func (*ItemUpdate) SetItemEnclosures

func (iu *ItemUpdate) SetItemEnclosures(s string) *ItemUpdate

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemUpdate) SetItemGUID

func (iu *ItemUpdate) SetItemGUID(s string) *ItemUpdate

SetItemGUID sets the "item_guid" field.

func (*ItemUpdate) SetItemImageTitle

func (iu *ItemUpdate) SetItemImageTitle(s string) *ItemUpdate

SetItemImageTitle sets the "item_image_title" field.

func (*ItemUpdate) SetItemImageURL

func (iu *ItemUpdate) SetItemImageURL(s string) *ItemUpdate

SetItemImageURL sets the "item_image_url" field.

func (iu *ItemUpdate) SetItemLink(s string) *ItemUpdate

SetItemLink sets the "item_link" field.

func (*ItemUpdate) SetItemPublished

func (iu *ItemUpdate) SetItemPublished(t time.Time) *ItemUpdate

SetItemPublished sets the "item_published" field.

func (*ItemUpdate) SetItemTitle

func (iu *ItemUpdate) SetItemTitle(s string) *ItemUpdate

SetItemTitle sets the "item_title" field.

func (*ItemUpdate) SetItemUpdated

func (iu *ItemUpdate) SetItemUpdated(t time.Time) *ItemUpdate

SetItemUpdated sets the "item_updated" field.

func (*ItemUpdate) SetNillableCrawlerAuthor

func (iu *ItemUpdate) SetNillableCrawlerAuthor(s *string) *ItemUpdate

SetNillableCrawlerAuthor sets the "crawler_author" field if the given value is not nil.

func (*ItemUpdate) SetNillableCrawlerContentHTML

func (iu *ItemUpdate) SetNillableCrawlerContentHTML(s *string) *ItemUpdate

SetNillableCrawlerContentHTML sets the "crawler_content_html" field if the given value is not nil.

func (*ItemUpdate) SetNillableCrawlerContentText

func (iu *ItemUpdate) SetNillableCrawlerContentText(s *string) *ItemUpdate

SetNillableCrawlerContentText sets the "crawler_content_text" field if the given value is not nil.

func (*ItemUpdate) SetNillableCrawlerExcerpt

func (iu *ItemUpdate) SetNillableCrawlerExcerpt(s *string) *ItemUpdate

SetNillableCrawlerExcerpt sets the "crawler_excerpt" field if the given value is not nil.

func (*ItemUpdate) SetNillableCrawlerImage

func (iu *ItemUpdate) SetNillableCrawlerImage(s *string) *ItemUpdate

SetNillableCrawlerImage sets the "crawler_image" field if the given value is not nil.

func (*ItemUpdate) SetNillableCrawlerSiteName

func (iu *ItemUpdate) SetNillableCrawlerSiteName(s *string) *ItemUpdate

SetNillableCrawlerSiteName sets the "crawler_site_name" field if the given value is not nil.

func (*ItemUpdate) SetNillableCrawlerTitle

func (iu *ItemUpdate) SetNillableCrawlerTitle(s *string) *ItemUpdate

SetNillableCrawlerTitle sets the "crawler_title" field if the given value is not nil.

func (*ItemUpdate) SetNillableCreatedAt

func (iu *ItemUpdate) SetNillableCreatedAt(t *time.Time) *ItemUpdate

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

func (*ItemUpdate) SetNillableFeedID

func (iu *ItemUpdate) SetNillableFeedID(id *uuid.UUID) *ItemUpdate

SetNillableFeedID sets the "feed" edge to the Feed entity by ID if the given value is not nil.

func (*ItemUpdate) SetNillableItemAuthorEmail

func (iu *ItemUpdate) SetNillableItemAuthorEmail(s *string) *ItemUpdate

SetNillableItemAuthorEmail sets the "item_author_email" field if the given value is not nil.

func (*ItemUpdate) SetNillableItemAuthorName

func (iu *ItemUpdate) SetNillableItemAuthorName(s *string) *ItemUpdate

SetNillableItemAuthorName sets the "item_author_name" field if the given value is not nil.

func (*ItemUpdate) SetNillableItemImageTitle

func (iu *ItemUpdate) SetNillableItemImageTitle(s *string) *ItemUpdate

SetNillableItemImageTitle sets the "item_image_title" field if the given value is not nil.

func (*ItemUpdate) SetNillableItemImageURL

func (iu *ItemUpdate) SetNillableItemImageURL(s *string) *ItemUpdate

SetNillableItemImageURL sets the "item_image_url" field if the given value is not nil.

func (*ItemUpdate) SetUpdatedAt

func (iu *ItemUpdate) SetUpdatedAt(t time.Time) *ItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpdate) Where

func (iu *ItemUpdate) Where(ps ...predicate.Item) *ItemUpdate

Where appends a list predicates to the ItemUpdate builder.

type ItemUpdateOne

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

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) AddReadByUserIDs

func (iuo *ItemUpdateOne) AddReadByUserIDs(ids ...uuid.UUID) *ItemUpdateOne

AddReadByUserIDs adds the "read_by_users" edge to the User entity by IDs.

func (*ItemUpdateOne) AddReadByUsers

func (iuo *ItemUpdateOne) AddReadByUsers(u ...*User) *ItemUpdateOne

AddReadByUsers adds the "read_by_users" edges to the User entity.

func (*ItemUpdateOne) AddReadIDs

func (iuo *ItemUpdateOne) AddReadIDs(ids ...uuid.UUID) *ItemUpdateOne

AddReadIDs adds the "reads" edge to the Read entity by IDs.

func (*ItemUpdateOne) AddReads

func (iuo *ItemUpdateOne) AddReads(r ...*Read) *ItemUpdateOne

AddReads adds the "reads" edges to the Read entity.

func (*ItemUpdateOne) ClearCrawlerAuthor

func (iuo *ItemUpdateOne) ClearCrawlerAuthor() *ItemUpdateOne

ClearCrawlerAuthor clears the value of the "crawler_author" field.

func (*ItemUpdateOne) ClearCrawlerContentHTML

func (iuo *ItemUpdateOne) ClearCrawlerContentHTML() *ItemUpdateOne

ClearCrawlerContentHTML clears the value of the "crawler_content_html" field.

func (*ItemUpdateOne) ClearCrawlerContentText

func (iuo *ItemUpdateOne) ClearCrawlerContentText() *ItemUpdateOne

ClearCrawlerContentText clears the value of the "crawler_content_text" field.

func (*ItemUpdateOne) ClearCrawlerExcerpt

func (iuo *ItemUpdateOne) ClearCrawlerExcerpt() *ItemUpdateOne

ClearCrawlerExcerpt clears the value of the "crawler_excerpt" field.

func (*ItemUpdateOne) ClearCrawlerImage

func (iuo *ItemUpdateOne) ClearCrawlerImage() *ItemUpdateOne

ClearCrawlerImage clears the value of the "crawler_image" field.

func (*ItemUpdateOne) ClearCrawlerSiteName

func (iuo *ItemUpdateOne) ClearCrawlerSiteName() *ItemUpdateOne

ClearCrawlerSiteName clears the value of the "crawler_site_name" field.

func (*ItemUpdateOne) ClearCrawlerTitle

func (iuo *ItemUpdateOne) ClearCrawlerTitle() *ItemUpdateOne

ClearCrawlerTitle clears the value of the "crawler_title" field.

func (*ItemUpdateOne) ClearFeed

func (iuo *ItemUpdateOne) ClearFeed() *ItemUpdateOne

ClearFeed clears the "feed" edge to the Feed entity.

func (*ItemUpdateOne) ClearItemAuthorEmail

func (iuo *ItemUpdateOne) ClearItemAuthorEmail() *ItemUpdateOne

ClearItemAuthorEmail clears the value of the "item_author_email" field.

func (*ItemUpdateOne) ClearItemAuthorName

func (iuo *ItemUpdateOne) ClearItemAuthorName() *ItemUpdateOne

ClearItemAuthorName clears the value of the "item_author_name" field.

func (*ItemUpdateOne) ClearItemImageTitle

func (iuo *ItemUpdateOne) ClearItemImageTitle() *ItemUpdateOne

ClearItemImageTitle clears the value of the "item_image_title" field.

func (*ItemUpdateOne) ClearItemImageURL

func (iuo *ItemUpdateOne) ClearItemImageURL() *ItemUpdateOne

ClearItemImageURL clears the value of the "item_image_url" field.

func (*ItemUpdateOne) ClearReadByUsers

func (iuo *ItemUpdateOne) ClearReadByUsers() *ItemUpdateOne

ClearReadByUsers clears all "read_by_users" edges to the User entity.

func (*ItemUpdateOne) ClearReads

func (iuo *ItemUpdateOne) ClearReads() *ItemUpdateOne

ClearReads clears all "reads" edges to the Read entity.

func (*ItemUpdateOne) Exec

func (iuo *ItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemUpdateOne) ExecX

func (iuo *ItemUpdateOne) ExecX(ctx context.Context)

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

func (*ItemUpdateOne) Mutation

func (iuo *ItemUpdateOne) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdateOne) RemoveReadByUserIDs

func (iuo *ItemUpdateOne) RemoveReadByUserIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveReadByUserIDs removes the "read_by_users" edge to User entities by IDs.

func (*ItemUpdateOne) RemoveReadByUsers

func (iuo *ItemUpdateOne) RemoveReadByUsers(u ...*User) *ItemUpdateOne

RemoveReadByUsers removes "read_by_users" edges to User entities.

func (*ItemUpdateOne) RemoveReadIDs

func (iuo *ItemUpdateOne) RemoveReadIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveReadIDs removes the "reads" edge to Read entities by IDs.

func (*ItemUpdateOne) RemoveReads

func (iuo *ItemUpdateOne) RemoveReads(r ...*Read) *ItemUpdateOne

RemoveReads removes "reads" edges to Read entities.

func (*ItemUpdateOne) Save

func (iuo *ItemUpdateOne) Save(ctx context.Context) (*Item, error)

Save executes the query and returns the updated Item entity.

func (*ItemUpdateOne) SaveX

func (iuo *ItemUpdateOne) SaveX(ctx context.Context) *Item

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

func (*ItemUpdateOne) Select

func (iuo *ItemUpdateOne) Select(field string, fields ...string) *ItemUpdateOne

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

func (*ItemUpdateOne) SetCrawlerAuthor

func (iuo *ItemUpdateOne) SetCrawlerAuthor(s string) *ItemUpdateOne

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemUpdateOne) SetCrawlerContentHTML

func (iuo *ItemUpdateOne) SetCrawlerContentHTML(s string) *ItemUpdateOne

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemUpdateOne) SetCrawlerContentText

func (iuo *ItemUpdateOne) SetCrawlerContentText(s string) *ItemUpdateOne

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemUpdateOne) SetCrawlerExcerpt

func (iuo *ItemUpdateOne) SetCrawlerExcerpt(s string) *ItemUpdateOne

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemUpdateOne) SetCrawlerImage

func (iuo *ItemUpdateOne) SetCrawlerImage(s string) *ItemUpdateOne

SetCrawlerImage sets the "crawler_image" field.

func (*ItemUpdateOne) SetCrawlerSiteName

func (iuo *ItemUpdateOne) SetCrawlerSiteName(s string) *ItemUpdateOne

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemUpdateOne) SetCrawlerTitle

func (iuo *ItemUpdateOne) SetCrawlerTitle(s string) *ItemUpdateOne

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemUpdateOne) SetCreatedAt

func (iuo *ItemUpdateOne) SetCreatedAt(t time.Time) *ItemUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ItemUpdateOne) SetFeed

func (iuo *ItemUpdateOne) SetFeed(f *Feed) *ItemUpdateOne

SetFeed sets the "feed" edge to the Feed entity.

func (*ItemUpdateOne) SetFeedID

func (iuo *ItemUpdateOne) SetFeedID(id uuid.UUID) *ItemUpdateOne

SetFeedID sets the "feed" edge to the Feed entity by ID.

func (*ItemUpdateOne) SetItemAuthorEmail

func (iuo *ItemUpdateOne) SetItemAuthorEmail(s string) *ItemUpdateOne

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemUpdateOne) SetItemAuthorName

func (iuo *ItemUpdateOne) SetItemAuthorName(s string) *ItemUpdateOne

SetItemAuthorName sets the "item_author_name" field.

func (*ItemUpdateOne) SetItemCategories

func (iuo *ItemUpdateOne) SetItemCategories(s string) *ItemUpdateOne

SetItemCategories sets the "item_categories" field.

func (*ItemUpdateOne) SetItemContent

func (iuo *ItemUpdateOne) SetItemContent(s string) *ItemUpdateOne

SetItemContent sets the "item_content" field.

func (*ItemUpdateOne) SetItemDescription

func (iuo *ItemUpdateOne) SetItemDescription(s string) *ItemUpdateOne

SetItemDescription sets the "item_description" field.

func (*ItemUpdateOne) SetItemEnclosures

func (iuo *ItemUpdateOne) SetItemEnclosures(s string) *ItemUpdateOne

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemUpdateOne) SetItemGUID

func (iuo *ItemUpdateOne) SetItemGUID(s string) *ItemUpdateOne

SetItemGUID sets the "item_guid" field.

func (*ItemUpdateOne) SetItemImageTitle

func (iuo *ItemUpdateOne) SetItemImageTitle(s string) *ItemUpdateOne

SetItemImageTitle sets the "item_image_title" field.

func (*ItemUpdateOne) SetItemImageURL

func (iuo *ItemUpdateOne) SetItemImageURL(s string) *ItemUpdateOne

SetItemImageURL sets the "item_image_url" field.

func (iuo *ItemUpdateOne) SetItemLink(s string) *ItemUpdateOne

SetItemLink sets the "item_link" field.

func (*ItemUpdateOne) SetItemPublished

func (iuo *ItemUpdateOne) SetItemPublished(t time.Time) *ItemUpdateOne

SetItemPublished sets the "item_published" field.

func (*ItemUpdateOne) SetItemTitle

func (iuo *ItemUpdateOne) SetItemTitle(s string) *ItemUpdateOne

SetItemTitle sets the "item_title" field.

func (*ItemUpdateOne) SetItemUpdated

func (iuo *ItemUpdateOne) SetItemUpdated(t time.Time) *ItemUpdateOne

SetItemUpdated sets the "item_updated" field.

func (*ItemUpdateOne) SetNillableCrawlerAuthor

func (iuo *ItemUpdateOne) SetNillableCrawlerAuthor(s *string) *ItemUpdateOne

SetNillableCrawlerAuthor sets the "crawler_author" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCrawlerContentHTML

func (iuo *ItemUpdateOne) SetNillableCrawlerContentHTML(s *string) *ItemUpdateOne

SetNillableCrawlerContentHTML sets the "crawler_content_html" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCrawlerContentText

func (iuo *ItemUpdateOne) SetNillableCrawlerContentText(s *string) *ItemUpdateOne

SetNillableCrawlerContentText sets the "crawler_content_text" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCrawlerExcerpt

func (iuo *ItemUpdateOne) SetNillableCrawlerExcerpt(s *string) *ItemUpdateOne

SetNillableCrawlerExcerpt sets the "crawler_excerpt" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCrawlerImage

func (iuo *ItemUpdateOne) SetNillableCrawlerImage(s *string) *ItemUpdateOne

SetNillableCrawlerImage sets the "crawler_image" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCrawlerSiteName

func (iuo *ItemUpdateOne) SetNillableCrawlerSiteName(s *string) *ItemUpdateOne

SetNillableCrawlerSiteName sets the "crawler_site_name" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCrawlerTitle

func (iuo *ItemUpdateOne) SetNillableCrawlerTitle(s *string) *ItemUpdateOne

SetNillableCrawlerTitle sets the "crawler_title" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableCreatedAt

func (iuo *ItemUpdateOne) SetNillableCreatedAt(t *time.Time) *ItemUpdateOne

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

func (*ItemUpdateOne) SetNillableFeedID

func (iuo *ItemUpdateOne) SetNillableFeedID(id *uuid.UUID) *ItemUpdateOne

SetNillableFeedID sets the "feed" edge to the Feed entity by ID if the given value is not nil.

func (*ItemUpdateOne) SetNillableItemAuthorEmail

func (iuo *ItemUpdateOne) SetNillableItemAuthorEmail(s *string) *ItemUpdateOne

SetNillableItemAuthorEmail sets the "item_author_email" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableItemAuthorName

func (iuo *ItemUpdateOne) SetNillableItemAuthorName(s *string) *ItemUpdateOne

SetNillableItemAuthorName sets the "item_author_name" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableItemImageTitle

func (iuo *ItemUpdateOne) SetNillableItemImageTitle(s *string) *ItemUpdateOne

SetNillableItemImageTitle sets the "item_image_title" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableItemImageURL

func (iuo *ItemUpdateOne) SetNillableItemImageURL(s *string) *ItemUpdateOne

SetNillableItemImageURL sets the "item_image_url" field if the given value is not nil.

func (*ItemUpdateOne) SetUpdatedAt

func (iuo *ItemUpdateOne) SetUpdatedAt(t time.Time) *ItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

type ItemUpsert

type ItemUpsert struct {
	*sql.UpdateSet
}

ItemUpsert is the "OnConflict" setter.

func (*ItemUpsert) ClearCrawlerAuthor

func (u *ItemUpsert) ClearCrawlerAuthor() *ItemUpsert

ClearCrawlerAuthor clears the value of the "crawler_author" field.

func (*ItemUpsert) ClearCrawlerContentHTML

func (u *ItemUpsert) ClearCrawlerContentHTML() *ItemUpsert

ClearCrawlerContentHTML clears the value of the "crawler_content_html" field.

func (*ItemUpsert) ClearCrawlerContentText

func (u *ItemUpsert) ClearCrawlerContentText() *ItemUpsert

ClearCrawlerContentText clears the value of the "crawler_content_text" field.

func (*ItemUpsert) ClearCrawlerExcerpt

func (u *ItemUpsert) ClearCrawlerExcerpt() *ItemUpsert

ClearCrawlerExcerpt clears the value of the "crawler_excerpt" field.

func (*ItemUpsert) ClearCrawlerImage

func (u *ItemUpsert) ClearCrawlerImage() *ItemUpsert

ClearCrawlerImage clears the value of the "crawler_image" field.

func (*ItemUpsert) ClearCrawlerSiteName

func (u *ItemUpsert) ClearCrawlerSiteName() *ItemUpsert

ClearCrawlerSiteName clears the value of the "crawler_site_name" field.

func (*ItemUpsert) ClearCrawlerTitle

func (u *ItemUpsert) ClearCrawlerTitle() *ItemUpsert

ClearCrawlerTitle clears the value of the "crawler_title" field.

func (*ItemUpsert) ClearItemAuthorEmail

func (u *ItemUpsert) ClearItemAuthorEmail() *ItemUpsert

ClearItemAuthorEmail clears the value of the "item_author_email" field.

func (*ItemUpsert) ClearItemAuthorName

func (u *ItemUpsert) ClearItemAuthorName() *ItemUpsert

ClearItemAuthorName clears the value of the "item_author_name" field.

func (*ItemUpsert) ClearItemImageTitle

func (u *ItemUpsert) ClearItemImageTitle() *ItemUpsert

ClearItemImageTitle clears the value of the "item_image_title" field.

func (*ItemUpsert) ClearItemImageURL

func (u *ItemUpsert) ClearItemImageURL() *ItemUpsert

ClearItemImageURL clears the value of the "item_image_url" field.

func (*ItemUpsert) SetCrawlerAuthor

func (u *ItemUpsert) SetCrawlerAuthor(v string) *ItemUpsert

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemUpsert) SetCrawlerContentHTML

func (u *ItemUpsert) SetCrawlerContentHTML(v string) *ItemUpsert

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemUpsert) SetCrawlerContentText

func (u *ItemUpsert) SetCrawlerContentText(v string) *ItemUpsert

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemUpsert) SetCrawlerExcerpt

func (u *ItemUpsert) SetCrawlerExcerpt(v string) *ItemUpsert

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemUpsert) SetCrawlerImage

func (u *ItemUpsert) SetCrawlerImage(v string) *ItemUpsert

SetCrawlerImage sets the "crawler_image" field.

func (*ItemUpsert) SetCrawlerSiteName

func (u *ItemUpsert) SetCrawlerSiteName(v string) *ItemUpsert

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemUpsert) SetCrawlerTitle

func (u *ItemUpsert) SetCrawlerTitle(v string) *ItemUpsert

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemUpsert) SetCreatedAt

func (u *ItemUpsert) SetCreatedAt(v time.Time) *ItemUpsert

SetCreatedAt sets the "created_at" field.

func (*ItemUpsert) SetItemAuthorEmail

func (u *ItemUpsert) SetItemAuthorEmail(v string) *ItemUpsert

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemUpsert) SetItemAuthorName

func (u *ItemUpsert) SetItemAuthorName(v string) *ItemUpsert

SetItemAuthorName sets the "item_author_name" field.

func (*ItemUpsert) SetItemCategories

func (u *ItemUpsert) SetItemCategories(v string) *ItemUpsert

SetItemCategories sets the "item_categories" field.

func (*ItemUpsert) SetItemContent

func (u *ItemUpsert) SetItemContent(v string) *ItemUpsert

SetItemContent sets the "item_content" field.

func (*ItemUpsert) SetItemDescription

func (u *ItemUpsert) SetItemDescription(v string) *ItemUpsert

SetItemDescription sets the "item_description" field.

func (*ItemUpsert) SetItemEnclosures

func (u *ItemUpsert) SetItemEnclosures(v string) *ItemUpsert

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemUpsert) SetItemGUID

func (u *ItemUpsert) SetItemGUID(v string) *ItemUpsert

SetItemGUID sets the "item_guid" field.

func (*ItemUpsert) SetItemImageTitle

func (u *ItemUpsert) SetItemImageTitle(v string) *ItemUpsert

SetItemImageTitle sets the "item_image_title" field.

func (*ItemUpsert) SetItemImageURL

func (u *ItemUpsert) SetItemImageURL(v string) *ItemUpsert

SetItemImageURL sets the "item_image_url" field.

func (u *ItemUpsert) SetItemLink(v string) *ItemUpsert

SetItemLink sets the "item_link" field.

func (*ItemUpsert) SetItemPublished

func (u *ItemUpsert) SetItemPublished(v time.Time) *ItemUpsert

SetItemPublished sets the "item_published" field.

func (*ItemUpsert) SetItemTitle

func (u *ItemUpsert) SetItemTitle(v string) *ItemUpsert

SetItemTitle sets the "item_title" field.

func (*ItemUpsert) SetItemUpdated

func (u *ItemUpsert) SetItemUpdated(v time.Time) *ItemUpsert

SetItemUpdated sets the "item_updated" field.

func (*ItemUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpsert) UpdateCrawlerAuthor

func (u *ItemUpsert) UpdateCrawlerAuthor() *ItemUpsert

UpdateCrawlerAuthor sets the "crawler_author" field to the value that was provided on create.

func (*ItemUpsert) UpdateCrawlerContentHTML

func (u *ItemUpsert) UpdateCrawlerContentHTML() *ItemUpsert

UpdateCrawlerContentHTML sets the "crawler_content_html" field to the value that was provided on create.

func (*ItemUpsert) UpdateCrawlerContentText

func (u *ItemUpsert) UpdateCrawlerContentText() *ItemUpsert

UpdateCrawlerContentText sets the "crawler_content_text" field to the value that was provided on create.

func (*ItemUpsert) UpdateCrawlerExcerpt

func (u *ItemUpsert) UpdateCrawlerExcerpt() *ItemUpsert

UpdateCrawlerExcerpt sets the "crawler_excerpt" field to the value that was provided on create.

func (*ItemUpsert) UpdateCrawlerImage

func (u *ItemUpsert) UpdateCrawlerImage() *ItemUpsert

UpdateCrawlerImage sets the "crawler_image" field to the value that was provided on create.

func (*ItemUpsert) UpdateCrawlerSiteName

func (u *ItemUpsert) UpdateCrawlerSiteName() *ItemUpsert

UpdateCrawlerSiteName sets the "crawler_site_name" field to the value that was provided on create.

func (*ItemUpsert) UpdateCrawlerTitle

func (u *ItemUpsert) UpdateCrawlerTitle() *ItemUpsert

UpdateCrawlerTitle sets the "crawler_title" field to the value that was provided on create.

func (*ItemUpsert) UpdateCreatedAt

func (u *ItemUpsert) UpdateCreatedAt() *ItemUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemAuthorEmail

func (u *ItemUpsert) UpdateItemAuthorEmail() *ItemUpsert

UpdateItemAuthorEmail sets the "item_author_email" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemAuthorName

func (u *ItemUpsert) UpdateItemAuthorName() *ItemUpsert

UpdateItemAuthorName sets the "item_author_name" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemCategories

func (u *ItemUpsert) UpdateItemCategories() *ItemUpsert

UpdateItemCategories sets the "item_categories" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemContent

func (u *ItemUpsert) UpdateItemContent() *ItemUpsert

UpdateItemContent sets the "item_content" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemDescription

func (u *ItemUpsert) UpdateItemDescription() *ItemUpsert

UpdateItemDescription sets the "item_description" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemEnclosures

func (u *ItemUpsert) UpdateItemEnclosures() *ItemUpsert

UpdateItemEnclosures sets the "item_enclosures" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemGUID

func (u *ItemUpsert) UpdateItemGUID() *ItemUpsert

UpdateItemGUID sets the "item_guid" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemImageTitle

func (u *ItemUpsert) UpdateItemImageTitle() *ItemUpsert

UpdateItemImageTitle sets the "item_image_title" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemImageURL

func (u *ItemUpsert) UpdateItemImageURL() *ItemUpsert

UpdateItemImageURL sets the "item_image_url" field to the value that was provided on create.

func (u *ItemUpsert) UpdateItemLink() *ItemUpsert

UpdateItemLink sets the "item_link" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemPublished

func (u *ItemUpsert) UpdateItemPublished() *ItemUpsert

UpdateItemPublished sets the "item_published" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemTitle

func (u *ItemUpsert) UpdateItemTitle() *ItemUpsert

UpdateItemTitle sets the "item_title" field to the value that was provided on create.

func (*ItemUpsert) UpdateItemUpdated

func (u *ItemUpsert) UpdateItemUpdated() *ItemUpsert

UpdateItemUpdated sets the "item_updated" field to the value that was provided on create.

func (*ItemUpsert) UpdateUpdatedAt

func (u *ItemUpsert) UpdateUpdatedAt() *ItemUpsert

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

type ItemUpsertBulk

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

ItemUpsertBulk is the builder for "upsert"-ing a bulk of Item nodes.

func (*ItemUpsertBulk) ClearCrawlerAuthor

func (u *ItemUpsertBulk) ClearCrawlerAuthor() *ItemUpsertBulk

ClearCrawlerAuthor clears the value of the "crawler_author" field.

func (*ItemUpsertBulk) ClearCrawlerContentHTML

func (u *ItemUpsertBulk) ClearCrawlerContentHTML() *ItemUpsertBulk

ClearCrawlerContentHTML clears the value of the "crawler_content_html" field.

func (*ItemUpsertBulk) ClearCrawlerContentText

func (u *ItemUpsertBulk) ClearCrawlerContentText() *ItemUpsertBulk

ClearCrawlerContentText clears the value of the "crawler_content_text" field.

func (*ItemUpsertBulk) ClearCrawlerExcerpt

func (u *ItemUpsertBulk) ClearCrawlerExcerpt() *ItemUpsertBulk

ClearCrawlerExcerpt clears the value of the "crawler_excerpt" field.

func (*ItemUpsertBulk) ClearCrawlerImage

func (u *ItemUpsertBulk) ClearCrawlerImage() *ItemUpsertBulk

ClearCrawlerImage clears the value of the "crawler_image" field.

func (*ItemUpsertBulk) ClearCrawlerSiteName

func (u *ItemUpsertBulk) ClearCrawlerSiteName() *ItemUpsertBulk

ClearCrawlerSiteName clears the value of the "crawler_site_name" field.

func (*ItemUpsertBulk) ClearCrawlerTitle

func (u *ItemUpsertBulk) ClearCrawlerTitle() *ItemUpsertBulk

ClearCrawlerTitle clears the value of the "crawler_title" field.

func (*ItemUpsertBulk) ClearItemAuthorEmail

func (u *ItemUpsertBulk) ClearItemAuthorEmail() *ItemUpsertBulk

ClearItemAuthorEmail clears the value of the "item_author_email" field.

func (*ItemUpsertBulk) ClearItemAuthorName

func (u *ItemUpsertBulk) ClearItemAuthorName() *ItemUpsertBulk

ClearItemAuthorName clears the value of the "item_author_name" field.

func (*ItemUpsertBulk) ClearItemImageTitle

func (u *ItemUpsertBulk) ClearItemImageTitle() *ItemUpsertBulk

ClearItemImageTitle clears the value of the "item_image_title" field.

func (*ItemUpsertBulk) ClearItemImageURL

func (u *ItemUpsertBulk) ClearItemImageURL() *ItemUpsertBulk

ClearItemImageURL clears the value of the "item_image_url" field.

func (*ItemUpsertBulk) DoNothing

func (u *ItemUpsertBulk) DoNothing() *ItemUpsertBulk

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

func (*ItemUpsertBulk) Exec

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

Exec executes the query.

func (*ItemUpsertBulk) ExecX

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

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

func (*ItemUpsertBulk) Ignore

func (u *ItemUpsertBulk) Ignore() *ItemUpsertBulk

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

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

func (*ItemUpsertBulk) SetCrawlerAuthor

func (u *ItemUpsertBulk) SetCrawlerAuthor(v string) *ItemUpsertBulk

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemUpsertBulk) SetCrawlerContentHTML

func (u *ItemUpsertBulk) SetCrawlerContentHTML(v string) *ItemUpsertBulk

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemUpsertBulk) SetCrawlerContentText

func (u *ItemUpsertBulk) SetCrawlerContentText(v string) *ItemUpsertBulk

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemUpsertBulk) SetCrawlerExcerpt

func (u *ItemUpsertBulk) SetCrawlerExcerpt(v string) *ItemUpsertBulk

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemUpsertBulk) SetCrawlerImage

func (u *ItemUpsertBulk) SetCrawlerImage(v string) *ItemUpsertBulk

SetCrawlerImage sets the "crawler_image" field.

func (*ItemUpsertBulk) SetCrawlerSiteName

func (u *ItemUpsertBulk) SetCrawlerSiteName(v string) *ItemUpsertBulk

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemUpsertBulk) SetCrawlerTitle

func (u *ItemUpsertBulk) SetCrawlerTitle(v string) *ItemUpsertBulk

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemUpsertBulk) SetCreatedAt

func (u *ItemUpsertBulk) SetCreatedAt(v time.Time) *ItemUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*ItemUpsertBulk) SetItemAuthorEmail

func (u *ItemUpsertBulk) SetItemAuthorEmail(v string) *ItemUpsertBulk

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemUpsertBulk) SetItemAuthorName

func (u *ItemUpsertBulk) SetItemAuthorName(v string) *ItemUpsertBulk

SetItemAuthorName sets the "item_author_name" field.

func (*ItemUpsertBulk) SetItemCategories

func (u *ItemUpsertBulk) SetItemCategories(v string) *ItemUpsertBulk

SetItemCategories sets the "item_categories" field.

func (*ItemUpsertBulk) SetItemContent

func (u *ItemUpsertBulk) SetItemContent(v string) *ItemUpsertBulk

SetItemContent sets the "item_content" field.

func (*ItemUpsertBulk) SetItemDescription

func (u *ItemUpsertBulk) SetItemDescription(v string) *ItemUpsertBulk

SetItemDescription sets the "item_description" field.

func (*ItemUpsertBulk) SetItemEnclosures

func (u *ItemUpsertBulk) SetItemEnclosures(v string) *ItemUpsertBulk

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemUpsertBulk) SetItemGUID

func (u *ItemUpsertBulk) SetItemGUID(v string) *ItemUpsertBulk

SetItemGUID sets the "item_guid" field.

func (*ItemUpsertBulk) SetItemImageTitle

func (u *ItemUpsertBulk) SetItemImageTitle(v string) *ItemUpsertBulk

SetItemImageTitle sets the "item_image_title" field.

func (*ItemUpsertBulk) SetItemImageURL

func (u *ItemUpsertBulk) SetItemImageURL(v string) *ItemUpsertBulk

SetItemImageURL sets the "item_image_url" field.

func (u *ItemUpsertBulk) SetItemLink(v string) *ItemUpsertBulk

SetItemLink sets the "item_link" field.

func (*ItemUpsertBulk) SetItemPublished

func (u *ItemUpsertBulk) SetItemPublished(v time.Time) *ItemUpsertBulk

SetItemPublished sets the "item_published" field.

func (*ItemUpsertBulk) SetItemTitle

func (u *ItemUpsertBulk) SetItemTitle(v string) *ItemUpsertBulk

SetItemTitle sets the "item_title" field.

func (*ItemUpsertBulk) SetItemUpdated

func (u *ItemUpsertBulk) SetItemUpdated(v time.Time) *ItemUpsertBulk

SetItemUpdated sets the "item_updated" field.

func (*ItemUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpsertBulk) Update

func (u *ItemUpsertBulk) Update(set func(*ItemUpsert)) *ItemUpsertBulk

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

func (*ItemUpsertBulk) UpdateCrawlerAuthor

func (u *ItemUpsertBulk) UpdateCrawlerAuthor() *ItemUpsertBulk

UpdateCrawlerAuthor sets the "crawler_author" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCrawlerContentHTML

func (u *ItemUpsertBulk) UpdateCrawlerContentHTML() *ItemUpsertBulk

UpdateCrawlerContentHTML sets the "crawler_content_html" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCrawlerContentText

func (u *ItemUpsertBulk) UpdateCrawlerContentText() *ItemUpsertBulk

UpdateCrawlerContentText sets the "crawler_content_text" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCrawlerExcerpt

func (u *ItemUpsertBulk) UpdateCrawlerExcerpt() *ItemUpsertBulk

UpdateCrawlerExcerpt sets the "crawler_excerpt" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCrawlerImage

func (u *ItemUpsertBulk) UpdateCrawlerImage() *ItemUpsertBulk

UpdateCrawlerImage sets the "crawler_image" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCrawlerSiteName

func (u *ItemUpsertBulk) UpdateCrawlerSiteName() *ItemUpsertBulk

UpdateCrawlerSiteName sets the "crawler_site_name" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCrawlerTitle

func (u *ItemUpsertBulk) UpdateCrawlerTitle() *ItemUpsertBulk

UpdateCrawlerTitle sets the "crawler_title" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateCreatedAt

func (u *ItemUpsertBulk) UpdateCreatedAt() *ItemUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemAuthorEmail

func (u *ItemUpsertBulk) UpdateItemAuthorEmail() *ItemUpsertBulk

UpdateItemAuthorEmail sets the "item_author_email" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemAuthorName

func (u *ItemUpsertBulk) UpdateItemAuthorName() *ItemUpsertBulk

UpdateItemAuthorName sets the "item_author_name" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemCategories

func (u *ItemUpsertBulk) UpdateItemCategories() *ItemUpsertBulk

UpdateItemCategories sets the "item_categories" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemContent

func (u *ItemUpsertBulk) UpdateItemContent() *ItemUpsertBulk

UpdateItemContent sets the "item_content" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemDescription

func (u *ItemUpsertBulk) UpdateItemDescription() *ItemUpsertBulk

UpdateItemDescription sets the "item_description" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemEnclosures

func (u *ItemUpsertBulk) UpdateItemEnclosures() *ItemUpsertBulk

UpdateItemEnclosures sets the "item_enclosures" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemGUID

func (u *ItemUpsertBulk) UpdateItemGUID() *ItemUpsertBulk

UpdateItemGUID sets the "item_guid" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemImageTitle

func (u *ItemUpsertBulk) UpdateItemImageTitle() *ItemUpsertBulk

UpdateItemImageTitle sets the "item_image_title" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemImageURL

func (u *ItemUpsertBulk) UpdateItemImageURL() *ItemUpsertBulk

UpdateItemImageURL sets the "item_image_url" field to the value that was provided on create.

func (u *ItemUpsertBulk) UpdateItemLink() *ItemUpsertBulk

UpdateItemLink sets the "item_link" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemPublished

func (u *ItemUpsertBulk) UpdateItemPublished() *ItemUpsertBulk

UpdateItemPublished sets the "item_published" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemTitle

func (u *ItemUpsertBulk) UpdateItemTitle() *ItemUpsertBulk

UpdateItemTitle sets the "item_title" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateItemUpdated

func (u *ItemUpsertBulk) UpdateItemUpdated() *ItemUpsertBulk

UpdateItemUpdated sets the "item_updated" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateNewValues

func (u *ItemUpsertBulk) UpdateNewValues() *ItemUpsertBulk

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

client.Item.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(item.FieldID)
		}),
	).
	Exec(ctx)

func (*ItemUpsertBulk) UpdateUpdatedAt

func (u *ItemUpsertBulk) UpdateUpdatedAt() *ItemUpsertBulk

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

type ItemUpsertOne

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

ItemUpsertOne is the builder for "upsert"-ing

one Item node.

func (*ItemUpsertOne) ClearCrawlerAuthor

func (u *ItemUpsertOne) ClearCrawlerAuthor() *ItemUpsertOne

ClearCrawlerAuthor clears the value of the "crawler_author" field.

func (*ItemUpsertOne) ClearCrawlerContentHTML

func (u *ItemUpsertOne) ClearCrawlerContentHTML() *ItemUpsertOne

ClearCrawlerContentHTML clears the value of the "crawler_content_html" field.

func (*ItemUpsertOne) ClearCrawlerContentText

func (u *ItemUpsertOne) ClearCrawlerContentText() *ItemUpsertOne

ClearCrawlerContentText clears the value of the "crawler_content_text" field.

func (*ItemUpsertOne) ClearCrawlerExcerpt

func (u *ItemUpsertOne) ClearCrawlerExcerpt() *ItemUpsertOne

ClearCrawlerExcerpt clears the value of the "crawler_excerpt" field.

func (*ItemUpsertOne) ClearCrawlerImage

func (u *ItemUpsertOne) ClearCrawlerImage() *ItemUpsertOne

ClearCrawlerImage clears the value of the "crawler_image" field.

func (*ItemUpsertOne) ClearCrawlerSiteName

func (u *ItemUpsertOne) ClearCrawlerSiteName() *ItemUpsertOne

ClearCrawlerSiteName clears the value of the "crawler_site_name" field.

func (*ItemUpsertOne) ClearCrawlerTitle

func (u *ItemUpsertOne) ClearCrawlerTitle() *ItemUpsertOne

ClearCrawlerTitle clears the value of the "crawler_title" field.

func (*ItemUpsertOne) ClearItemAuthorEmail

func (u *ItemUpsertOne) ClearItemAuthorEmail() *ItemUpsertOne

ClearItemAuthorEmail clears the value of the "item_author_email" field.

func (*ItemUpsertOne) ClearItemAuthorName

func (u *ItemUpsertOne) ClearItemAuthorName() *ItemUpsertOne

ClearItemAuthorName clears the value of the "item_author_name" field.

func (*ItemUpsertOne) ClearItemImageTitle

func (u *ItemUpsertOne) ClearItemImageTitle() *ItemUpsertOne

ClearItemImageTitle clears the value of the "item_image_title" field.

func (*ItemUpsertOne) ClearItemImageURL

func (u *ItemUpsertOne) ClearItemImageURL() *ItemUpsertOne

ClearItemImageURL clears the value of the "item_image_url" field.

func (*ItemUpsertOne) DoNothing

func (u *ItemUpsertOne) DoNothing() *ItemUpsertOne

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

func (*ItemUpsertOne) Exec

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

Exec executes the query.

func (*ItemUpsertOne) ExecX

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

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

func (*ItemUpsertOne) ID

func (u *ItemUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemUpsertOne) IDX

func (u *ItemUpsertOne) IDX(ctx context.Context) uuid.UUID

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

func (*ItemUpsertOne) Ignore

func (u *ItemUpsertOne) Ignore() *ItemUpsertOne

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

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

func (*ItemUpsertOne) SetCrawlerAuthor

func (u *ItemUpsertOne) SetCrawlerAuthor(v string) *ItemUpsertOne

SetCrawlerAuthor sets the "crawler_author" field.

func (*ItemUpsertOne) SetCrawlerContentHTML

func (u *ItemUpsertOne) SetCrawlerContentHTML(v string) *ItemUpsertOne

SetCrawlerContentHTML sets the "crawler_content_html" field.

func (*ItemUpsertOne) SetCrawlerContentText

func (u *ItemUpsertOne) SetCrawlerContentText(v string) *ItemUpsertOne

SetCrawlerContentText sets the "crawler_content_text" field.

func (*ItemUpsertOne) SetCrawlerExcerpt

func (u *ItemUpsertOne) SetCrawlerExcerpt(v string) *ItemUpsertOne

SetCrawlerExcerpt sets the "crawler_excerpt" field.

func (*ItemUpsertOne) SetCrawlerImage

func (u *ItemUpsertOne) SetCrawlerImage(v string) *ItemUpsertOne

SetCrawlerImage sets the "crawler_image" field.

func (*ItemUpsertOne) SetCrawlerSiteName

func (u *ItemUpsertOne) SetCrawlerSiteName(v string) *ItemUpsertOne

SetCrawlerSiteName sets the "crawler_site_name" field.

func (*ItemUpsertOne) SetCrawlerTitle

func (u *ItemUpsertOne) SetCrawlerTitle(v string) *ItemUpsertOne

SetCrawlerTitle sets the "crawler_title" field.

func (*ItemUpsertOne) SetCreatedAt

func (u *ItemUpsertOne) SetCreatedAt(v time.Time) *ItemUpsertOne

SetCreatedAt sets the "created_at" field.

func (*ItemUpsertOne) SetItemAuthorEmail

func (u *ItemUpsertOne) SetItemAuthorEmail(v string) *ItemUpsertOne

SetItemAuthorEmail sets the "item_author_email" field.

func (*ItemUpsertOne) SetItemAuthorName

func (u *ItemUpsertOne) SetItemAuthorName(v string) *ItemUpsertOne

SetItemAuthorName sets the "item_author_name" field.

func (*ItemUpsertOne) SetItemCategories

func (u *ItemUpsertOne) SetItemCategories(v string) *ItemUpsertOne

SetItemCategories sets the "item_categories" field.

func (*ItemUpsertOne) SetItemContent

func (u *ItemUpsertOne) SetItemContent(v string) *ItemUpsertOne

SetItemContent sets the "item_content" field.

func (*ItemUpsertOne) SetItemDescription

func (u *ItemUpsertOne) SetItemDescription(v string) *ItemUpsertOne

SetItemDescription sets the "item_description" field.

func (*ItemUpsertOne) SetItemEnclosures

func (u *ItemUpsertOne) SetItemEnclosures(v string) *ItemUpsertOne

SetItemEnclosures sets the "item_enclosures" field.

func (*ItemUpsertOne) SetItemGUID

func (u *ItemUpsertOne) SetItemGUID(v string) *ItemUpsertOne

SetItemGUID sets the "item_guid" field.

func (*ItemUpsertOne) SetItemImageTitle

func (u *ItemUpsertOne) SetItemImageTitle(v string) *ItemUpsertOne

SetItemImageTitle sets the "item_image_title" field.

func (*ItemUpsertOne) SetItemImageURL

func (u *ItemUpsertOne) SetItemImageURL(v string) *ItemUpsertOne

SetItemImageURL sets the "item_image_url" field.

func (u *ItemUpsertOne) SetItemLink(v string) *ItemUpsertOne

SetItemLink sets the "item_link" field.

func (*ItemUpsertOne) SetItemPublished

func (u *ItemUpsertOne) SetItemPublished(v time.Time) *ItemUpsertOne

SetItemPublished sets the "item_published" field.

func (*ItemUpsertOne) SetItemTitle

func (u *ItemUpsertOne) SetItemTitle(v string) *ItemUpsertOne

SetItemTitle sets the "item_title" field.

func (*ItemUpsertOne) SetItemUpdated

func (u *ItemUpsertOne) SetItemUpdated(v time.Time) *ItemUpsertOne

SetItemUpdated sets the "item_updated" field.

func (*ItemUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpsertOne) Update

func (u *ItemUpsertOne) Update(set func(*ItemUpsert)) *ItemUpsertOne

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

func (*ItemUpsertOne) UpdateCrawlerAuthor

func (u *ItemUpsertOne) UpdateCrawlerAuthor() *ItemUpsertOne

UpdateCrawlerAuthor sets the "crawler_author" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCrawlerContentHTML

func (u *ItemUpsertOne) UpdateCrawlerContentHTML() *ItemUpsertOne

UpdateCrawlerContentHTML sets the "crawler_content_html" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCrawlerContentText

func (u *ItemUpsertOne) UpdateCrawlerContentText() *ItemUpsertOne

UpdateCrawlerContentText sets the "crawler_content_text" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCrawlerExcerpt

func (u *ItemUpsertOne) UpdateCrawlerExcerpt() *ItemUpsertOne

UpdateCrawlerExcerpt sets the "crawler_excerpt" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCrawlerImage

func (u *ItemUpsertOne) UpdateCrawlerImage() *ItemUpsertOne

UpdateCrawlerImage sets the "crawler_image" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCrawlerSiteName

func (u *ItemUpsertOne) UpdateCrawlerSiteName() *ItemUpsertOne

UpdateCrawlerSiteName sets the "crawler_site_name" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCrawlerTitle

func (u *ItemUpsertOne) UpdateCrawlerTitle() *ItemUpsertOne

UpdateCrawlerTitle sets the "crawler_title" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateCreatedAt

func (u *ItemUpsertOne) UpdateCreatedAt() *ItemUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemAuthorEmail

func (u *ItemUpsertOne) UpdateItemAuthorEmail() *ItemUpsertOne

UpdateItemAuthorEmail sets the "item_author_email" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemAuthorName

func (u *ItemUpsertOne) UpdateItemAuthorName() *ItemUpsertOne

UpdateItemAuthorName sets the "item_author_name" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemCategories

func (u *ItemUpsertOne) UpdateItemCategories() *ItemUpsertOne

UpdateItemCategories sets the "item_categories" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemContent

func (u *ItemUpsertOne) UpdateItemContent() *ItemUpsertOne

UpdateItemContent sets the "item_content" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemDescription

func (u *ItemUpsertOne) UpdateItemDescription() *ItemUpsertOne

UpdateItemDescription sets the "item_description" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemEnclosures

func (u *ItemUpsertOne) UpdateItemEnclosures() *ItemUpsertOne

UpdateItemEnclosures sets the "item_enclosures" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemGUID

func (u *ItemUpsertOne) UpdateItemGUID() *ItemUpsertOne

UpdateItemGUID sets the "item_guid" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemImageTitle

func (u *ItemUpsertOne) UpdateItemImageTitle() *ItemUpsertOne

UpdateItemImageTitle sets the "item_image_title" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemImageURL

func (u *ItemUpsertOne) UpdateItemImageURL() *ItemUpsertOne

UpdateItemImageURL sets the "item_image_url" field to the value that was provided on create.

func (u *ItemUpsertOne) UpdateItemLink() *ItemUpsertOne

UpdateItemLink sets the "item_link" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemPublished

func (u *ItemUpsertOne) UpdateItemPublished() *ItemUpsertOne

UpdateItemPublished sets the "item_published" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemTitle

func (u *ItemUpsertOne) UpdateItemTitle() *ItemUpsertOne

UpdateItemTitle sets the "item_title" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateItemUpdated

func (u *ItemUpsertOne) UpdateItemUpdated() *ItemUpsertOne

UpdateItemUpdated sets the "item_updated" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateNewValues

func (u *ItemUpsertOne) UpdateNewValues() *ItemUpsertOne

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.Item.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(item.FieldID)
		}),
	).
	Exec(ctx)

func (*ItemUpsertOne) UpdateUpdatedAt

func (u *ItemUpsertOne) UpdateUpdatedAt() *ItemUpsertOne

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

type Items

type Items []*Item

Items is a parsable slice of Item.

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 Read

type Read struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// ItemID holds the value of the "item_id" field.
	ItemID uuid.UUID `json:"item_id,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 ReadQuery when eager-loading is set.
	Edges ReadEdges `json:"edges"`
	// contains filtered or unexported fields
}

Read is the model entity for the Read schema.

func (*Read) QueryItem

func (r *Read) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the Read entity.

func (*Read) QueryUser

func (r *Read) QueryUser() *UserQuery

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

func (*Read) String

func (r *Read) String() string

String implements the fmt.Stringer.

func (*Read) Unwrap

func (r *Read) Unwrap() *Read

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

func (r *Read) Update() *ReadUpdateOne

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

type ReadClient

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

ReadClient is a client for the Read schema.

func NewReadClient

func NewReadClient(c config) *ReadClient

NewReadClient returns a client for the Read from the given config.

func (*ReadClient) Create

func (c *ReadClient) Create() *ReadCreate

Create returns a builder for creating a Read entity.

func (*ReadClient) CreateBulk

func (c *ReadClient) CreateBulk(builders ...*ReadCreate) *ReadCreateBulk

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

func (*ReadClient) Delete

func (c *ReadClient) Delete() *ReadDelete

Delete returns a delete builder for Read.

func (*ReadClient) DeleteOne

func (c *ReadClient) DeleteOne(r *Read) *ReadDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReadClient) DeleteOneID

func (c *ReadClient) DeleteOneID(id uuid.UUID) *ReadDeleteOne

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

func (*ReadClient) Get

func (c *ReadClient) Get(ctx context.Context, id uuid.UUID) (*Read, error)

Get returns a Read entity by its id.

func (*ReadClient) GetX

func (c *ReadClient) GetX(ctx context.Context, id uuid.UUID) *Read

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

func (*ReadClient) Hooks

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

Hooks returns the client hooks.

func (*ReadClient) Query

func (c *ReadClient) Query() *ReadQuery

Query returns a query builder for Read.

func (*ReadClient) QueryItem

func (c *ReadClient) QueryItem(r *Read) *ItemQuery

QueryItem queries the item edge of a Read.

func (*ReadClient) QueryUser

func (c *ReadClient) QueryUser(r *Read) *UserQuery

QueryUser queries the user edge of a Read.

func (*ReadClient) Update

func (c *ReadClient) Update() *ReadUpdate

Update returns an update builder for Read.

func (*ReadClient) UpdateOne

func (c *ReadClient) UpdateOne(r *Read) *ReadUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReadClient) UpdateOneID

func (c *ReadClient) UpdateOneID(id uuid.UUID) *ReadUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReadClient) Use

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

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

type ReadCreate

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

ReadCreate is the builder for creating a Read entity.

func (*ReadCreate) Exec

func (rc *ReadCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReadCreate) ExecX

func (rc *ReadCreate) ExecX(ctx context.Context)

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

func (*ReadCreate) Mutation

func (rc *ReadCreate) Mutation() *ReadMutation

Mutation returns the ReadMutation object of the builder.

func (*ReadCreate) OnConflict

func (rc *ReadCreate) OnConflict(opts ...sql.ConflictOption) *ReadUpsertOne

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

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

func (*ReadCreate) OnConflictColumns

func (rc *ReadCreate) OnConflictColumns(columns ...string) *ReadUpsertOne

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

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

func (*ReadCreate) Save

func (rc *ReadCreate) Save(ctx context.Context) (*Read, error)

Save creates the Read in the database.

func (*ReadCreate) SaveX

func (rc *ReadCreate) SaveX(ctx context.Context) *Read

SaveX calls Save and panics if Save returns an error.

func (*ReadCreate) SetCreatedAt

func (rc *ReadCreate) SetCreatedAt(t time.Time) *ReadCreate

SetCreatedAt sets the "created_at" field.

func (*ReadCreate) SetID

func (rc *ReadCreate) SetID(u uuid.UUID) *ReadCreate

SetID sets the "id" field.

func (*ReadCreate) SetItem

func (rc *ReadCreate) SetItem(i *Item) *ReadCreate

SetItem sets the "item" edge to the Item entity.

func (*ReadCreate) SetItemID

func (rc *ReadCreate) SetItemID(u uuid.UUID) *ReadCreate

SetItemID sets the "item_id" field.

func (*ReadCreate) SetNillableCreatedAt

func (rc *ReadCreate) SetNillableCreatedAt(t *time.Time) *ReadCreate

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

func (*ReadCreate) SetNillableID

func (rc *ReadCreate) SetNillableID(u *uuid.UUID) *ReadCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ReadCreate) SetUser

func (rc *ReadCreate) SetUser(u *User) *ReadCreate

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

func (*ReadCreate) SetUserID

func (rc *ReadCreate) SetUserID(u uuid.UUID) *ReadCreate

SetUserID sets the "user_id" field.

type ReadCreateBulk

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

ReadCreateBulk is the builder for creating many Read entities in bulk.

func (*ReadCreateBulk) Exec

func (rcb *ReadCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReadCreateBulk) ExecX

func (rcb *ReadCreateBulk) ExecX(ctx context.Context)

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

func (*ReadCreateBulk) OnConflict

func (rcb *ReadCreateBulk) OnConflict(opts ...sql.ConflictOption) *ReadUpsertBulk

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

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

func (*ReadCreateBulk) OnConflictColumns

func (rcb *ReadCreateBulk) OnConflictColumns(columns ...string) *ReadUpsertBulk

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

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

func (*ReadCreateBulk) Save

func (rcb *ReadCreateBulk) Save(ctx context.Context) ([]*Read, error)

Save creates the Read entities in the database.

func (*ReadCreateBulk) SaveX

func (rcb *ReadCreateBulk) SaveX(ctx context.Context) []*Read

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

type ReadDelete

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

ReadDelete is the builder for deleting a Read entity.

func (*ReadDelete) Exec

func (rd *ReadDelete) Exec(ctx context.Context) (int, error)

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

func (*ReadDelete) ExecX

func (rd *ReadDelete) ExecX(ctx context.Context) int

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

func (*ReadDelete) Where

func (rd *ReadDelete) Where(ps ...predicate.Read) *ReadDelete

Where appends a list predicates to the ReadDelete builder.

type ReadDeleteOne

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

ReadDeleteOne is the builder for deleting a single Read entity.

func (*ReadDeleteOne) Exec

func (rdo *ReadDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReadDeleteOne) ExecX

func (rdo *ReadDeleteOne) ExecX(ctx context.Context)

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

type ReadEdges

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

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

func (ReadEdges) ItemOrErr

func (e ReadEdges) ItemOrErr() (*Item, error)

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

func (ReadEdges) UserOrErr

func (e ReadEdges) 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 ReadGroupBy

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

ReadGroupBy is the group-by builder for Read entities.

func (*ReadGroupBy) Aggregate

func (rgb *ReadGroupBy) Aggregate(fns ...AggregateFunc) *ReadGroupBy

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

func (*ReadGroupBy) Bool

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

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

func (*ReadGroupBy) BoolX

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

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

func (*ReadGroupBy) Bools

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

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

func (*ReadGroupBy) BoolsX

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

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

func (*ReadGroupBy) Float64

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

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

func (*ReadGroupBy) Float64X

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

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

func (*ReadGroupBy) Float64s

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

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

func (*ReadGroupBy) Float64sX

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

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

func (*ReadGroupBy) Int

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

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

func (*ReadGroupBy) IntX

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

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

func (*ReadGroupBy) Ints

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

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

func (*ReadGroupBy) IntsX

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

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

func (*ReadGroupBy) Scan

func (rgb *ReadGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ReadGroupBy) ScanX

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

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

func (*ReadGroupBy) String

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

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

func (*ReadGroupBy) StringX

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

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

func (*ReadGroupBy) Strings

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

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

func (*ReadGroupBy) StringsX

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

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

type ReadMutation

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

ReadMutation represents an operation that mutates the Read nodes in the graph.

func (*ReadMutation) AddField

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

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

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

func (*ReadMutation) AddedField

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

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

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

func (*ReadMutation) AddedIDs

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

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

func (*ReadMutation) ClearEdge

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

func (m *ReadMutation) 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 (*ReadMutation) ClearItem

func (m *ReadMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*ReadMutation) ClearUser

func (m *ReadMutation) ClearUser()

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

func (*ReadMutation) ClearedEdges

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

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

func (*ReadMutation) ClearedFields

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

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

func (ReadMutation) Client

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

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

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

func (*ReadMutation) EdgeCleared

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

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

func (*ReadMutation) Field

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

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

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

func (*ReadMutation) Fields

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

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

func (m *ReadMutation) 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 (*ReadMutation) ItemCleared

func (m *ReadMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*ReadMutation) ItemID

func (m *ReadMutation) ItemID() (r uuid.UUID, exists bool)

ItemID returns the value of the "item_id" field in the mutation.

func (*ReadMutation) ItemIDs

func (m *ReadMutation) ItemIDs() (ids []uuid.UUID)

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

func (*ReadMutation) OldCreatedAt

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

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

func (m *ReadMutation) 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 (*ReadMutation) OldItemID

func (m *ReadMutation) OldItemID(ctx context.Context) (v uuid.UUID, err error)

OldItemID returns the old "item_id" field's value of the Read entity. If the Read 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 (*ReadMutation) OldUserID

func (m *ReadMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

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

func (m *ReadMutation) Op() Op

Op returns the operation name.

func (*ReadMutation) RemovedEdges

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

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

func (*ReadMutation) RemovedIDs

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

func (m *ReadMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReadMutation) ResetEdge

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

func (m *ReadMutation) 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 (*ReadMutation) ResetItem

func (m *ReadMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*ReadMutation) ResetItemID

func (m *ReadMutation) ResetItemID()

ResetItemID resets all changes to the "item_id" field.

func (*ReadMutation) ResetUser

func (m *ReadMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ReadMutation) ResetUserID

func (m *ReadMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ReadMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ReadMutation) SetField

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

func (m *ReadMutation) SetID(id uuid.UUID)

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

func (*ReadMutation) SetItemID

func (m *ReadMutation) SetItemID(u uuid.UUID)

SetItemID sets the "item_id" field.

func (*ReadMutation) SetUserID

func (m *ReadMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (ReadMutation) Tx

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

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

func (*ReadMutation) Type

func (m *ReadMutation) Type() string

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

func (*ReadMutation) UserCleared

func (m *ReadMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ReadMutation) UserID

func (m *ReadMutation) UserID() (r uuid.UUID, exists bool)

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

func (*ReadMutation) UserIDs

func (m *ReadMutation) UserIDs() (ids []uuid.UUID)

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

func (m *ReadMutation) Where(ps ...predicate.Read)

Where appends a list predicates to the ReadMutation builder.

type ReadQuery

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

ReadQuery is the builder for querying Read entities.

func (*ReadQuery) All

func (rq *ReadQuery) All(ctx context.Context) ([]*Read, error)

All executes the query and returns a list of Reads.

func (*ReadQuery) AllX

func (rq *ReadQuery) AllX(ctx context.Context) []*Read

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

func (*ReadQuery) Clone

func (rq *ReadQuery) Clone() *ReadQuery

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

func (*ReadQuery) Count

func (rq *ReadQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReadQuery) CountX

func (rq *ReadQuery) CountX(ctx context.Context) int

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

func (*ReadQuery) Exist

func (rq *ReadQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReadQuery) ExistX

func (rq *ReadQuery) ExistX(ctx context.Context) bool

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

func (*ReadQuery) First

func (rq *ReadQuery) First(ctx context.Context) (*Read, error)

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

func (*ReadQuery) FirstID

func (rq *ReadQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ReadQuery) FirstIDX

func (rq *ReadQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ReadQuery) FirstX

func (rq *ReadQuery) FirstX(ctx context.Context) *Read

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

func (*ReadQuery) GroupBy

func (rq *ReadQuery) GroupBy(field string, fields ...string) *ReadGroupBy

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Read.Query().
	GroupBy(read.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReadQuery) IDs

func (rq *ReadQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ReadQuery) IDsX

func (rq *ReadQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ReadQuery) Limit

func (rq *ReadQuery) Limit(limit int) *ReadQuery

Limit adds a limit step to the query.

func (*ReadQuery) Offset

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

Offset adds an offset step to the query.

func (*ReadQuery) Only

func (rq *ReadQuery) Only(ctx context.Context) (*Read, error)

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

func (*ReadQuery) OnlyID

func (rq *ReadQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ReadQuery) OnlyIDX

func (rq *ReadQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ReadQuery) OnlyX

func (rq *ReadQuery) OnlyX(ctx context.Context) *Read

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

func (*ReadQuery) Order

func (rq *ReadQuery) Order(o ...OrderFunc) *ReadQuery

Order adds an order step to the query.

func (*ReadQuery) QueryItem

func (rq *ReadQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*ReadQuery) QueryUser

func (rq *ReadQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ReadQuery) Select

func (rq *ReadQuery) Select(fields ...string) *ReadSelect

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
}

client.Read.Query().
	Select(read.FieldUserID).
	Scan(ctx, &v)

func (*ReadQuery) Unique

func (rq *ReadQuery) Unique(unique bool) *ReadQuery

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

func (rq *ReadQuery) Where(ps ...predicate.Read) *ReadQuery

Where adds a new predicate for the ReadQuery builder.

func (*ReadQuery) WithItem

func (rq *ReadQuery) WithItem(opts ...func(*ItemQuery)) *ReadQuery

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

func (*ReadQuery) WithUser

func (rq *ReadQuery) WithUser(opts ...func(*UserQuery)) *ReadQuery

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 ReadSelect

type ReadSelect struct {
	*ReadQuery
	// contains filtered or unexported fields
}

ReadSelect is the builder for selecting fields of Read entities.

func (*ReadSelect) Bool

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

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

func (*ReadSelect) BoolX

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

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

func (*ReadSelect) Bools

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

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

func (*ReadSelect) BoolsX

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

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

func (*ReadSelect) Float64

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

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

func (*ReadSelect) Float64X

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

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

func (*ReadSelect) Float64s

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

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

func (*ReadSelect) Float64sX

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

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

func (*ReadSelect) Int

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

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

func (*ReadSelect) IntX

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

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

func (*ReadSelect) Ints

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

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

func (*ReadSelect) IntsX

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

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

func (*ReadSelect) Scan

func (rs *ReadSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ReadSelect) ScanX

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

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

func (*ReadSelect) String

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

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

func (*ReadSelect) StringX

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

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

func (*ReadSelect) Strings

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

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

func (*ReadSelect) StringsX

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

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

type ReadUpdate

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

ReadUpdate is the builder for updating Read entities.

func (*ReadUpdate) ClearItem

func (ru *ReadUpdate) ClearItem() *ReadUpdate

ClearItem clears the "item" edge to the Item entity.

func (*ReadUpdate) ClearUser

func (ru *ReadUpdate) ClearUser() *ReadUpdate

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

func (*ReadUpdate) Exec

func (ru *ReadUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReadUpdate) ExecX

func (ru *ReadUpdate) ExecX(ctx context.Context)

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

func (*ReadUpdate) Mutation

func (ru *ReadUpdate) Mutation() *ReadMutation

Mutation returns the ReadMutation object of the builder.

func (*ReadUpdate) Save

func (ru *ReadUpdate) Save(ctx context.Context) (int, error)

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

func (*ReadUpdate) SaveX

func (ru *ReadUpdate) SaveX(ctx context.Context) int

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

func (*ReadUpdate) SetCreatedAt

func (ru *ReadUpdate) SetCreatedAt(t time.Time) *ReadUpdate

SetCreatedAt sets the "created_at" field.

func (*ReadUpdate) SetItem

func (ru *ReadUpdate) SetItem(i *Item) *ReadUpdate

SetItem sets the "item" edge to the Item entity.

func (*ReadUpdate) SetItemID

func (ru *ReadUpdate) SetItemID(u uuid.UUID) *ReadUpdate

SetItemID sets the "item_id" field.

func (*ReadUpdate) SetNillableCreatedAt

func (ru *ReadUpdate) SetNillableCreatedAt(t *time.Time) *ReadUpdate

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

func (*ReadUpdate) SetUser

func (ru *ReadUpdate) SetUser(u *User) *ReadUpdate

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

func (*ReadUpdate) SetUserID

func (ru *ReadUpdate) SetUserID(u uuid.UUID) *ReadUpdate

SetUserID sets the "user_id" field.

func (*ReadUpdate) Where

func (ru *ReadUpdate) Where(ps ...predicate.Read) *ReadUpdate

Where appends a list predicates to the ReadUpdate builder.

type ReadUpdateOne

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

ReadUpdateOne is the builder for updating a single Read entity.

func (*ReadUpdateOne) ClearItem

func (ruo *ReadUpdateOne) ClearItem() *ReadUpdateOne

ClearItem clears the "item" edge to the Item entity.

func (*ReadUpdateOne) ClearUser

func (ruo *ReadUpdateOne) ClearUser() *ReadUpdateOne

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

func (*ReadUpdateOne) Exec

func (ruo *ReadUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReadUpdateOne) ExecX

func (ruo *ReadUpdateOne) ExecX(ctx context.Context)

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

func (*ReadUpdateOne) Mutation

func (ruo *ReadUpdateOne) Mutation() *ReadMutation

Mutation returns the ReadMutation object of the builder.

func (*ReadUpdateOne) Save

func (ruo *ReadUpdateOne) Save(ctx context.Context) (*Read, error)

Save executes the query and returns the updated Read entity.

func (*ReadUpdateOne) SaveX

func (ruo *ReadUpdateOne) SaveX(ctx context.Context) *Read

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

func (*ReadUpdateOne) Select

func (ruo *ReadUpdateOne) Select(field string, fields ...string) *ReadUpdateOne

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

func (*ReadUpdateOne) SetCreatedAt

func (ruo *ReadUpdateOne) SetCreatedAt(t time.Time) *ReadUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ReadUpdateOne) SetItem

func (ruo *ReadUpdateOne) SetItem(i *Item) *ReadUpdateOne

SetItem sets the "item" edge to the Item entity.

func (*ReadUpdateOne) SetItemID

func (ruo *ReadUpdateOne) SetItemID(u uuid.UUID) *ReadUpdateOne

SetItemID sets the "item_id" field.

func (*ReadUpdateOne) SetNillableCreatedAt

func (ruo *ReadUpdateOne) SetNillableCreatedAt(t *time.Time) *ReadUpdateOne

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

func (*ReadUpdateOne) SetUser

func (ruo *ReadUpdateOne) SetUser(u *User) *ReadUpdateOne

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

func (*ReadUpdateOne) SetUserID

func (ruo *ReadUpdateOne) SetUserID(u uuid.UUID) *ReadUpdateOne

SetUserID sets the "user_id" field.

type ReadUpsert

type ReadUpsert struct {
	*sql.UpdateSet
}

ReadUpsert is the "OnConflict" setter.

func (*ReadUpsert) SetCreatedAt

func (u *ReadUpsert) SetCreatedAt(v time.Time) *ReadUpsert

SetCreatedAt sets the "created_at" field.

func (*ReadUpsert) SetItemID

func (u *ReadUpsert) SetItemID(v uuid.UUID) *ReadUpsert

SetItemID sets the "item_id" field.

func (*ReadUpsert) SetUserID

func (u *ReadUpsert) SetUserID(v uuid.UUID) *ReadUpsert

SetUserID sets the "user_id" field.

func (*ReadUpsert) UpdateCreatedAt

func (u *ReadUpsert) UpdateCreatedAt() *ReadUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ReadUpsert) UpdateItemID

func (u *ReadUpsert) UpdateItemID() *ReadUpsert

UpdateItemID sets the "item_id" field to the value that was provided on create.

func (*ReadUpsert) UpdateUserID

func (u *ReadUpsert) UpdateUserID() *ReadUpsert

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

type ReadUpsertBulk

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

ReadUpsertBulk is the builder for "upsert"-ing a bulk of Read nodes.

func (*ReadUpsertBulk) DoNothing

func (u *ReadUpsertBulk) DoNothing() *ReadUpsertBulk

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

func (*ReadUpsertBulk) Exec

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

Exec executes the query.

func (*ReadUpsertBulk) ExecX

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

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

func (*ReadUpsertBulk) Ignore

func (u *ReadUpsertBulk) Ignore() *ReadUpsertBulk

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

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

func (*ReadUpsertBulk) SetCreatedAt

func (u *ReadUpsertBulk) SetCreatedAt(v time.Time) *ReadUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*ReadUpsertBulk) SetItemID

func (u *ReadUpsertBulk) SetItemID(v uuid.UUID) *ReadUpsertBulk

SetItemID sets the "item_id" field.

func (*ReadUpsertBulk) SetUserID

func (u *ReadUpsertBulk) SetUserID(v uuid.UUID) *ReadUpsertBulk

SetUserID sets the "user_id" field.

func (*ReadUpsertBulk) Update

func (u *ReadUpsertBulk) Update(set func(*ReadUpsert)) *ReadUpsertBulk

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

func (*ReadUpsertBulk) UpdateCreatedAt

func (u *ReadUpsertBulk) UpdateCreatedAt() *ReadUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ReadUpsertBulk) UpdateItemID

func (u *ReadUpsertBulk) UpdateItemID() *ReadUpsertBulk

UpdateItemID sets the "item_id" field to the value that was provided on create.

func (*ReadUpsertBulk) UpdateNewValues

func (u *ReadUpsertBulk) UpdateNewValues() *ReadUpsertBulk

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

client.Read.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(read.FieldID)
		}),
	).
	Exec(ctx)

func (*ReadUpsertBulk) UpdateUserID

func (u *ReadUpsertBulk) UpdateUserID() *ReadUpsertBulk

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

type ReadUpsertOne

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

ReadUpsertOne is the builder for "upsert"-ing

one Read node.

func (*ReadUpsertOne) DoNothing

func (u *ReadUpsertOne) DoNothing() *ReadUpsertOne

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

func (*ReadUpsertOne) Exec

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

Exec executes the query.

func (*ReadUpsertOne) ExecX

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

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

func (*ReadUpsertOne) ID

func (u *ReadUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ReadUpsertOne) IDX

func (u *ReadUpsertOne) IDX(ctx context.Context) uuid.UUID

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

func (*ReadUpsertOne) Ignore

func (u *ReadUpsertOne) Ignore() *ReadUpsertOne

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

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

func (*ReadUpsertOne) SetCreatedAt

func (u *ReadUpsertOne) SetCreatedAt(v time.Time) *ReadUpsertOne

SetCreatedAt sets the "created_at" field.

func (*ReadUpsertOne) SetItemID

func (u *ReadUpsertOne) SetItemID(v uuid.UUID) *ReadUpsertOne

SetItemID sets the "item_id" field.

func (*ReadUpsertOne) SetUserID

func (u *ReadUpsertOne) SetUserID(v uuid.UUID) *ReadUpsertOne

SetUserID sets the "user_id" field.

func (*ReadUpsertOne) Update

func (u *ReadUpsertOne) Update(set func(*ReadUpsert)) *ReadUpsertOne

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

func (*ReadUpsertOne) UpdateCreatedAt

func (u *ReadUpsertOne) UpdateCreatedAt() *ReadUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ReadUpsertOne) UpdateItemID

func (u *ReadUpsertOne) UpdateItemID() *ReadUpsertOne

UpdateItemID sets the "item_id" field to the value that was provided on create.

func (*ReadUpsertOne) UpdateNewValues

func (u *ReadUpsertOne) UpdateNewValues() *ReadUpsertOne

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.Read.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(read.FieldID)
		}),
	).
	Exec(ctx)

func (*ReadUpsertOne) UpdateUserID

func (u *ReadUpsertOne) UpdateUserID() *ReadUpsertOne

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

type Reads

type Reads []*Read

Reads is a parsable slice of Read.

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 Subscription

type Subscription struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// FeedID holds the value of the "feed_id" field.
	FeedID uuid.UUID `json:"feed_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Group holds the value of the "group" field.
	Group string `json:"group,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 SubscriptionQuery when eager-loading is set.
	Edges SubscriptionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Subscription is the model entity for the Subscription schema.

func (*Subscription) QueryFeed

func (s *Subscription) QueryFeed() *FeedQuery

QueryFeed queries the "feed" edge of the Subscription entity.

func (*Subscription) QueryUser

func (s *Subscription) QueryUser() *UserQuery

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

func (*Subscription) String

func (s *Subscription) String() string

String implements the fmt.Stringer.

func (*Subscription) Unwrap

func (s *Subscription) Unwrap() *Subscription

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

func (s *Subscription) Update() *SubscriptionUpdateOne

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

type SubscriptionClient

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

SubscriptionClient is a client for the Subscription schema.

func NewSubscriptionClient

func NewSubscriptionClient(c config) *SubscriptionClient

NewSubscriptionClient returns a client for the Subscription from the given config.

func (*SubscriptionClient) Create

Create returns a builder for creating a Subscription entity.

func (*SubscriptionClient) CreateBulk

func (c *SubscriptionClient) CreateBulk(builders ...*SubscriptionCreate) *SubscriptionCreateBulk

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

func (*SubscriptionClient) Delete

Delete returns a delete builder for Subscription.

func (*SubscriptionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionClient) DeleteOneID

func (c *SubscriptionClient) DeleteOneID(id uuid.UUID) *SubscriptionDeleteOne

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

func (*SubscriptionClient) Get

Get returns a Subscription entity by its id.

func (*SubscriptionClient) GetX

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

func (*SubscriptionClient) Hooks

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

Hooks returns the client hooks.

func (*SubscriptionClient) Query

Query returns a query builder for Subscription.

func (*SubscriptionClient) QueryFeed

func (c *SubscriptionClient) QueryFeed(s *Subscription) *FeedQuery

QueryFeed queries the feed edge of a Subscription.

func (*SubscriptionClient) QueryUser

func (c *SubscriptionClient) QueryUser(s *Subscription) *UserQuery

QueryUser queries the user edge of a Subscription.

func (*SubscriptionClient) Update

Update returns an update builder for Subscription.

func (*SubscriptionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionClient) UpdateOneID

func (c *SubscriptionClient) UpdateOneID(id uuid.UUID) *SubscriptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubscriptionClient) Use

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

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

type SubscriptionCreate

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

SubscriptionCreate is the builder for creating a Subscription entity.

func (*SubscriptionCreate) Exec

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

Exec executes the query.

func (*SubscriptionCreate) ExecX

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

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

func (*SubscriptionCreate) Mutation

func (sc *SubscriptionCreate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionCreate) OnConflict

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

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

func (*SubscriptionCreate) OnConflictColumns

func (sc *SubscriptionCreate) OnConflictColumns(columns ...string) *SubscriptionUpsertOne

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

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

func (*SubscriptionCreate) Save

Save creates the Subscription in the database.

func (*SubscriptionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionCreate) SetCreatedAt

func (sc *SubscriptionCreate) SetCreatedAt(t time.Time) *SubscriptionCreate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionCreate) SetFeed

func (sc *SubscriptionCreate) SetFeed(f *Feed) *SubscriptionCreate

SetFeed sets the "feed" edge to the Feed entity.

func (*SubscriptionCreate) SetFeedID

func (sc *SubscriptionCreate) SetFeedID(u uuid.UUID) *SubscriptionCreate

SetFeedID sets the "feed_id" field.

func (*SubscriptionCreate) SetGroup

func (sc *SubscriptionCreate) SetGroup(s string) *SubscriptionCreate

SetGroup sets the "group" field.

func (*SubscriptionCreate) SetID

SetID sets the "id" field.

func (*SubscriptionCreate) SetName

SetName sets the "name" field.

func (*SubscriptionCreate) SetNillableCreatedAt

func (sc *SubscriptionCreate) SetNillableCreatedAt(t *time.Time) *SubscriptionCreate

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

func (*SubscriptionCreate) SetNillableID

func (sc *SubscriptionCreate) SetNillableID(u *uuid.UUID) *SubscriptionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SubscriptionCreate) SetUser

func (sc *SubscriptionCreate) SetUser(u *User) *SubscriptionCreate

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

func (*SubscriptionCreate) SetUserID

func (sc *SubscriptionCreate) SetUserID(u uuid.UUID) *SubscriptionCreate

SetUserID sets the "user_id" field.

type SubscriptionCreateBulk

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

SubscriptionCreateBulk is the builder for creating many Subscription entities in bulk.

func (*SubscriptionCreateBulk) Exec

Exec executes the query.

func (*SubscriptionCreateBulk) ExecX

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

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

func (*SubscriptionCreateBulk) OnConflict

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

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

func (*SubscriptionCreateBulk) OnConflictColumns

func (scb *SubscriptionCreateBulk) OnConflictColumns(columns ...string) *SubscriptionUpsertBulk

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

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

func (*SubscriptionCreateBulk) Save

Save creates the Subscription entities in the database.

func (*SubscriptionCreateBulk) SaveX

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

type SubscriptionDelete

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

SubscriptionDelete is the builder for deleting a Subscription entity.

func (*SubscriptionDelete) Exec

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

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

func (*SubscriptionDelete) ExecX

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

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

func (*SubscriptionDelete) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionDeleteOne

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

SubscriptionDeleteOne is the builder for deleting a single Subscription entity.

func (*SubscriptionDeleteOne) Exec

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

Exec executes the deletion query.

func (*SubscriptionDeleteOne) ExecX

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

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

type SubscriptionEdges

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

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

func (SubscriptionEdges) FeedOrErr

func (e SubscriptionEdges) FeedOrErr() (*Feed, error)

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

func (SubscriptionEdges) UserOrErr

func (e SubscriptionEdges) 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 SubscriptionGroupBy

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

SubscriptionGroupBy is the group-by builder for Subscription entities.

func (*SubscriptionGroupBy) Aggregate

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

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

func (*SubscriptionGroupBy) Bool

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

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

func (*SubscriptionGroupBy) BoolX

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

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

func (*SubscriptionGroupBy) Bools

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

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

func (*SubscriptionGroupBy) BoolsX

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

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

func (*SubscriptionGroupBy) Float64

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

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

func (*SubscriptionGroupBy) Float64X

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

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

func (*SubscriptionGroupBy) Float64s

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

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

func (*SubscriptionGroupBy) Float64sX

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

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

func (*SubscriptionGroupBy) Int

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

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

func (*SubscriptionGroupBy) IntX

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

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

func (*SubscriptionGroupBy) Ints

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

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

func (*SubscriptionGroupBy) IntsX

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

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

func (*SubscriptionGroupBy) Scan

func (sgb *SubscriptionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionGroupBy) ScanX

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

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

func (*SubscriptionGroupBy) String

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

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

func (*SubscriptionGroupBy) StringX

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

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

func (*SubscriptionGroupBy) Strings

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

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

func (*SubscriptionGroupBy) StringsX

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

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

type SubscriptionMutation

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

SubscriptionMutation represents an operation that mutates the Subscription nodes in the graph.

func (*SubscriptionMutation) AddField

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

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

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

func (*SubscriptionMutation) AddedField

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

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

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

func (*SubscriptionMutation) AddedIDs

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

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

func (*SubscriptionMutation) ClearEdge

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ClearFeed

func (m *SubscriptionMutation) ClearFeed()

ClearFeed clears the "feed" edge to the Feed entity.

func (*SubscriptionMutation) ClearField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ClearUser

func (m *SubscriptionMutation) ClearUser()

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

func (*SubscriptionMutation) ClearedEdges

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

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

func (*SubscriptionMutation) ClearedFields

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

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

func (SubscriptionMutation) Client

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

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

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

func (*SubscriptionMutation) EdgeCleared

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

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

func (*SubscriptionMutation) FeedCleared

func (m *SubscriptionMutation) FeedCleared() bool

FeedCleared reports if the "feed" edge to the Feed entity was cleared.

func (*SubscriptionMutation) FeedID

func (m *SubscriptionMutation) FeedID() (r uuid.UUID, exists bool)

FeedID returns the value of the "feed_id" field in the mutation.

func (*SubscriptionMutation) FeedIDs

func (m *SubscriptionMutation) FeedIDs() (ids []uuid.UUID)

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

func (*SubscriptionMutation) Field

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

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

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

func (*SubscriptionMutation) Fields

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) Group

func (m *SubscriptionMutation) Group() (r string, exists bool)

Group returns the value of the "group" field in the mutation.

func (*SubscriptionMutation) ID

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) 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 (*SubscriptionMutation) Name

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

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

func (*SubscriptionMutation) OldCreatedAt

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

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

func (m *SubscriptionMutation) OldFeedID(ctx context.Context) (v uuid.UUID, err error)

OldFeedID returns the old "feed_id" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) OldGroup

func (m *SubscriptionMutation) OldGroup(ctx context.Context) (v string, err error)

OldGroup returns the old "group" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldName

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

OldName returns the old "name" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldUserID

func (m *SubscriptionMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

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

func (m *SubscriptionMutation) Op() Op

Op returns the operation name.

func (*SubscriptionMutation) RemovedEdges

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

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

func (*SubscriptionMutation) RemovedIDs

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

func (m *SubscriptionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SubscriptionMutation) ResetEdge

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetFeed

func (m *SubscriptionMutation) ResetFeed()

ResetFeed resets all changes to the "feed" edge.

func (*SubscriptionMutation) ResetFeedID

func (m *SubscriptionMutation) ResetFeedID()

ResetFeedID resets all changes to the "feed_id" field.

func (*SubscriptionMutation) ResetField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetGroup

func (m *SubscriptionMutation) ResetGroup()

ResetGroup resets all changes to the "group" field.

func (*SubscriptionMutation) ResetName

func (m *SubscriptionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SubscriptionMutation) ResetUser

func (m *SubscriptionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SubscriptionMutation) ResetUserID

func (m *SubscriptionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SubscriptionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SubscriptionMutation) SetFeedID

func (m *SubscriptionMutation) SetFeedID(u uuid.UUID)

SetFeedID sets the "feed_id" field.

func (*SubscriptionMutation) SetField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) SetGroup

func (m *SubscriptionMutation) SetGroup(s string)

SetGroup sets the "group" field.

func (*SubscriptionMutation) SetID

func (m *SubscriptionMutation) SetID(id uuid.UUID)

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

func (*SubscriptionMutation) SetName

func (m *SubscriptionMutation) SetName(s string)

SetName sets the "name" field.

func (*SubscriptionMutation) SetUserID

func (m *SubscriptionMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (SubscriptionMutation) Tx

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

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

func (*SubscriptionMutation) Type

func (m *SubscriptionMutation) Type() string

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

func (*SubscriptionMutation) UserCleared

func (m *SubscriptionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*SubscriptionMutation) UserID

func (m *SubscriptionMutation) UserID() (r uuid.UUID, exists bool)

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

func (*SubscriptionMutation) UserIDs

func (m *SubscriptionMutation) UserIDs() (ids []uuid.UUID)

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

Where appends a list predicates to the SubscriptionMutation builder.

type SubscriptionQuery

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

SubscriptionQuery is the builder for querying Subscription entities.

func (*SubscriptionQuery) All

func (sq *SubscriptionQuery) All(ctx context.Context) ([]*Subscription, error)

All executes the query and returns a list of Subscriptions.

func (*SubscriptionQuery) AllX

func (sq *SubscriptionQuery) AllX(ctx context.Context) []*Subscription

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

func (*SubscriptionQuery) Clone

func (sq *SubscriptionQuery) Clone() *SubscriptionQuery

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

func (*SubscriptionQuery) Count

func (sq *SubscriptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionQuery) CountX

func (sq *SubscriptionQuery) CountX(ctx context.Context) int

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

func (*SubscriptionQuery) Exist

func (sq *SubscriptionQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubscriptionQuery) ExistX

func (sq *SubscriptionQuery) ExistX(ctx context.Context) bool

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

func (*SubscriptionQuery) First

func (sq *SubscriptionQuery) First(ctx context.Context) (*Subscription, error)

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

func (*SubscriptionQuery) FirstID

func (sq *SubscriptionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SubscriptionQuery) FirstIDX

func (sq *SubscriptionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SubscriptionQuery) FirstX

func (sq *SubscriptionQuery) FirstX(ctx context.Context) *Subscription

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

func (*SubscriptionQuery) GroupBy

func (sq *SubscriptionQuery) GroupBy(field string, fields ...string) *SubscriptionGroupBy

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Subscription.Query().
	GroupBy(subscription.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionQuery) IDs

func (sq *SubscriptionQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*SubscriptionQuery) IDsX

func (sq *SubscriptionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SubscriptionQuery) Limit

func (sq *SubscriptionQuery) Limit(limit int) *SubscriptionQuery

Limit adds a limit step to the query.

func (*SubscriptionQuery) Offset

func (sq *SubscriptionQuery) Offset(offset int) *SubscriptionQuery

Offset adds an offset step to the query.

func (*SubscriptionQuery) Only

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

func (*SubscriptionQuery) OnlyID

func (sq *SubscriptionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SubscriptionQuery) OnlyIDX

func (sq *SubscriptionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SubscriptionQuery) OnlyX

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

func (*SubscriptionQuery) Order

Order adds an order step to the query.

func (*SubscriptionQuery) QueryFeed

func (sq *SubscriptionQuery) QueryFeed() *FeedQuery

QueryFeed chains the current query on the "feed" edge.

func (*SubscriptionQuery) QueryUser

func (sq *SubscriptionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SubscriptionQuery) Select

func (sq *SubscriptionQuery) Select(fields ...string) *SubscriptionSelect

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
}

client.Subscription.Query().
	Select(subscription.FieldUserID).
	Scan(ctx, &v)

func (*SubscriptionQuery) Unique

func (sq *SubscriptionQuery) Unique(unique bool) *SubscriptionQuery

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

Where adds a new predicate for the SubscriptionQuery builder.

func (*SubscriptionQuery) WithFeed

func (sq *SubscriptionQuery) WithFeed(opts ...func(*FeedQuery)) *SubscriptionQuery

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

func (*SubscriptionQuery) WithUser

func (sq *SubscriptionQuery) WithUser(opts ...func(*UserQuery)) *SubscriptionQuery

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 SubscriptionSelect

type SubscriptionSelect struct {
	*SubscriptionQuery
	// contains filtered or unexported fields
}

SubscriptionSelect is the builder for selecting fields of Subscription entities.

func (*SubscriptionSelect) Bool

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

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

func (*SubscriptionSelect) BoolX

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

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

func (*SubscriptionSelect) Bools

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

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

func (*SubscriptionSelect) BoolsX

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

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

func (*SubscriptionSelect) Float64

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

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

func (*SubscriptionSelect) Float64X

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

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

func (*SubscriptionSelect) Float64s

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

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

func (*SubscriptionSelect) Float64sX

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

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

func (*SubscriptionSelect) Int

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

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

func (*SubscriptionSelect) IntX

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

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

func (*SubscriptionSelect) Ints

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

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

func (*SubscriptionSelect) IntsX

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

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

func (*SubscriptionSelect) Scan

func (ss *SubscriptionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionSelect) ScanX

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

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

func (*SubscriptionSelect) String

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

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

func (*SubscriptionSelect) StringX

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

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

func (*SubscriptionSelect) Strings

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

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

func (*SubscriptionSelect) StringsX

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

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

type SubscriptionUpdate

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

SubscriptionUpdate is the builder for updating Subscription entities.

func (*SubscriptionUpdate) ClearFeed

func (su *SubscriptionUpdate) ClearFeed() *SubscriptionUpdate

ClearFeed clears the "feed" edge to the Feed entity.

func (*SubscriptionUpdate) ClearUser

func (su *SubscriptionUpdate) ClearUser() *SubscriptionUpdate

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

func (*SubscriptionUpdate) Exec

func (su *SubscriptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionUpdate) ExecX

func (su *SubscriptionUpdate) ExecX(ctx context.Context)

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

func (*SubscriptionUpdate) Mutation

func (su *SubscriptionUpdate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdate) Save

func (su *SubscriptionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SubscriptionUpdate) SaveX

func (su *SubscriptionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUpdate) SetCreatedAt

func (su *SubscriptionUpdate) SetCreatedAt(t time.Time) *SubscriptionUpdate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpdate) SetFeed

func (su *SubscriptionUpdate) SetFeed(f *Feed) *SubscriptionUpdate

SetFeed sets the "feed" edge to the Feed entity.

func (*SubscriptionUpdate) SetFeedID

func (su *SubscriptionUpdate) SetFeedID(u uuid.UUID) *SubscriptionUpdate

SetFeedID sets the "feed_id" field.

func (*SubscriptionUpdate) SetGroup

func (su *SubscriptionUpdate) SetGroup(s string) *SubscriptionUpdate

SetGroup sets the "group" field.

func (*SubscriptionUpdate) SetName

SetName sets the "name" field.

func (*SubscriptionUpdate) SetNillableCreatedAt

func (su *SubscriptionUpdate) SetNillableCreatedAt(t *time.Time) *SubscriptionUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SubscriptionUpdate) SetUser

func (su *SubscriptionUpdate) SetUser(u *User) *SubscriptionUpdate

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUpdate) SetUserID

func (su *SubscriptionUpdate) SetUserID(u uuid.UUID) *SubscriptionUpdate

SetUserID sets the "user_id" field.

func (*SubscriptionUpdate) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUpdateOne

type SubscriptionUpdateOne struct {
	// contains filtered or unexported fields
}

SubscriptionUpdateOne is the builder for updating a single Subscription entity.

func (*SubscriptionUpdateOne) ClearFeed

func (suo *SubscriptionUpdateOne) ClearFeed() *SubscriptionUpdateOne

ClearFeed clears the "feed" edge to the Feed entity.

func (*SubscriptionUpdateOne) ClearUser

func (suo *SubscriptionUpdateOne) ClearUser() *SubscriptionUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*SubscriptionUpdateOne) Exec

func (suo *SubscriptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SubscriptionUpdateOne) ExecX

func (suo *SubscriptionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUpdateOne) Mutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdateOne) Save

Save executes the query and returns the updated Subscription entity.

func (*SubscriptionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUpdateOne) Select

func (suo *SubscriptionUpdateOne) Select(field string, fields ...string) *SubscriptionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SubscriptionUpdateOne) SetCreatedAt

func (suo *SubscriptionUpdateOne) SetCreatedAt(t time.Time) *SubscriptionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpdateOne) SetFeed

SetFeed sets the "feed" edge to the Feed entity.

func (*SubscriptionUpdateOne) SetFeedID

SetFeedID sets the "feed_id" field.

func (*SubscriptionUpdateOne) SetGroup

SetGroup sets the "group" field.

func (*SubscriptionUpdateOne) SetName

SetName sets the "name" field.

func (*SubscriptionUpdateOne) SetNillableCreatedAt

func (suo *SubscriptionUpdateOne) SetNillableCreatedAt(t *time.Time) *SubscriptionUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUpdateOne) SetUserID

SetUserID sets the "user_id" field.

type SubscriptionUpsert

type SubscriptionUpsert struct {
	*sql.UpdateSet
}

SubscriptionUpsert is the "OnConflict" setter.

func (*SubscriptionUpsert) SetCreatedAt

func (u *SubscriptionUpsert) SetCreatedAt(v time.Time) *SubscriptionUpsert

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpsert) SetFeedID

SetFeedID sets the "feed_id" field.

func (*SubscriptionUpsert) SetGroup

SetGroup sets the "group" field.

func (*SubscriptionUpsert) SetName

SetName sets the "name" field.

func (*SubscriptionUpsert) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpsert) UpdateCreatedAt

func (u *SubscriptionUpsert) UpdateCreatedAt() *SubscriptionUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*SubscriptionUpsert) UpdateFeedID

func (u *SubscriptionUpsert) UpdateFeedID() *SubscriptionUpsert

UpdateFeedID sets the "feed_id" field to the value that was provided on create.

func (*SubscriptionUpsert) UpdateGroup

func (u *SubscriptionUpsert) UpdateGroup() *SubscriptionUpsert

UpdateGroup sets the "group" field to the value that was provided on create.

func (*SubscriptionUpsert) UpdateName

func (u *SubscriptionUpsert) UpdateName() *SubscriptionUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*SubscriptionUpsert) UpdateUserID

func (u *SubscriptionUpsert) UpdateUserID() *SubscriptionUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type SubscriptionUpsertBulk

type SubscriptionUpsertBulk struct {
	// contains filtered or unexported fields
}

SubscriptionUpsertBulk is the builder for "upsert"-ing a bulk of Subscription nodes.

func (*SubscriptionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SubscriptionUpsertBulk) Exec

Exec executes the query.

func (*SubscriptionUpsertBulk) ExecX

func (u *SubscriptionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Subscription.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SubscriptionUpsertBulk) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpsertBulk) SetFeedID

SetFeedID sets the "feed_id" field.

func (*SubscriptionUpsertBulk) SetGroup

SetGroup sets the "group" field.

func (*SubscriptionUpsertBulk) SetName

SetName sets the "name" field.

func (*SubscriptionUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the SubscriptionCreateBulk.OnConflict documentation for more info.

func (*SubscriptionUpsertBulk) UpdateCreatedAt

func (u *SubscriptionUpsertBulk) UpdateCreatedAt() *SubscriptionUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*SubscriptionUpsertBulk) UpdateFeedID

UpdateFeedID sets the "feed_id" field to the value that was provided on create.

func (*SubscriptionUpsertBulk) UpdateGroup

UpdateGroup sets the "group" field to the value that was provided on create.

func (*SubscriptionUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*SubscriptionUpsertBulk) UpdateNewValues

func (u *SubscriptionUpsertBulk) UpdateNewValues() *SubscriptionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Subscription.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(subscription.FieldID)
		}),
	).
	Exec(ctx)

func (*SubscriptionUpsertBulk) UpdateUserID

UpdateUserID sets the "user_id" field to the value that was provided on create.

type SubscriptionUpsertOne

type SubscriptionUpsertOne struct {
	// contains filtered or unexported fields
}

SubscriptionUpsertOne is the builder for "upsert"-ing

one Subscription node.

func (*SubscriptionUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SubscriptionUpsertOne) Exec

Exec executes the query.

func (*SubscriptionUpsertOne) ExecX

func (u *SubscriptionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUpsertOne) ID

func (u *SubscriptionUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SubscriptionUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*SubscriptionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Subscription.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SubscriptionUpsertOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpsertOne) SetFeedID

SetFeedID sets the "feed_id" field.

func (*SubscriptionUpsertOne) SetGroup

SetGroup sets the "group" field.

func (*SubscriptionUpsertOne) SetName

SetName sets the "name" field.

func (*SubscriptionUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the SubscriptionCreate.OnConflict documentation for more info.

func (*SubscriptionUpsertOne) UpdateCreatedAt

func (u *SubscriptionUpsertOne) UpdateCreatedAt() *SubscriptionUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*SubscriptionUpsertOne) UpdateFeedID

func (u *SubscriptionUpsertOne) UpdateFeedID() *SubscriptionUpsertOne

UpdateFeedID sets the "feed_id" field to the value that was provided on create.

func (*SubscriptionUpsertOne) UpdateGroup

func (u *SubscriptionUpsertOne) UpdateGroup() *SubscriptionUpsertOne

UpdateGroup sets the "group" field to the value that was provided on create.

func (*SubscriptionUpsertOne) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*SubscriptionUpsertOne) UpdateNewValues

func (u *SubscriptionUpsertOne) UpdateNewValues() *SubscriptionUpsertOne

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.Subscription.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(subscription.FieldID)
		}),
	).
	Exec(ctx)

func (*SubscriptionUpsertOne) UpdateUserID

func (u *SubscriptionUpsertOne) UpdateUserID() *SubscriptionUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type Subscriptions

type Subscriptions []*Subscription

Subscriptions is a parsable slice of Subscription.

type Token

type Token struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"-"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TokenQuery when eager-loading is set.
	Edges TokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

Token is the model entity for the Token schema.

func (*Token) QueryOwner

func (t *Token) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Token entity.

func (*Token) String

func (t *Token) String() string

String implements the fmt.Stringer.

func (*Token) Unwrap

func (t *Token) Unwrap() *Token

Unwrap unwraps the Token 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 (*Token) Update

func (t *Token) Update() *TokenUpdateOne

Update returns a builder for updating this Token. Note that you need to call Token.Unwrap() before calling this method if this Token was returned from a transaction, and the transaction was committed or rolled back.

type TokenClient

type TokenClient struct {
	// contains filtered or unexported fields
}

TokenClient is a client for the Token schema.

func NewTokenClient

func NewTokenClient(c config) *TokenClient

NewTokenClient returns a client for the Token from the given config.

func (*TokenClient) Create

func (c *TokenClient) Create() *TokenCreate

Create returns a builder for creating a Token entity.

func (*TokenClient) CreateBulk

func (c *TokenClient) CreateBulk(builders ...*TokenCreate) *TokenCreateBulk

CreateBulk returns a builder for creating a bulk of Token entities.

func (*TokenClient) Delete

func (c *TokenClient) Delete() *TokenDelete

Delete returns a delete builder for Token.

func (*TokenClient) DeleteOne

func (c *TokenClient) DeleteOne(t *Token) *TokenDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TokenClient) DeleteOneID

func (c *TokenClient) DeleteOneID(id uuid.UUID) *TokenDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*TokenClient) Get

func (c *TokenClient) Get(ctx context.Context, id uuid.UUID) (*Token, error)

Get returns a Token entity by its id.

func (*TokenClient) GetX

func (c *TokenClient) GetX(ctx context.Context, id uuid.UUID) *Token

GetX is like Get, but panics if an error occurs.

func (*TokenClient) Hooks

func (c *TokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TokenClient) Query

func (c *TokenClient) Query() *TokenQuery

Query returns a query builder for Token.

func (*TokenClient) QueryOwner

func (c *TokenClient) QueryOwner(t *Token) *UserQuery

QueryOwner queries the owner edge of a Token.

func (*TokenClient) Update

func (c *TokenClient) Update() *TokenUpdate

Update returns an update builder for Token.

func (*TokenClient) UpdateOne

func (c *TokenClient) UpdateOne(t *Token) *TokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenClient) UpdateOneID

func (c *TokenClient) UpdateOneID(id uuid.UUID) *TokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenClient) Use

func (c *TokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `token.Hooks(f(g(h())))`.

type TokenCreate

type TokenCreate struct {
	// contains filtered or unexported fields
}

TokenCreate is the builder for creating a Token entity.

func (*TokenCreate) Exec

func (tc *TokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreate) ExecX

func (tc *TokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreate) Mutation

func (tc *TokenCreate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenCreate) OnConflict

func (tc *TokenCreate) OnConflict(opts ...sql.ConflictOption) *TokenUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Token.Create().
	SetType(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.TokenUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*TokenCreate) OnConflictColumns

func (tc *TokenCreate) OnConflictColumns(columns ...string) *TokenUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Token.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TokenCreate) Save

func (tc *TokenCreate) Save(ctx context.Context) (*Token, error)

Save creates the Token in the database.

func (*TokenCreate) SaveX

func (tc *TokenCreate) SaveX(ctx context.Context) *Token

SaveX calls Save and panics if Save returns an error.

func (*TokenCreate) SetCreatedAt

func (tc *TokenCreate) SetCreatedAt(t time.Time) *TokenCreate

SetCreatedAt sets the "created_at" field.

func (*TokenCreate) SetDeletedAt

func (tc *TokenCreate) SetDeletedAt(t time.Time) *TokenCreate

SetDeletedAt sets the "deleted_at" field.

func (*TokenCreate) SetID

func (tc *TokenCreate) SetID(u uuid.UUID) *TokenCreate

SetID sets the "id" field.

func (*TokenCreate) SetName

func (tc *TokenCreate) SetName(s string) *TokenCreate

SetName sets the "name" field.

func (*TokenCreate) SetNillableCreatedAt

func (tc *TokenCreate) SetNillableCreatedAt(t *time.Time) *TokenCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TokenCreate) SetNillableDeletedAt

func (tc *TokenCreate) SetNillableDeletedAt(t *time.Time) *TokenCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*TokenCreate) SetNillableID

func (tc *TokenCreate) SetNillableID(u *uuid.UUID) *TokenCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TokenCreate) SetNillableOwnerID

func (tc *TokenCreate) SetNillableOwnerID(id *uuid.UUID) *TokenCreate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*TokenCreate) SetNillableType

func (tc *TokenCreate) SetNillableType(s *string) *TokenCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*TokenCreate) SetNillableUpdatedAt

func (tc *TokenCreate) SetNillableUpdatedAt(t *time.Time) *TokenCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TokenCreate) SetOwner

func (tc *TokenCreate) SetOwner(u *User) *TokenCreate

SetOwner sets the "owner" edge to the User entity.

func (*TokenCreate) SetOwnerID

func (tc *TokenCreate) SetOwnerID(id uuid.UUID) *TokenCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*TokenCreate) SetToken

func (tc *TokenCreate) SetToken(s string) *TokenCreate

SetToken sets the "token" field.

func (*TokenCreate) SetType

func (tc *TokenCreate) SetType(s string) *TokenCreate

SetType sets the "type" field.

func (*TokenCreate) SetUpdatedAt

func (tc *TokenCreate) SetUpdatedAt(t time.Time) *TokenCreate

SetUpdatedAt sets the "updated_at" field.

type TokenCreateBulk

type TokenCreateBulk struct {
	// contains filtered or unexported fields
}

TokenCreateBulk is the builder for creating many Token entities in bulk.

func (*TokenCreateBulk) Exec

func (tcb *TokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreateBulk) ExecX

func (tcb *TokenCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreateBulk) OnConflict

func (tcb *TokenCreateBulk) OnConflict(opts ...sql.ConflictOption) *TokenUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Token.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.TokenUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*TokenCreateBulk) OnConflictColumns

func (tcb *TokenCreateBulk) OnConflictColumns(columns ...string) *TokenUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Token.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TokenCreateBulk) Save

func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error)

Save creates the Token entities in the database.

func (*TokenCreateBulk) SaveX

func (tcb *TokenCreateBulk) SaveX(ctx context.Context) []*Token

SaveX is like Save, but panics if an error occurs.

type TokenDelete

type TokenDelete struct {
	// contains filtered or unexported fields
}

TokenDelete is the builder for deleting a Token entity.

func (*TokenDelete) Exec

func (td *TokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TokenDelete) ExecX

func (td *TokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TokenDelete) Where

func (td *TokenDelete) Where(ps ...predicate.Token) *TokenDelete

Where appends a list predicates to the TokenDelete builder.

type TokenDeleteOne

type TokenDeleteOne struct {
	// contains filtered or unexported fields
}

TokenDeleteOne is the builder for deleting a single Token entity.

func (*TokenDeleteOne) Exec

func (tdo *TokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TokenDeleteOne) ExecX

func (tdo *TokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TokenEdges

type TokenEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

TokenEdges holds the relations/edges for other nodes in the graph.

func (TokenEdges) OwnerOrErr

func (e TokenEdges) OwnerOrErr() (*User, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TokenGroupBy

type TokenGroupBy struct {
	// contains filtered or unexported fields
}

TokenGroupBy is the group-by builder for Token entities.

func (*TokenGroupBy) Aggregate

func (tgb *TokenGroupBy) Aggregate(fns ...AggregateFunc) *TokenGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TokenGroupBy) Bool

func (s *TokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) BoolX

func (s *TokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenGroupBy) Bools

func (s *TokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) BoolsX

func (s *TokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenGroupBy) Float64

func (s *TokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) Float64X

func (s *TokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenGroupBy) Float64s

func (s *TokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) Float64sX

func (s *TokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenGroupBy) Int

func (s *TokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) IntX

func (s *TokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenGroupBy) Ints

func (s *TokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) IntsX

func (s *TokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenGroupBy) Scan

func (tgb *TokenGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TokenGroupBy) ScanX

func (s *TokenGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TokenGroupBy) String

func (s *TokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) StringX

func (s *TokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenGroupBy) Strings

func (s *TokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) StringsX

func (s *TokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenMutation

type TokenMutation struct {
	// contains filtered or unexported fields
}

TokenMutation represents an operation that mutates the Token nodes in the graph.

func (*TokenMutation) AddField

func (m *TokenMutation) 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 (*TokenMutation) AddedEdges

func (m *TokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TokenMutation) AddedField

func (m *TokenMutation) 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 (*TokenMutation) AddedFields

func (m *TokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TokenMutation) AddedIDs

func (m *TokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TokenMutation) ClearDeletedAt

func (m *TokenMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TokenMutation) ClearEdge

func (m *TokenMutation) 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 (*TokenMutation) ClearField

func (m *TokenMutation) 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 (*TokenMutation) ClearOwner

func (m *TokenMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*TokenMutation) ClearedEdges

func (m *TokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TokenMutation) ClearedFields

func (m *TokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TokenMutation) Client

func (m TokenMutation) 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 (*TokenMutation) CreatedAt

func (m *TokenMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TokenMutation) DeletedAt

func (m *TokenMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*TokenMutation) DeletedAtCleared

func (m *TokenMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*TokenMutation) EdgeCleared

func (m *TokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TokenMutation) Field

func (m *TokenMutation) 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 (*TokenMutation) FieldCleared

func (m *TokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TokenMutation) Fields

func (m *TokenMutation) 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 (*TokenMutation) GetType

func (m *TokenMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*TokenMutation) ID

func (m *TokenMutation) 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 (*TokenMutation) IDs

func (m *TokenMutation) 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 (*TokenMutation) Name

func (m *TokenMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*TokenMutation) OldCreatedAt

func (m *TokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Token entity. If the Token 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 (*TokenMutation) OldDeletedAt

func (m *TokenMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Token entity. If the Token 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 (*TokenMutation) OldField

func (m *TokenMutation) 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 (*TokenMutation) OldName

func (m *TokenMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Token entity. If the Token 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 (*TokenMutation) OldToken

func (m *TokenMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Token entity. If the Token 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 (*TokenMutation) OldType

func (m *TokenMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Token entity. If the Token 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 (*TokenMutation) OldUpdatedAt

func (m *TokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Token entity. If the Token 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 (*TokenMutation) Op

func (m *TokenMutation) Op() Op

Op returns the operation name.

func (*TokenMutation) OwnerCleared

func (m *TokenMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*TokenMutation) OwnerID

func (m *TokenMutation) OwnerID() (id uuid.UUID, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*TokenMutation) OwnerIDs

func (m *TokenMutation) OwnerIDs() (ids []uuid.UUID)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*TokenMutation) RemovedEdges

func (m *TokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TokenMutation) RemovedIDs

func (m *TokenMutation) 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 (*TokenMutation) ResetCreatedAt

func (m *TokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TokenMutation) ResetDeletedAt

func (m *TokenMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*TokenMutation) ResetEdge

func (m *TokenMutation) 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 (*TokenMutation) ResetField

func (m *TokenMutation) 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 (*TokenMutation) ResetName

func (m *TokenMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TokenMutation) ResetOwner

func (m *TokenMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*TokenMutation) ResetToken

func (m *TokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*TokenMutation) ResetType

func (m *TokenMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*TokenMutation) ResetUpdatedAt

func (m *TokenMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TokenMutation) SetCreatedAt

func (m *TokenMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TokenMutation) SetDeletedAt

func (m *TokenMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*TokenMutation) SetField

func (m *TokenMutation) 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 (*TokenMutation) SetID

func (m *TokenMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Token entities.

func (*TokenMutation) SetName

func (m *TokenMutation) SetName(s string)

SetName sets the "name" field.

func (*TokenMutation) SetOwnerID

func (m *TokenMutation) SetOwnerID(id uuid.UUID)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*TokenMutation) SetToken

func (m *TokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*TokenMutation) SetType

func (m *TokenMutation) SetType(s string)

SetType sets the "type" field.

func (*TokenMutation) SetUpdatedAt

func (m *TokenMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TokenMutation) Token

func (m *TokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (TokenMutation) Tx

func (m TokenMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TokenMutation) Type

func (m *TokenMutation) Type() string

Type returns the node type of this mutation (Token).

func (*TokenMutation) UpdatedAt

func (m *TokenMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TokenMutation) Where

func (m *TokenMutation) Where(ps ...predicate.Token)

Where appends a list predicates to the TokenMutation builder.

type TokenQuery

type TokenQuery struct {
	// contains filtered or unexported fields
}

TokenQuery is the builder for querying Token entities.

func (*TokenQuery) All

func (tq *TokenQuery) All(ctx context.Context) ([]*Token, error)

All executes the query and returns a list of Tokens.

func (*TokenQuery) AllX

func (tq *TokenQuery) AllX(ctx context.Context) []*Token

AllX is like All, but panics if an error occurs.

func (*TokenQuery) Clone

func (tq *TokenQuery) Clone() *TokenQuery

Clone returns a duplicate of the TokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TokenQuery) Count

func (tq *TokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TokenQuery) CountX

func (tq *TokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TokenQuery) Exist

func (tq *TokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TokenQuery) ExistX

func (tq *TokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TokenQuery) First

func (tq *TokenQuery) First(ctx context.Context) (*Token, error)

First returns the first Token entity from the query. Returns a *NotFoundError when no Token was found.

func (*TokenQuery) FirstID

func (tq *TokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Token ID from the query. Returns a *NotFoundError when no Token ID was found.

func (*TokenQuery) FirstIDX

func (tq *TokenQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TokenQuery) FirstX

func (tq *TokenQuery) FirstX(ctx context.Context) *Token

FirstX is like First, but panics if an error occurs.

func (*TokenQuery) GroupBy

func (tq *TokenQuery) GroupBy(field string, fields ...string) *TokenGroupBy

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 {
	Type string `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Token.Query().
	GroupBy(token.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenQuery) IDs

func (tq *TokenQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Token IDs.

func (*TokenQuery) IDsX

func (tq *TokenQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TokenQuery) Limit

func (tq *TokenQuery) Limit(limit int) *TokenQuery

Limit adds a limit step to the query.

func (*TokenQuery) Offset

func (tq *TokenQuery) Offset(offset int) *TokenQuery

Offset adds an offset step to the query.

func (*TokenQuery) Only

func (tq *TokenQuery) Only(ctx context.Context) (*Token, error)

Only returns a single Token entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Token entity is found. Returns a *NotFoundError when no Token entities are found.

func (*TokenQuery) OnlyID

func (tq *TokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Token ID in the query. Returns a *NotSingularError when more than one Token ID is found. Returns a *NotFoundError when no entities are found.

func (*TokenQuery) OnlyIDX

func (tq *TokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TokenQuery) OnlyX

func (tq *TokenQuery) OnlyX(ctx context.Context) *Token

OnlyX is like Only, but panics if an error occurs.

func (*TokenQuery) Order

func (tq *TokenQuery) Order(o ...OrderFunc) *TokenQuery

Order adds an order step to the query.

func (*TokenQuery) QueryOwner

func (tq *TokenQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*TokenQuery) Select

func (tq *TokenQuery) Select(fields ...string) *TokenSelect

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 {
	Type string `json:"type,omitempty"`
}

client.Token.Query().
	Select(token.FieldType).
	Scan(ctx, &v)

func (*TokenQuery) Unique

func (tq *TokenQuery) Unique(unique bool) *TokenQuery

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 (*TokenQuery) Where

func (tq *TokenQuery) Where(ps ...predicate.Token) *TokenQuery

Where adds a new predicate for the TokenQuery builder.

func (*TokenQuery) WithOwner

func (tq *TokenQuery) WithOwner(opts ...func(*UserQuery)) *TokenQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type TokenSelect

type TokenSelect struct {
	*TokenQuery
	// contains filtered or unexported fields
}

TokenSelect is the builder for selecting fields of Token entities.

func (*TokenSelect) Bool

func (s *TokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolX

func (s *TokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenSelect) Bools

func (s *TokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolsX

func (s *TokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenSelect) Float64

func (s *TokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64X

func (s *TokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenSelect) Float64s

func (s *TokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64sX

func (s *TokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenSelect) Int

func (s *TokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntX

func (s *TokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenSelect) Ints

func (s *TokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntsX

func (s *TokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenSelect) Scan

func (ts *TokenSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TokenSelect) ScanX

func (s *TokenSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TokenSelect) String

func (s *TokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringX

func (s *TokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenSelect) Strings

func (s *TokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringsX

func (s *TokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenUpdate

type TokenUpdate struct {
	// contains filtered or unexported fields
}

TokenUpdate is the builder for updating Token entities.

func (*TokenUpdate) ClearDeletedAt

func (tu *TokenUpdate) ClearDeletedAt() *TokenUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TokenUpdate) ClearOwner

func (tu *TokenUpdate) ClearOwner() *TokenUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*TokenUpdate) Exec

func (tu *TokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpdate) ExecX

func (tu *TokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdate) Mutation

func (tu *TokenUpdate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdate) Save

func (tu *TokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TokenUpdate) SaveX

func (tu *TokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdate) SetCreatedAt

func (tu *TokenUpdate) SetCreatedAt(t time.Time) *TokenUpdate

SetCreatedAt sets the "created_at" field.

func (*TokenUpdate) SetDeletedAt

func (tu *TokenUpdate) SetDeletedAt(t time.Time) *TokenUpdate

SetDeletedAt sets the "deleted_at" field.

func (*TokenUpdate) SetName

func (tu *TokenUpdate) SetName(s string) *TokenUpdate

SetName sets the "name" field.

func (*TokenUpdate) SetNillableCreatedAt

func (tu *TokenUpdate) SetNillableCreatedAt(t *time.Time) *TokenUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TokenUpdate) SetNillableDeletedAt

func (tu *TokenUpdate) SetNillableDeletedAt(t *time.Time) *TokenUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*TokenUpdate) SetNillableOwnerID

func (tu *TokenUpdate) SetNillableOwnerID(id *uuid.UUID) *TokenUpdate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*TokenUpdate) SetNillableType

func (tu *TokenUpdate) SetNillableType(s *string) *TokenUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*TokenUpdate) SetOwner

func (tu *TokenUpdate) SetOwner(u *User) *TokenUpdate

SetOwner sets the "owner" edge to the User entity.

func (*TokenUpdate) SetOwnerID

func (tu *TokenUpdate) SetOwnerID(id uuid.UUID) *TokenUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*TokenUpdate) SetToken

func (tu *TokenUpdate) SetToken(s string) *TokenUpdate

SetToken sets the "token" field.

func (*TokenUpdate) SetType

func (tu *TokenUpdate) SetType(s string) *TokenUpdate

SetType sets the "type" field.

func (*TokenUpdate) SetUpdatedAt

func (tu *TokenUpdate) SetUpdatedAt(t time.Time) *TokenUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdate) Where

func (tu *TokenUpdate) Where(ps ...predicate.Token) *TokenUpdate

Where appends a list predicates to the TokenUpdate builder.

type TokenUpdateOne

type TokenUpdateOne struct {
	// contains filtered or unexported fields
}

TokenUpdateOne is the builder for updating a single Token entity.

func (*TokenUpdateOne) ClearDeletedAt

func (tuo *TokenUpdateOne) ClearDeletedAt() *TokenUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TokenUpdateOne) ClearOwner

func (tuo *TokenUpdateOne) ClearOwner() *TokenUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*TokenUpdateOne) Exec

func (tuo *TokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TokenUpdateOne) ExecX

func (tuo *TokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdateOne) Mutation

func (tuo *TokenUpdateOne) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdateOne) Save

func (tuo *TokenUpdateOne) Save(ctx context.Context) (*Token, error)

Save executes the query and returns the updated Token entity.

func (*TokenUpdateOne) SaveX

func (tuo *TokenUpdateOne) SaveX(ctx context.Context) *Token

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdateOne) Select

func (tuo *TokenUpdateOne) Select(field string, fields ...string) *TokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TokenUpdateOne) SetCreatedAt

func (tuo *TokenUpdateOne) SetCreatedAt(t time.Time) *TokenUpdateOne

SetCreatedAt sets the "created_at" field.

func (*TokenUpdateOne) SetDeletedAt

func (tuo *TokenUpdateOne) SetDeletedAt(t time.Time) *TokenUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*TokenUpdateOne) SetName

func (tuo *TokenUpdateOne) SetName(s string) *TokenUpdateOne

SetName sets the "name" field.

func (*TokenUpdateOne) SetNillableCreatedAt

func (tuo *TokenUpdateOne) SetNillableCreatedAt(t *time.Time) *TokenUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableDeletedAt

func (tuo *TokenUpdateOne) SetNillableDeletedAt(t *time.Time) *TokenUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableOwnerID

func (tuo *TokenUpdateOne) SetNillableOwnerID(id *uuid.UUID) *TokenUpdateOne

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*TokenUpdateOne) SetNillableType

func (tuo *TokenUpdateOne) SetNillableType(s *string) *TokenUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*TokenUpdateOne) SetOwner

func (tuo *TokenUpdateOne) SetOwner(u *User) *TokenUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*TokenUpdateOne) SetOwnerID

func (tuo *TokenUpdateOne) SetOwnerID(id uuid.UUID) *TokenUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*TokenUpdateOne) SetToken

func (tuo *TokenUpdateOne) SetToken(s string) *TokenUpdateOne

SetToken sets the "token" field.

func (*TokenUpdateOne) SetType

func (tuo *TokenUpdateOne) SetType(s string) *TokenUpdateOne

SetType sets the "type" field.

func (*TokenUpdateOne) SetUpdatedAt

func (tuo *TokenUpdateOne) SetUpdatedAt(t time.Time) *TokenUpdateOne

SetUpdatedAt sets the "updated_at" field.

type TokenUpsert

type TokenUpsert struct {
	*sql.UpdateSet
}

TokenUpsert is the "OnConflict" setter.

func (*TokenUpsert) ClearDeletedAt

func (u *TokenUpsert) ClearDeletedAt() *TokenUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TokenUpsert) SetCreatedAt

func (u *TokenUpsert) SetCreatedAt(v time.Time) *TokenUpsert

SetCreatedAt sets the "created_at" field.

func (*TokenUpsert) SetDeletedAt

func (u *TokenUpsert) SetDeletedAt(v time.Time) *TokenUpsert

SetDeletedAt sets the "deleted_at" field.

func (*TokenUpsert) SetName

func (u *TokenUpsert) SetName(v string) *TokenUpsert

SetName sets the "name" field.

func (*TokenUpsert) SetToken

func (u *TokenUpsert) SetToken(v string) *TokenUpsert

SetToken sets the "token" field.

func (*TokenUpsert) SetType

func (u *TokenUpsert) SetType(v string) *TokenUpsert

SetType sets the "type" field.

func (*TokenUpsert) SetUpdatedAt

func (u *TokenUpsert) SetUpdatedAt(v time.Time) *TokenUpsert

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpsert) UpdateCreatedAt

func (u *TokenUpsert) UpdateCreatedAt() *TokenUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*TokenUpsert) UpdateDeletedAt

func (u *TokenUpsert) UpdateDeletedAt() *TokenUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*TokenUpsert) UpdateName

func (u *TokenUpsert) UpdateName() *TokenUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*TokenUpsert) UpdateToken

func (u *TokenUpsert) UpdateToken() *TokenUpsert

UpdateToken sets the "token" field to the value that was provided on create.

func (*TokenUpsert) UpdateType

func (u *TokenUpsert) UpdateType() *TokenUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*TokenUpsert) UpdateUpdatedAt

func (u *TokenUpsert) UpdateUpdatedAt() *TokenUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TokenUpsertBulk

type TokenUpsertBulk struct {
	// contains filtered or unexported fields
}

TokenUpsertBulk is the builder for "upsert"-ing a bulk of Token nodes.

func (*TokenUpsertBulk) ClearDeletedAt

func (u *TokenUpsertBulk) ClearDeletedAt() *TokenUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TokenUpsertBulk) DoNothing

func (u *TokenUpsertBulk) DoNothing() *TokenUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TokenUpsertBulk) Exec

func (u *TokenUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpsertBulk) ExecX

func (u *TokenUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpsertBulk) Ignore

func (u *TokenUpsertBulk) Ignore() *TokenUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Token.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TokenUpsertBulk) SetCreatedAt

func (u *TokenUpsertBulk) SetCreatedAt(v time.Time) *TokenUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*TokenUpsertBulk) SetDeletedAt

func (u *TokenUpsertBulk) SetDeletedAt(v time.Time) *TokenUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*TokenUpsertBulk) SetName

func (u *TokenUpsertBulk) SetName(v string) *TokenUpsertBulk

SetName sets the "name" field.

func (*TokenUpsertBulk) SetToken

func (u *TokenUpsertBulk) SetToken(v string) *TokenUpsertBulk

SetToken sets the "token" field.

func (*TokenUpsertBulk) SetType

func (u *TokenUpsertBulk) SetType(v string) *TokenUpsertBulk

SetType sets the "type" field.

func (*TokenUpsertBulk) SetUpdatedAt

func (u *TokenUpsertBulk) SetUpdatedAt(v time.Time) *TokenUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpsertBulk) Update

func (u *TokenUpsertBulk) Update(set func(*TokenUpsert)) *TokenUpsertBulk

Update allows overriding fields `UPDATE` values. See the TokenCreateBulk.OnConflict documentation for more info.

func (*TokenUpsertBulk) UpdateCreatedAt

func (u *TokenUpsertBulk) UpdateCreatedAt() *TokenUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*TokenUpsertBulk) UpdateDeletedAt

func (u *TokenUpsertBulk) UpdateDeletedAt() *TokenUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*TokenUpsertBulk) UpdateName

func (u *TokenUpsertBulk) UpdateName() *TokenUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*TokenUpsertBulk) UpdateNewValues

func (u *TokenUpsertBulk) UpdateNewValues() *TokenUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Token.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(token.FieldID)
		}),
	).
	Exec(ctx)

func (*TokenUpsertBulk) UpdateToken

func (u *TokenUpsertBulk) UpdateToken() *TokenUpsertBulk

UpdateToken sets the "token" field to the value that was provided on create.

func (*TokenUpsertBulk) UpdateType

func (u *TokenUpsertBulk) UpdateType() *TokenUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*TokenUpsertBulk) UpdateUpdatedAt

func (u *TokenUpsertBulk) UpdateUpdatedAt() *TokenUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TokenUpsertOne

type TokenUpsertOne struct {
	// contains filtered or unexported fields
}

TokenUpsertOne is the builder for "upsert"-ing

one Token node.

func (*TokenUpsertOne) ClearDeletedAt

func (u *TokenUpsertOne) ClearDeletedAt() *TokenUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TokenUpsertOne) DoNothing

func (u *TokenUpsertOne) DoNothing() *TokenUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TokenUpsertOne) Exec

func (u *TokenUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpsertOne) ExecX

func (u *TokenUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpsertOne) ID

func (u *TokenUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TokenUpsertOne) IDX

func (u *TokenUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*TokenUpsertOne) Ignore

func (u *TokenUpsertOne) Ignore() *TokenUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Token.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TokenUpsertOne) SetCreatedAt

func (u *TokenUpsertOne) SetCreatedAt(v time.Time) *TokenUpsertOne

SetCreatedAt sets the "created_at" field.

func (*TokenUpsertOne) SetDeletedAt

func (u *TokenUpsertOne) SetDeletedAt(v time.Time) *TokenUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*TokenUpsertOne) SetName

func (u *TokenUpsertOne) SetName(v string) *TokenUpsertOne

SetName sets the "name" field.

func (*TokenUpsertOne) SetToken

func (u *TokenUpsertOne) SetToken(v string) *TokenUpsertOne

SetToken sets the "token" field.

func (*TokenUpsertOne) SetType

func (u *TokenUpsertOne) SetType(v string) *TokenUpsertOne

SetType sets the "type" field.

func (*TokenUpsertOne) SetUpdatedAt

func (u *TokenUpsertOne) SetUpdatedAt(v time.Time) *TokenUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpsertOne) Update

func (u *TokenUpsertOne) Update(set func(*TokenUpsert)) *TokenUpsertOne

Update allows overriding fields `UPDATE` values. See the TokenCreate.OnConflict documentation for more info.

func (*TokenUpsertOne) UpdateCreatedAt

func (u *TokenUpsertOne) UpdateCreatedAt() *TokenUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*TokenUpsertOne) UpdateDeletedAt

func (u *TokenUpsertOne) UpdateDeletedAt() *TokenUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*TokenUpsertOne) UpdateName

func (u *TokenUpsertOne) UpdateName() *TokenUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*TokenUpsertOne) UpdateNewValues

func (u *TokenUpsertOne) UpdateNewValues() *TokenUpsertOne

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.Token.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(token.FieldID)
		}),
	).
	Exec(ctx)

func (*TokenUpsertOne) UpdateToken

func (u *TokenUpsertOne) UpdateToken() *TokenUpsertOne

UpdateToken sets the "token" field to the value that was provided on create.

func (*TokenUpsertOne) UpdateType

func (u *TokenUpsertOne) UpdateType() *TokenUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*TokenUpsertOne) UpdateUpdatedAt

func (u *TokenUpsertOne) UpdateUpdatedAt() *TokenUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Tokens

type Tokens []*Token

Tokens is a parsable slice of Token.

type Tx

type Tx struct {

	// Feed is the client for interacting with the Feed builders.
	Feed *FeedClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// Read is the client for interacting with the Read builders.
	Read *ReadClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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 uuid.UUID `json:"id,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// Role holds the value of the "role" field.
	Role string `json:"role,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,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) QueryReadItems

func (u *User) QueryReadItems() *ItemQuery

QueryReadItems queries the "read_items" edge of the User entity.

func (*User) QueryReads

func (u *User) QueryReads() *ReadQuery

QueryReads queries the "reads" edge of the User entity.

func (*User) QuerySubscribedFeeds

func (u *User) QuerySubscribedFeeds() *FeedQuery

QuerySubscribedFeeds queries the "subscribed_feeds" edge of the User entity.

func (*User) QuerySubscriptions

func (u *User) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions queries the "subscriptions" edge of the User entity.

func (*User) QueryTokens

func (u *User) QueryTokens() *TokenQuery

QueryTokens queries the "tokens" 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 uuid.UUID) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *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) QueryReadItems

func (c *UserClient) QueryReadItems(u *User) *ItemQuery

QueryReadItems queries the read_items edge of a User.

func (*UserClient) QueryReads

func (c *UserClient) QueryReads(u *User) *ReadQuery

QueryReads queries the reads edge of a User.

func (*UserClient) QuerySubscribedFeeds

func (c *UserClient) QuerySubscribedFeeds(u *User) *FeedQuery

QuerySubscribedFeeds queries the subscribed_feeds edge of a User.

func (*UserClient) QuerySubscriptions

func (c *UserClient) QuerySubscriptions(u *User) *SubscriptionQuery

QuerySubscriptions queries the subscriptions edge of a User.

func (*UserClient) QueryTokens

func (c *UserClient) QueryTokens(u *User) *TokenQuery

QueryTokens queries the tokens 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 uuid.UUID) *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) AddReadIDs

func (uc *UserCreate) AddReadIDs(ids ...uuid.UUID) *UserCreate

AddReadIDs adds the "reads" edge to the Read entity by IDs.

func (*UserCreate) AddReadItemIDs

func (uc *UserCreate) AddReadItemIDs(ids ...uuid.UUID) *UserCreate

AddReadItemIDs adds the "read_items" edge to the Item entity by IDs.

func (*UserCreate) AddReadItems

func (uc *UserCreate) AddReadItems(i ...*Item) *UserCreate

AddReadItems adds the "read_items" edges to the Item entity.

func (*UserCreate) AddReads

func (uc *UserCreate) AddReads(r ...*Read) *UserCreate

AddReads adds the "reads" edges to the Read entity.

func (*UserCreate) AddSubscribedFeedIDs

func (uc *UserCreate) AddSubscribedFeedIDs(ids ...uuid.UUID) *UserCreate

AddSubscribedFeedIDs adds the "subscribed_feeds" edge to the Feed entity by IDs.

func (*UserCreate) AddSubscribedFeeds

func (uc *UserCreate) AddSubscribedFeeds(f ...*Feed) *UserCreate

AddSubscribedFeeds adds the "subscribed_feeds" edges to the Feed entity.

func (*UserCreate) AddSubscriptionIDs

func (uc *UserCreate) AddSubscriptionIDs(ids ...uuid.UUID) *UserCreate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*UserCreate) AddSubscriptions

func (uc *UserCreate) AddSubscriptions(s ...*Subscription) *UserCreate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*UserCreate) AddTokenIDs

func (uc *UserCreate) AddTokenIDs(ids ...uuid.UUID) *UserCreate

AddTokenIDs adds the "tokens" edge to the Token entity by IDs.

func (*UserCreate) AddTokens

func (uc *UserCreate) AddTokens(t ...*Token) *UserCreate

AddTokens adds the "tokens" edges to the Token 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().
	SetUsername(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) {
		SetUsername(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) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDeletedAt

func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate

SetDeletedAt sets the "deleted_at" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableDeletedAt

func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableRole

func (uc *UserCreate) SetNillableRole(s *string) *UserCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetRole

func (uc *UserCreate) SetRole(s string) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

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) {
		SetUsername(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 {
	// Tokens holds the value of the tokens edge.
	Tokens []*Token `json:"tokens,omitempty"`
	// SubscribedFeeds holds the value of the subscribed_feeds edge.
	SubscribedFeeds []*Feed `json:"subscribed_feeds,omitempty"`
	// ReadItems holds the value of the read_items edge.
	ReadItems []*Item `json:"read_items,omitempty"`
	// Subscriptions holds the value of the subscriptions edge.
	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
	// Reads holds the value of the reads edge.
	Reads []*Read `json:"reads,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) ReadItemsOrErr

func (e UserEdges) ReadItemsOrErr() ([]*Item, error)

ReadItemsOrErr returns the ReadItems value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ReadsOrErr

func (e UserEdges) ReadsOrErr() ([]*Read, error)

ReadsOrErr returns the Reads value or an error if the edge was not loaded in eager-loading.

func (UserEdges) SubscribedFeedsOrErr

func (e UserEdges) SubscribedFeedsOrErr() ([]*Feed, error)

SubscribedFeedsOrErr returns the SubscribedFeeds value or an error if the edge was not loaded in eager-loading.

func (UserEdges) SubscriptionsOrErr

func (e UserEdges) SubscriptionsOrErr() ([]*Subscription, error)

SubscriptionsOrErr returns the Subscriptions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) TokensOrErr

func (e UserEdges) TokensOrErr() ([]*Token, error)

TokensOrErr returns the Tokens value or an error if the edge was not loaded in eager-loading.

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 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) AddReadIDs

func (m *UserMutation) AddReadIDs(ids ...uuid.UUID)

AddReadIDs adds the "reads" edge to the Read entity by ids.

func (*UserMutation) AddReadItemIDs

func (m *UserMutation) AddReadItemIDs(ids ...uuid.UUID)

AddReadItemIDs adds the "read_items" edge to the Item entity by ids.

func (*UserMutation) AddSubscribedFeedIDs

func (m *UserMutation) AddSubscribedFeedIDs(ids ...uuid.UUID)

AddSubscribedFeedIDs adds the "subscribed_feeds" edge to the Feed entity by ids.

func (*UserMutation) AddSubscriptionIDs

func (m *UserMutation) AddSubscriptionIDs(ids ...uuid.UUID)

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by ids.

func (*UserMutation) AddTokenIDs

func (m *UserMutation) AddTokenIDs(ids ...uuid.UUID)

AddTokenIDs adds the "tokens" edge to the Token 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) ClearDeletedAt

func (m *UserMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

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) ClearReadItems

func (m *UserMutation) ClearReadItems()

ClearReadItems clears the "read_items" edge to the Item entity.

func (*UserMutation) ClearReads

func (m *UserMutation) ClearReads()

ClearReads clears the "reads" edge to the Read entity.

func (*UserMutation) ClearSubscribedFeeds

func (m *UserMutation) ClearSubscribedFeeds()

ClearSubscribedFeeds clears the "subscribed_feeds" edge to the Feed entity.

func (*UserMutation) ClearSubscriptions

func (m *UserMutation) ClearSubscriptions()

ClearSubscriptions clears the "subscriptions" edge to the Subscription entity.

func (*UserMutation) ClearTokens

func (m *UserMutation) ClearTokens()

ClearTokens clears the "tokens" edge to the Token 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) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DeletedAt

func (m *UserMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UserMutation) DeletedAtCleared

func (m *UserMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

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) ID

func (m *UserMutation) 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 (*UserMutation) IDs

func (m *UserMutation) 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 (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" 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) OldDeletedAt

func (m *UserMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" 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) 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) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" 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) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)

OldRole returns the old "role" 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) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" 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) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" 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) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) ReadItemsCleared

func (m *UserMutation) ReadItemsCleared() bool

ReadItemsCleared reports if the "read_items" edge to the Item entity was cleared.

func (*UserMutation) ReadItemsIDs

func (m *UserMutation) ReadItemsIDs() (ids []uuid.UUID)

ReadItemsIDs returns the "read_items" edge IDs in the mutation.

func (*UserMutation) ReadsCleared

func (m *UserMutation) ReadsCleared() bool

ReadsCleared reports if the "reads" edge to the Read entity was cleared.

func (*UserMutation) ReadsIDs

func (m *UserMutation) ReadsIDs() (ids []uuid.UUID)

ReadsIDs returns the "reads" edge IDs in the mutation.

func (*UserMutation) RemoveReadIDs

func (m *UserMutation) RemoveReadIDs(ids ...uuid.UUID)

RemoveReadIDs removes the "reads" edge to the Read entity by IDs.

func (*UserMutation) RemoveReadItemIDs

func (m *UserMutation) RemoveReadItemIDs(ids ...uuid.UUID)

RemoveReadItemIDs removes the "read_items" edge to the Item entity by IDs.

func (*UserMutation) RemoveSubscribedFeedIDs

func (m *UserMutation) RemoveSubscribedFeedIDs(ids ...uuid.UUID)

RemoveSubscribedFeedIDs removes the "subscribed_feeds" edge to the Feed entity by IDs.

func (*UserMutation) RemoveSubscriptionIDs

func (m *UserMutation) RemoveSubscriptionIDs(ids ...uuid.UUID)

RemoveSubscriptionIDs removes the "subscriptions" edge to the Subscription entity by IDs.

func (*UserMutation) RemoveTokenIDs

func (m *UserMutation) RemoveTokenIDs(ids ...uuid.UUID)

RemoveTokenIDs removes the "tokens" edge to the Token entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

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) RemovedReadItemsIDs

func (m *UserMutation) RemovedReadItemsIDs() (ids []uuid.UUID)

RemovedReadItems returns the removed IDs of the "read_items" edge to the Item entity.

func (*UserMutation) RemovedReadsIDs

func (m *UserMutation) RemovedReadsIDs() (ids []uuid.UUID)

RemovedReads returns the removed IDs of the "reads" edge to the Read entity.

func (*UserMutation) RemovedSubscribedFeedsIDs

func (m *UserMutation) RemovedSubscribedFeedsIDs() (ids []uuid.UUID)

RemovedSubscribedFeeds returns the removed IDs of the "subscribed_feeds" edge to the Feed entity.

func (*UserMutation) RemovedSubscriptionsIDs

func (m *UserMutation) RemovedSubscriptionsIDs() (ids []uuid.UUID)

RemovedSubscriptions returns the removed IDs of the "subscriptions" edge to the Subscription entity.

func (*UserMutation) RemovedTokensIDs

func (m *UserMutation) RemovedTokensIDs() (ids []uuid.UUID)

RemovedTokens returns the removed IDs of the "tokens" edge to the Token entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDeletedAt

func (m *UserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

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) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetReadItems

func (m *UserMutation) ResetReadItems()

ResetReadItems resets all changes to the "read_items" edge.

func (*UserMutation) ResetReads

func (m *UserMutation) ResetReads()

ResetReads resets all changes to the "reads" edge.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetSubscribedFeeds

func (m *UserMutation) ResetSubscribedFeeds()

ResetSubscribedFeeds resets all changes to the "subscribed_feeds" edge.

func (*UserMutation) ResetSubscriptions

func (m *UserMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*UserMutation) ResetTokens

func (m *UserMutation) ResetTokens()

ResetTokens resets all changes to the "tokens" edge.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r string, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDeletedAt

func (m *UserMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

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) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(s string)

SetRole sets the "role" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UserMutation) SubscribedFeedsCleared

func (m *UserMutation) SubscribedFeedsCleared() bool

SubscribedFeedsCleared reports if the "subscribed_feeds" edge to the Feed entity was cleared.

func (*UserMutation) SubscribedFeedsIDs

func (m *UserMutation) SubscribedFeedsIDs() (ids []uuid.UUID)

SubscribedFeedsIDs returns the "subscribed_feeds" edge IDs in the mutation.

func (*UserMutation) SubscriptionsCleared

func (m *UserMutation) SubscriptionsCleared() bool

SubscriptionsCleared reports if the "subscriptions" edge to the Subscription entity was cleared.

func (*UserMutation) SubscriptionsIDs

func (m *UserMutation) SubscriptionsIDs() (ids []uuid.UUID)

SubscriptionsIDs returns the "subscriptions" edge IDs in the mutation.

func (*UserMutation) TokensCleared

func (m *UserMutation) TokensCleared() bool

TokensCleared reports if the "tokens" edge to the Token entity was cleared.

func (*UserMutation) TokensIDs

func (m *UserMutation) TokensIDs() (ids []uuid.UUID)

TokensIDs returns the "tokens" 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) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field 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 uuid.UUID, 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) uuid.UUID

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 {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

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 uuid.UUID, 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) uuid.UUID

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) QueryReadItems

func (uq *UserQuery) QueryReadItems() *ItemQuery

QueryReadItems chains the current query on the "read_items" edge.

func (*UserQuery) QueryReads

func (uq *UserQuery) QueryReads() *ReadQuery

QueryReads chains the current query on the "reads" edge.

func (*UserQuery) QuerySubscribedFeeds

func (uq *UserQuery) QuerySubscribedFeeds() *FeedQuery

QuerySubscribedFeeds chains the current query on the "subscribed_feeds" edge.

func (*UserQuery) QuerySubscriptions

func (uq *UserQuery) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions chains the current query on the "subscriptions" edge.

func (*UserQuery) QueryTokens

func (uq *UserQuery) QueryTokens() *TokenQuery

QueryTokens chains the current query on the "tokens" 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 {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	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) WithReadItems

func (uq *UserQuery) WithReadItems(opts ...func(*ItemQuery)) *UserQuery

WithReadItems tells the query-builder to eager-load the nodes that are connected to the "read_items" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithReads

func (uq *UserQuery) WithReads(opts ...func(*ReadQuery)) *UserQuery

WithReads tells the query-builder to eager-load the nodes that are connected to the "reads" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSubscribedFeeds

func (uq *UserQuery) WithSubscribedFeeds(opts ...func(*FeedQuery)) *UserQuery

WithSubscribedFeeds tells the query-builder to eager-load the nodes that are connected to the "subscribed_feeds" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSubscriptions

func (uq *UserQuery) WithSubscriptions(opts ...func(*SubscriptionQuery)) *UserQuery

WithSubscriptions tells the query-builder to eager-load the nodes that are connected to the "subscriptions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithTokens

func (uq *UserQuery) WithTokens(opts ...func(*TokenQuery)) *UserQuery

WithTokens tells the query-builder to eager-load the nodes that are connected to the "tokens" 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 UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddReadIDs

func (uu *UserUpdate) AddReadIDs(ids ...uuid.UUID) *UserUpdate

AddReadIDs adds the "reads" edge to the Read entity by IDs.

func (*UserUpdate) AddReadItemIDs

func (uu *UserUpdate) AddReadItemIDs(ids ...uuid.UUID) *UserUpdate

AddReadItemIDs adds the "read_items" edge to the Item entity by IDs.

func (*UserUpdate) AddReadItems

func (uu *UserUpdate) AddReadItems(i ...*Item) *UserUpdate

AddReadItems adds the "read_items" edges to the Item entity.

func (*UserUpdate) AddReads

func (uu *UserUpdate) AddReads(r ...*Read) *UserUpdate

AddReads adds the "reads" edges to the Read entity.

func (*UserUpdate) AddSubscribedFeedIDs

func (uu *UserUpdate) AddSubscribedFeedIDs(ids ...uuid.UUID) *UserUpdate

AddSubscribedFeedIDs adds the "subscribed_feeds" edge to the Feed entity by IDs.

func (*UserUpdate) AddSubscribedFeeds

func (uu *UserUpdate) AddSubscribedFeeds(f ...*Feed) *UserUpdate

AddSubscribedFeeds adds the "subscribed_feeds" edges to the Feed entity.

func (*UserUpdate) AddSubscriptionIDs

func (uu *UserUpdate) AddSubscriptionIDs(ids ...uuid.UUID) *UserUpdate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*UserUpdate) AddSubscriptions

func (uu *UserUpdate) AddSubscriptions(s ...*Subscription) *UserUpdate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*UserUpdate) AddTokenIDs

func (uu *UserUpdate) AddTokenIDs(ids ...uuid.UUID) *UserUpdate

AddTokenIDs adds the "tokens" edge to the Token entity by IDs.

func (*UserUpdate) AddTokens

func (uu *UserUpdate) AddTokens(t ...*Token) *UserUpdate

AddTokens adds the "tokens" edges to the Token entity.

func (*UserUpdate) ClearDeletedAt

func (uu *UserUpdate) ClearDeletedAt() *UserUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdate) ClearReadItems

func (uu *UserUpdate) ClearReadItems() *UserUpdate

ClearReadItems clears all "read_items" edges to the Item entity.

func (*UserUpdate) ClearReads

func (uu *UserUpdate) ClearReads() *UserUpdate

ClearReads clears all "reads" edges to the Read entity.

func (*UserUpdate) ClearSubscribedFeeds

func (uu *UserUpdate) ClearSubscribedFeeds() *UserUpdate

ClearSubscribedFeeds clears all "subscribed_feeds" edges to the Feed entity.

func (*UserUpdate) ClearSubscriptions

func (uu *UserUpdate) ClearSubscriptions() *UserUpdate

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*UserUpdate) ClearTokens

func (uu *UserUpdate) ClearTokens() *UserUpdate

ClearTokens clears all "tokens" edges to the Token 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) RemoveReadIDs

func (uu *UserUpdate) RemoveReadIDs(ids ...uuid.UUID) *UserUpdate

RemoveReadIDs removes the "reads" edge to Read entities by IDs.

func (*UserUpdate) RemoveReadItemIDs

func (uu *UserUpdate) RemoveReadItemIDs(ids ...uuid.UUID) *UserUpdate

RemoveReadItemIDs removes the "read_items" edge to Item entities by IDs.

func (*UserUpdate) RemoveReadItems

func (uu *UserUpdate) RemoveReadItems(i ...*Item) *UserUpdate

RemoveReadItems removes "read_items" edges to Item entities.

func (*UserUpdate) RemoveReads

func (uu *UserUpdate) RemoveReads(r ...*Read) *UserUpdate

RemoveReads removes "reads" edges to Read entities.

func (*UserUpdate) RemoveSubscribedFeedIDs

func (uu *UserUpdate) RemoveSubscribedFeedIDs(ids ...uuid.UUID) *UserUpdate

RemoveSubscribedFeedIDs removes the "subscribed_feeds" edge to Feed entities by IDs.

func (*UserUpdate) RemoveSubscribedFeeds

func (uu *UserUpdate) RemoveSubscribedFeeds(f ...*Feed) *UserUpdate

RemoveSubscribedFeeds removes "subscribed_feeds" edges to Feed entities.

func (*UserUpdate) RemoveSubscriptionIDs

func (uu *UserUpdate) RemoveSubscriptionIDs(ids ...uuid.UUID) *UserUpdate

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*UserUpdate) RemoveSubscriptions

func (uu *UserUpdate) RemoveSubscriptions(s ...*Subscription) *UserUpdate

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*UserUpdate) RemoveTokenIDs

func (uu *UserUpdate) RemoveTokenIDs(ids ...uuid.UUID) *UserUpdate

RemoveTokenIDs removes the "tokens" edge to Token entities by IDs.

func (*UserUpdate) RemoveTokens

func (uu *UserUpdate) RemoveTokens(t ...*Token) *UserUpdate

RemoveTokens removes "tokens" edges to Token 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) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetDeletedAt

func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdate) SetNillableDeletedAt

func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserUpdate) SetNillableRole

func (uu *UserUpdate) SetNillableRole(s *string) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(s string) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

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) AddReadIDs

func (uuo *UserUpdateOne) AddReadIDs(ids ...uuid.UUID) *UserUpdateOne

AddReadIDs adds the "reads" edge to the Read entity by IDs.

func (*UserUpdateOne) AddReadItemIDs

func (uuo *UserUpdateOne) AddReadItemIDs(ids ...uuid.UUID) *UserUpdateOne

AddReadItemIDs adds the "read_items" edge to the Item entity by IDs.

func (*UserUpdateOne) AddReadItems

func (uuo *UserUpdateOne) AddReadItems(i ...*Item) *UserUpdateOne

AddReadItems adds the "read_items" edges to the Item entity.

func (*UserUpdateOne) AddReads

func (uuo *UserUpdateOne) AddReads(r ...*Read) *UserUpdateOne

AddReads adds the "reads" edges to the Read entity.

func (*UserUpdateOne) AddSubscribedFeedIDs

func (uuo *UserUpdateOne) AddSubscribedFeedIDs(ids ...uuid.UUID) *UserUpdateOne

AddSubscribedFeedIDs adds the "subscribed_feeds" edge to the Feed entity by IDs.

func (*UserUpdateOne) AddSubscribedFeeds

func (uuo *UserUpdateOne) AddSubscribedFeeds(f ...*Feed) *UserUpdateOne

AddSubscribedFeeds adds the "subscribed_feeds" edges to the Feed entity.

func (*UserUpdateOne) AddSubscriptionIDs

func (uuo *UserUpdateOne) AddSubscriptionIDs(ids ...uuid.UUID) *UserUpdateOne

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*UserUpdateOne) AddSubscriptions

func (uuo *UserUpdateOne) AddSubscriptions(s ...*Subscription) *UserUpdateOne

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*UserUpdateOne) AddTokenIDs

func (uuo *UserUpdateOne) AddTokenIDs(ids ...uuid.UUID) *UserUpdateOne

AddTokenIDs adds the "tokens" edge to the Token entity by IDs.

func (*UserUpdateOne) AddTokens

func (uuo *UserUpdateOne) AddTokens(t ...*Token) *UserUpdateOne

AddTokens adds the "tokens" edges to the Token entity.

func (*UserUpdateOne) ClearDeletedAt

func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdateOne) ClearReadItems

func (uuo *UserUpdateOne) ClearReadItems() *UserUpdateOne

ClearReadItems clears all "read_items" edges to the Item entity.

func (*UserUpdateOne) ClearReads

func (uuo *UserUpdateOne) ClearReads() *UserUpdateOne

ClearReads clears all "reads" edges to the Read entity.

func (*UserUpdateOne) ClearSubscribedFeeds

func (uuo *UserUpdateOne) ClearSubscribedFeeds() *UserUpdateOne

ClearSubscribedFeeds clears all "subscribed_feeds" edges to the Feed entity.

func (*UserUpdateOne) ClearSubscriptions

func (uuo *UserUpdateOne) ClearSubscriptions() *UserUpdateOne

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*UserUpdateOne) ClearTokens

func (uuo *UserUpdateOne) ClearTokens() *UserUpdateOne

ClearTokens clears all "tokens" edges to the Token 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) RemoveReadIDs

func (uuo *UserUpdateOne) RemoveReadIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveReadIDs removes the "reads" edge to Read entities by IDs.

func (*UserUpdateOne) RemoveReadItemIDs

func (uuo *UserUpdateOne) RemoveReadItemIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveReadItemIDs removes the "read_items" edge to Item entities by IDs.

func (*UserUpdateOne) RemoveReadItems

func (uuo *UserUpdateOne) RemoveReadItems(i ...*Item) *UserUpdateOne

RemoveReadItems removes "read_items" edges to Item entities.

func (*UserUpdateOne) RemoveReads

func (uuo *UserUpdateOne) RemoveReads(r ...*Read) *UserUpdateOne

RemoveReads removes "reads" edges to Read entities.

func (*UserUpdateOne) RemoveSubscribedFeedIDs

func (uuo *UserUpdateOne) RemoveSubscribedFeedIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveSubscribedFeedIDs removes the "subscribed_feeds" edge to Feed entities by IDs.

func (*UserUpdateOne) RemoveSubscribedFeeds

func (uuo *UserUpdateOne) RemoveSubscribedFeeds(f ...*Feed) *UserUpdateOne

RemoveSubscribedFeeds removes "subscribed_feeds" edges to Feed entities.

func (*UserUpdateOne) RemoveSubscriptionIDs

func (uuo *UserUpdateOne) RemoveSubscriptionIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*UserUpdateOne) RemoveSubscriptions

func (uuo *UserUpdateOne) RemoveSubscriptions(s ...*Subscription) *UserUpdateOne

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*UserUpdateOne) RemoveTokenIDs

func (uuo *UserUpdateOne) RemoveTokenIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveTokenIDs removes the "tokens" edge to Token entities by IDs.

func (*UserUpdateOne) RemoveTokens

func (uuo *UserUpdateOne) RemoveTokens(t ...*Token) *UserUpdateOne

RemoveTokens removes "tokens" edges to Token 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) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetDeletedAt

func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDeletedAt

func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRole

func (uuo *UserUpdateOne) SetNillableRole(s *string) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(s string) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) ClearDeletedAt

func (u *UserUpsert) ClearDeletedAt() *UserUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsert) SetCreatedAt

func (u *UserUpsert) SetCreatedAt(v time.Time) *UserUpsert

SetCreatedAt sets the "created_at" field.

func (*UserUpsert) SetDeletedAt

func (u *UserUpsert) SetDeletedAt(v time.Time) *UserUpsert

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsert) SetPassword

func (u *UserUpsert) SetPassword(v string) *UserUpsert

SetPassword sets the "password" field.

func (*UserUpsert) SetRole

func (u *UserUpsert) SetRole(v string) *UserUpsert

SetRole sets the "role" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) SetUsername

func (u *UserUpsert) SetUsername(v string) *UserUpsert

SetUsername sets the "username" field.

func (*UserUpsert) UpdateCreatedAt

func (u *UserUpsert) UpdateCreatedAt() *UserUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsert) UpdateDeletedAt

func (u *UserUpsert) UpdateDeletedAt() *UserUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsert) UpdatePassword

func (u *UserUpsert) UpdatePassword() *UserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsert) UpdateRole

func (u *UserUpsert) UpdateRole() *UserUpsert

UpdateRole sets the "role" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsert) UpdateUsername

func (u *UserUpsert) UpdateUsername() *UserUpsert

UpdateUsername sets the "username" 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) ClearDeletedAt

func (u *UserUpsertBulk) ClearDeletedAt() *UserUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

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) SetCreatedAt

func (u *UserUpsertBulk) SetCreatedAt(v time.Time) *UserUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*UserUpsertBulk) SetDeletedAt

func (u *UserUpsertBulk) SetDeletedAt(v time.Time) *UserUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsertBulk) SetPassword

func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk

SetPassword sets the "password" field.

func (*UserUpsertBulk) SetRole

func (u *UserUpsertBulk) SetRole(v string) *UserUpsertBulk

SetRole sets the "role" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) SetUsername

func (u *UserUpsertBulk) SetUsername(v string) *UserUpsertBulk

SetUsername sets the "username" 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) UpdateCreatedAt

func (u *UserUpsertBulk) UpdateCreatedAt() *UserUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateDeletedAt

func (u *UserUpsertBulk) UpdateDeletedAt() *UserUpsertBulk

UpdateDeletedAt sets the "deleted_at" 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(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdatePassword

func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateRole

func (u *UserUpsertBulk) UpdateRole() *UserUpsertBulk

UpdateRole sets the "role" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUsername

func (u *UserUpsertBulk) UpdateUsername() *UserUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) ClearDeletedAt

func (u *UserUpsertOne) ClearDeletedAt() *UserUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

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 uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID

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) SetCreatedAt

func (u *UserUpsertOne) SetCreatedAt(v time.Time) *UserUpsertOne

SetCreatedAt sets the "created_at" field.

func (*UserUpsertOne) SetDeletedAt

func (u *UserUpsertOne) SetDeletedAt(v time.Time) *UserUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsertOne) SetPassword

func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne

SetPassword sets the "password" field.

func (*UserUpsertOne) SetRole

func (u *UserUpsertOne) SetRole(v string) *UserUpsertOne

SetRole sets the "role" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) SetUsername

func (u *UserUpsertOne) SetUsername(v string) *UserUpsertOne

SetUsername sets the "username" 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) UpdateCreatedAt

func (u *UserUpsertOne) UpdateCreatedAt() *UserUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateDeletedAt

func (u *UserUpsertOne) UpdateDeletedAt() *UserUpsertOne

UpdateDeletedAt sets the "deleted_at" 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 except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdatePassword

func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertOne) UpdateRole

func (u *UserUpsertOne) UpdateRole() *UserUpsertOne

UpdateRole sets the "role" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUsername

func (u *UserUpsertOne) UpdateUsername() *UserUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL