generated

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 25 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.
	TypeComment                  = "Comment"
	TypeNode                     = "Node"
	TypeSubscription             = "Subscription"
	TypeSubscriptionNotification = "SubscriptionNotification"
	TypeSubscriptionSettings     = "SubscriptionSettings"
	TypeSubscriptionUserSettings = "SubscriptionUserSettings"
	TypeTerm                     = "Term"
	TypeUser                     = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// SubscriptionNotification is the client for interacting with the SubscriptionNotification builders.
	SubscriptionNotification *SubscriptionNotificationClient
	// SubscriptionSettings is the client for interacting with the SubscriptionSettings builders.
	SubscriptionSettings *SubscriptionSettingsClient
	// SubscriptionUserSettings is the client for interacting with the SubscriptionUserSettings builders.
	SubscriptionUserSettings *SubscriptionUserSettingsClient
	// Term is the client for interacting with the Term builders.
	Term *TermClient
	// 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().
	Comment.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

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

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type Comment

type Comment struct {

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

Comment is the model entity for the Comment schema.

func (*Comment) String

func (_m *Comment) String() string

String implements the fmt.Stringer.

func (*Comment) Unwrap

func (_m *Comment) Unwrap() *Comment

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

func (_m *Comment) Update() *CommentUpdateOne

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

func (*Comment) Value

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

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

type CommentClient

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

CommentClient is a client for the Comment schema.

func NewCommentClient

func NewCommentClient(c config) *CommentClient

NewCommentClient returns a client for the Comment from the given config.

func (*CommentClient) Create

func (c *CommentClient) Create() *CommentCreate

Create returns a builder for creating a Comment entity.

func (*CommentClient) CreateBulk

func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk

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

func (*CommentClient) Delete

func (c *CommentClient) Delete() *CommentDelete

Delete returns a delete builder for Comment.

func (*CommentClient) DeleteOne

func (c *CommentClient) DeleteOne(_m *Comment) *CommentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommentClient) DeleteOneID

func (c *CommentClient) DeleteOneID(id int) *CommentDeleteOne

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

func (*CommentClient) Get

func (c *CommentClient) Get(ctx context.Context, id int) (*Comment, error)

Get returns a Comment entity by its id.

func (*CommentClient) GetX

func (c *CommentClient) GetX(ctx context.Context, id int) *Comment

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

func (*CommentClient) Hooks

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

Hooks returns the client hooks.

func (*CommentClient) Intercept

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

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

func (*CommentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CommentClient) MapCreateBulk

func (c *CommentClient) MapCreateBulk(slice any, setFunc func(*CommentCreate, int)) *CommentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CommentClient) Query

func (c *CommentClient) Query() *CommentQuery

Query returns a query builder for Comment.

func (*CommentClient) Update

func (c *CommentClient) Update() *CommentUpdate

Update returns an update builder for Comment.

func (*CommentClient) UpdateOne

func (c *CommentClient) UpdateOne(_m *Comment) *CommentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommentClient) UpdateOneID

func (c *CommentClient) UpdateOneID(id int) *CommentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommentClient) Use

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

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

type CommentCreate

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

CommentCreate is the builder for creating a Comment entity.

func (*CommentCreate) Exec

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

Exec executes the query.

func (*CommentCreate) ExecX

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

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

func (*CommentCreate) Mutation

func (_c *CommentCreate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentCreate) Save

func (_c *CommentCreate) Save(ctx context.Context) (*Comment, error)

Save creates the Comment in the database.

func (*CommentCreate) SaveX

func (_c *CommentCreate) SaveX(ctx context.Context) *Comment

SaveX calls Save and panics if Save returns an error.

func (*CommentCreate) SetID

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

SetID sets the "id" field.

type CommentCreateBulk

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

CommentCreateBulk is the builder for creating many Comment entities in bulk.

func (*CommentCreateBulk) Exec

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

Exec executes the query.

func (*CommentCreateBulk) ExecX

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

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

func (*CommentCreateBulk) Save

func (_c *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error)

Save creates the Comment entities in the database.

func (*CommentCreateBulk) SaveX

func (_c *CommentCreateBulk) SaveX(ctx context.Context) []*Comment

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

type CommentDelete

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

CommentDelete is the builder for deleting a Comment entity.

func (*CommentDelete) Exec

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

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

func (*CommentDelete) ExecX

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

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

func (*CommentDelete) Where

func (_d *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete

Where appends a list predicates to the CommentDelete builder.

type CommentDeleteOne

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

CommentDeleteOne is the builder for deleting a single Comment entity.

func (*CommentDeleteOne) Exec

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

Exec executes the deletion query.

func (*CommentDeleteOne) ExecX

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

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

func (*CommentDeleteOne) Where

Where appends a list predicates to the CommentDelete builder.

type CommentGroupBy

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

CommentGroupBy is the group-by builder for Comment entities.

func (*CommentGroupBy) Aggregate

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

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

func (*CommentGroupBy) Bool

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

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

func (*CommentGroupBy) BoolX

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

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

func (*CommentGroupBy) Bools

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

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

func (*CommentGroupBy) BoolsX

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

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

func (*CommentGroupBy) Float64

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

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

func (*CommentGroupBy) Float64X

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

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

func (*CommentGroupBy) Float64s

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

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

func (*CommentGroupBy) Float64sX

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

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

func (*CommentGroupBy) Int

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

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

func (*CommentGroupBy) IntX

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

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

func (*CommentGroupBy) Ints

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

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

func (*CommentGroupBy) IntsX

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

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

func (*CommentGroupBy) Scan

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

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

func (*CommentGroupBy) ScanX

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

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

func (*CommentGroupBy) String

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

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

func (*CommentGroupBy) StringX

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

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

func (*CommentGroupBy) Strings

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

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

func (*CommentGroupBy) StringsX

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

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

type CommentMutation

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

CommentMutation represents an operation that mutates the Comment nodes in the graph.

func (*CommentMutation) AddField

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

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

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

func (*CommentMutation) AddedField

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

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

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

func (*CommentMutation) AddedIDs

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

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

func (*CommentMutation) ClearEdge

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

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

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

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

func (*CommentMutation) ClearedFields

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

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

func (CommentMutation) Client

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

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

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

func (*CommentMutation) Field

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

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

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

func (*CommentMutation) Fields

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

func (m *CommentMutation) ID() (id int, exists bool)

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

func (*CommentMutation) IDs

func (m *CommentMutation) IDs(ctx context.Context) ([]int, error)

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

func (*CommentMutation) OldField

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

func (m *CommentMutation) Op() Op

Op returns the operation name.

func (*CommentMutation) RemovedEdges

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

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

func (*CommentMutation) RemovedIDs

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

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

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

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

func (m *CommentMutation) SetID(id int)

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

func (*CommentMutation) SetOp

func (m *CommentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CommentMutation) Tx

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

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

func (*CommentMutation) Type

func (m *CommentMutation) Type() string

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

func (*CommentMutation) Where

func (m *CommentMutation) Where(ps ...predicate.Comment)

Where appends a list predicates to the CommentMutation builder.

func (*CommentMutation) WhereP

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

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

type CommentQuery

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

CommentQuery is the builder for querying Comment entities.

func (*CommentQuery) Aggregate

func (_q *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate returns a CommentSelect configured with the given aggregations.

func (*CommentQuery) All

func (_q *CommentQuery) All(ctx context.Context) ([]*Comment, error)

All executes the query and returns a list of Comments.

func (*CommentQuery) AllX

func (_q *CommentQuery) AllX(ctx context.Context) []*Comment

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

func (*CommentQuery) Clone

func (_q *CommentQuery) Clone() *CommentQuery

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

func (*CommentQuery) Count

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

Count returns the count of the given query.

func (*CommentQuery) CountX

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

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

func (*CommentQuery) Exist

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

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

func (*CommentQuery) ExistX

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

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

func (*CommentQuery) First

func (_q *CommentQuery) First(ctx context.Context) (*Comment, error)

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

func (*CommentQuery) FirstID

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

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

func (*CommentQuery) FirstIDX

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

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

func (*CommentQuery) FirstX

func (_q *CommentQuery) FirstX(ctx context.Context) *Comment

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

func (*CommentQuery) GroupBy

func (_q *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy

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

func (*CommentQuery) IDs

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

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

func (*CommentQuery) IDsX

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

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

func (*CommentQuery) Limit

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

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

func (*CommentQuery) Offset

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

Offset to start from.

func (*CommentQuery) Only

func (_q *CommentQuery) Only(ctx context.Context) (*Comment, error)

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

func (*CommentQuery) OnlyID

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

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

func (*CommentQuery) OnlyIDX

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

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

func (*CommentQuery) OnlyX

func (_q *CommentQuery) OnlyX(ctx context.Context) *Comment

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

func (*CommentQuery) Order

func (_q *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery

Order specifies how the records should be ordered.

func (*CommentQuery) Select

func (_q *CommentQuery) Select(fields ...string) *CommentSelect

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

func (*CommentQuery) Unique

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

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

func (_q *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery

Where adds a new predicate for the CommentQuery builder.

type CommentSelect

type CommentSelect struct {
	*CommentQuery
	// contains filtered or unexported fields
}

CommentSelect is the builder for selecting fields of Comment entities.

func (*CommentSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CommentSelect) Bool

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

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

func (*CommentSelect) BoolX

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

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

func (*CommentSelect) Bools

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

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

func (*CommentSelect) BoolsX

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

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

func (*CommentSelect) Float64

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

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

func (*CommentSelect) Float64X

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

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

func (*CommentSelect) Float64s

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

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

func (*CommentSelect) Float64sX

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

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

func (*CommentSelect) Int

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

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

func (*CommentSelect) IntX

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

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

func (*CommentSelect) Ints

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

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

func (*CommentSelect) IntsX

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

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

func (*CommentSelect) Scan

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

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

func (*CommentSelect) ScanX

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

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

func (*CommentSelect) String

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

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

func (*CommentSelect) StringX

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

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

func (*CommentSelect) Strings

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

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

func (*CommentSelect) StringsX

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

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

type CommentUpdate

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

CommentUpdate is the builder for updating Comment entities.

func (*CommentUpdate) Exec

func (_u *CommentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentUpdate) ExecX

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

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

func (*CommentUpdate) Mutation

func (_u *CommentUpdate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdate) Save

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

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

func (*CommentUpdate) SaveX

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

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

func (*CommentUpdate) Where

func (_u *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate

Where appends a list predicates to the CommentUpdate builder.

type CommentUpdateOne

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

CommentUpdateOne is the builder for updating a single Comment entity.

func (*CommentUpdateOne) Exec

func (_u *CommentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommentUpdateOne) ExecX

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

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

func (*CommentUpdateOne) Mutation

func (_u *CommentUpdateOne) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdateOne) Save

func (_u *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)

Save executes the query and returns the updated Comment entity.

func (*CommentUpdateOne) SaveX

func (_u *CommentUpdateOne) SaveX(ctx context.Context) *Comment

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

func (*CommentUpdateOne) Select

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

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

func (*CommentUpdateOne) Where

Where appends a list predicates to the CommentUpdate builder.

type Comments

type Comments []*Comment

Comments is a parsable slice of Comment.

type CommitFunc

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

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

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

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

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type Node

type Node struct {

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

Node is the model entity for the Node schema.

func (*Node) String

func (_m *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (_m *Node) Unwrap() *Node

Unwrap unwraps the Node entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Node) Update

func (_m *Node) Update() *NodeUpdateOne

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

func (*Node) Value

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

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

type NodeClient

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

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

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

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

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

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

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

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

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

func (*NodeClient) Get

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

Get returns a Node entity by its id.

func (*NodeClient) GetX

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

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

func (*NodeClient) Hooks

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

Hooks returns the client hooks.

func (*NodeClient) Intercept

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

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

func (*NodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

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

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*NodeClient) Query

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

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

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

type NodeCreate

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

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) Exec

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

Exec executes the query.

func (*NodeCreate) ExecX

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

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

func (*NodeCreate) Mutation

func (_c *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) Save

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

Save creates the Node in the database.

func (*NodeCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetID

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

SetID sets the "id" field.

type NodeCreateBulk

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

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

func (*NodeCreateBulk) Exec

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

Exec executes the query.

func (*NodeCreateBulk) ExecX

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

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

func (*NodeCreateBulk) Save

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

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

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

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

type NodeDelete

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

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

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

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

func (*NodeDelete) ExecX

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

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

func (*NodeDelete) Where

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

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

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

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

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

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

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

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

func (*NodeDeleteOne) Where

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

Where appends a list predicates to the NodeDelete builder.

type NodeGroupBy

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

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

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

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

func (*NodeGroupBy) Bool

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

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

func (*NodeGroupBy) BoolX

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

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

func (*NodeGroupBy) Bools

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

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

func (*NodeGroupBy) BoolsX

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

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

func (*NodeGroupBy) Float64

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

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

func (*NodeGroupBy) Float64X

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

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

func (*NodeGroupBy) Float64s

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

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

func (*NodeGroupBy) Float64sX

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

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

func (*NodeGroupBy) Int

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

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

func (*NodeGroupBy) IntX

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

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

func (*NodeGroupBy) Ints

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

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

func (*NodeGroupBy) IntsX

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

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

func (*NodeGroupBy) Scan

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

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

func (*NodeGroupBy) ScanX

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

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

func (*NodeGroupBy) String

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

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

func (*NodeGroupBy) StringX

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

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

func (*NodeGroupBy) Strings

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

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

func (*NodeGroupBy) StringsX

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

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

type NodeMutation

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

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

func (*NodeMutation) AddField

func (m *NodeMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*NodeMutation) AddedEdges

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

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

func (*NodeMutation) AddedField

func (m *NodeMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*NodeMutation) AddedFields

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

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

func (*NodeMutation) AddedIDs

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

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

func (*NodeMutation) ClearEdge

func (m *NodeMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*NodeMutation) ClearField

func (m *NodeMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*NodeMutation) ClearedEdges

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

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

func (*NodeMutation) ClearedFields

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

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

func (NodeMutation) Client

func (m NodeMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*NodeMutation) EdgeCleared

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

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

func (*NodeMutation) Field

func (m *NodeMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*NodeMutation) FieldCleared

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

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

func (*NodeMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*NodeMutation) ID

func (m *NodeMutation) ID() (id int, exists bool)

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

func (*NodeMutation) IDs

func (m *NodeMutation) IDs(ctx context.Context) ([]int, error)

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

func (*NodeMutation) OldField

func (m *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*NodeMutation) Op

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) RemovedEdges

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

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

func (*NodeMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*NodeMutation) ResetEdge

func (m *NodeMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*NodeMutation) ResetField

func (m *NodeMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*NodeMutation) SetField

func (m *NodeMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*NodeMutation) SetID

func (m *NodeMutation) SetID(id int)

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

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (NodeMutation) Tx

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

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

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

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

func (*NodeMutation) Where

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

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

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

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

type NodeQuery

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

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

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

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

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

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

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

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

func (*NodeQuery) Clone

func (_q *NodeQuery) Clone() *NodeQuery

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

func (*NodeQuery) Count

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

Count returns the count of the given query.

func (*NodeQuery) CountX

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

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

func (*NodeQuery) Exist

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

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

func (*NodeQuery) ExistX

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

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

func (*NodeQuery) First

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

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

func (*NodeQuery) FirstID

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

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

func (*NodeQuery) FirstIDX

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

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

func (*NodeQuery) FirstX

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

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

func (*NodeQuery) GroupBy

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

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

func (*NodeQuery) IDs

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

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

func (*NodeQuery) IDsX

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

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

func (*NodeQuery) Limit

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

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

func (*NodeQuery) Offset

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

Offset to start from.

func (*NodeQuery) Only

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

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

func (*NodeQuery) OnlyID

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

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

func (*NodeQuery) OnlyIDX

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

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

func (*NodeQuery) OnlyX

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

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

func (*NodeQuery) Order

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

Order specifies how the records should be ordered.

func (*NodeQuery) Select

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

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

func (*NodeQuery) Unique

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

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*NodeQuery) Where

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

Where adds a new predicate for the NodeQuery builder.

type NodeSelect

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

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

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

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

func (*NodeSelect) BoolX

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

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

func (*NodeSelect) Bools

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

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

func (*NodeSelect) BoolsX

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

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

func (*NodeSelect) Float64

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

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

func (*NodeSelect) Float64X

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

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

func (*NodeSelect) Float64s

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

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

func (*NodeSelect) Float64sX

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

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

func (*NodeSelect) Int

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

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

func (*NodeSelect) IntX

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

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

func (*NodeSelect) Ints

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

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

func (*NodeSelect) IntsX

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

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

func (*NodeSelect) Scan

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

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

func (*NodeSelect) ScanX

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

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

func (*NodeSelect) String

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

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

func (*NodeSelect) StringX

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

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

func (*NodeSelect) Strings

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

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

func (*NodeSelect) StringsX

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

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

type NodeUpdate

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

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) Exec

func (_u *NodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpdate) ExecX

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

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

func (*NodeUpdate) Mutation

func (_u *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) Save

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

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

func (*NodeUpdate) SaveX

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

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

func (*NodeUpdate) Where

func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

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

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) Exec

func (_u *NodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

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

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

func (*NodeUpdateOne) Mutation

func (_u *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) Save

func (_u *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (_u *NodeUpdateOne) SaveX(ctx context.Context) *Node

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

func (*NodeUpdateOne) Select

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

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

func (*NodeUpdateOne) Where

func (_u *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Subscription

type Subscription struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// NodeID holds the value of the "node_id" field.
	NodeID *int `json:"node_id,omitempty"`
	// TermID holds the value of the "term_id" field.
	TermID *int `json:"term_id,omitempty"`
	// Muted holds the value of the "muted" field.
	Muted bool `json:"muted,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,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) QueryNode

func (_m *Subscription) QueryNode() *NodeQuery

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

func (*Subscription) QueryTerm

func (_m *Subscription) QueryTerm() *TermQuery

QueryTerm queries the "term" edge of the Subscription entity.

func (*Subscription) QueryUser

func (_m *Subscription) QueryUser() *UserQuery

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

func (*Subscription) String

func (_m *Subscription) String() string

String implements the fmt.Stringer.

func (*Subscription) Unwrap

func (_m *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 (_m *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.

func (*Subscription) Value

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

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

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 int) *SubscriptionDeleteOne

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

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

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

func (*SubscriptionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SubscriptionClient) MapCreateBulk

func (c *SubscriptionClient) MapCreateBulk(slice any, setFunc func(*SubscriptionCreate, int)) *SubscriptionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SubscriptionClient) Query

Query returns a query builder for Subscription.

func (*SubscriptionClient) QueryNode

func (c *SubscriptionClient) QueryNode(_m *Subscription) *NodeQuery

QueryNode queries the node edge of a Subscription.

func (*SubscriptionClient) QueryTerm

func (c *SubscriptionClient) QueryTerm(_m *Subscription) *TermQuery

QueryTerm queries the term edge of a Subscription.

func (*SubscriptionClient) QueryUser

func (c *SubscriptionClient) QueryUser(_m *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 int) *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 (_c *SubscriptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionCreate) ExecX

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

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

func (*SubscriptionCreate) Mutation

func (_c *SubscriptionCreate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

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 (_c *SubscriptionCreate) SetCreatedAt(v time.Time) *SubscriptionCreate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionCreate) SetID

SetID sets the "id" field.

func (*SubscriptionCreate) SetMuted

func (_c *SubscriptionCreate) SetMuted(v bool) *SubscriptionCreate

SetMuted sets the "muted" field.

func (*SubscriptionCreate) SetNillableMuted

func (_c *SubscriptionCreate) SetNillableMuted(v *bool) *SubscriptionCreate

SetNillableMuted sets the "muted" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableNodeID

func (_c *SubscriptionCreate) SetNillableNodeID(v *int) *SubscriptionCreate

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableTermID

func (_c *SubscriptionCreate) SetNillableTermID(v *int) *SubscriptionCreate

SetNillableTermID sets the "term_id" field if the given value is not nil.

func (*SubscriptionCreate) SetNode

func (_c *SubscriptionCreate) SetNode(v *Node) *SubscriptionCreate

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

func (*SubscriptionCreate) SetNodeID

func (_c *SubscriptionCreate) SetNodeID(v int) *SubscriptionCreate

SetNodeID sets the "node_id" field.

func (*SubscriptionCreate) SetTerm

func (_c *SubscriptionCreate) SetTerm(v *Term) *SubscriptionCreate

SetTerm sets the "term" edge to the Term entity.

func (*SubscriptionCreate) SetTermID

func (_c *SubscriptionCreate) SetTermID(v int) *SubscriptionCreate

SetTermID sets the "term_id" field.

func (*SubscriptionCreate) SetToken

func (_c *SubscriptionCreate) SetToken(v string) *SubscriptionCreate

SetToken sets the "token" field.

func (*SubscriptionCreate) SetUser

func (_c *SubscriptionCreate) SetUser(v *User) *SubscriptionCreate

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

func (*SubscriptionCreate) SetUserID

func (_c *SubscriptionCreate) SetUserID(v int) *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 (_c *SubscriptionCreateBulk) ExecX(ctx context.Context)

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

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 (_d *SubscriptionDelete) Exec(ctx context.Context) (int, error)

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

func (*SubscriptionDelete) ExecX

func (_d *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

Exec executes the deletion query.

func (*SubscriptionDeleteOne) ExecX

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

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

func (*SubscriptionDeleteOne) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionEdges

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

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

func (SubscriptionEdges) NodeOrErr

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

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

func (SubscriptionEdges) TermOrErr

func (e SubscriptionEdges) TermOrErr() (*Term, error)

TermOrErr returns the Term 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 (_g *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 (_g *SubscriptionGroupBy) Scan(ctx context.Context, v any) error

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

func (*SubscriptionGroupBy) ScanX

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

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

func (m *SubscriptionMutation) ClearNode()

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

func (*SubscriptionMutation) ClearNodeID

func (m *SubscriptionMutation) ClearNodeID()

ClearNodeID clears the value of the "node_id" field.

func (*SubscriptionMutation) ClearTerm

func (m *SubscriptionMutation) ClearTerm()

ClearTerm clears the "term" edge to the Term entity.

func (*SubscriptionMutation) ClearTermID

func (m *SubscriptionMutation) ClearTermID()

ClearTermID clears the value of the "term_id" field.

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

func (m *SubscriptionMutation) ID() (id int, exists bool)

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

func (*SubscriptionMutation) IDs

func (m *SubscriptionMutation) IDs(ctx context.Context) ([]int, error)

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

func (*SubscriptionMutation) Muted

func (m *SubscriptionMutation) Muted() (r bool, exists bool)

Muted returns the value of the "muted" field in the mutation.

func (*SubscriptionMutation) NodeCleared

func (m *SubscriptionMutation) NodeCleared() bool

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

func (*SubscriptionMutation) NodeID

func (m *SubscriptionMutation) NodeID() (r int, exists bool)

NodeID returns the value of the "node_id" field in the mutation.

func (*SubscriptionMutation) NodeIDCleared

func (m *SubscriptionMutation) NodeIDCleared() bool

NodeIDCleared returns if the "node_id" field was cleared in this mutation.

func (*SubscriptionMutation) NodeIDs

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

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

func (*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) 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) OldMuted

func (m *SubscriptionMutation) OldMuted(ctx context.Context) (v bool, err error)

OldMuted returns the old "muted" 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) OldNodeID

func (m *SubscriptionMutation) OldNodeID(ctx context.Context) (v *int, err error)

OldNodeID returns the old "node_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) OldTermID

func (m *SubscriptionMutation) OldTermID(ctx context.Context) (v *int, err error)

OldTermID returns the old "term_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) OldToken

func (m *SubscriptionMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" 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 int, 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) 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) ResetMuted

func (m *SubscriptionMutation) ResetMuted()

ResetMuted resets all changes to the "muted" field.

func (*SubscriptionMutation) ResetNode

func (m *SubscriptionMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*SubscriptionMutation) ResetNodeID

func (m *SubscriptionMutation) ResetNodeID()

ResetNodeID resets all changes to the "node_id" field.

func (*SubscriptionMutation) ResetTerm

func (m *SubscriptionMutation) ResetTerm()

ResetTerm resets all changes to the "term" edge.

func (*SubscriptionMutation) ResetTermID

func (m *SubscriptionMutation) ResetTermID()

ResetTermID resets all changes to the "term_id" field.

func (*SubscriptionMutation) ResetToken

func (m *SubscriptionMutation) ResetToken()

ResetToken resets all changes to the "token" 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) 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) SetID

func (m *SubscriptionMutation) SetID(id int)

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

func (*SubscriptionMutation) SetMuted

func (m *SubscriptionMutation) SetMuted(b bool)

SetMuted sets the "muted" field.

func (*SubscriptionMutation) SetNodeID

func (m *SubscriptionMutation) SetNodeID(i int)

SetNodeID sets the "node_id" field.

func (*SubscriptionMutation) SetOp

func (m *SubscriptionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscriptionMutation) SetTermID

func (m *SubscriptionMutation) SetTermID(i int)

SetTermID sets the "term_id" field.

func (*SubscriptionMutation) SetToken

func (m *SubscriptionMutation) SetToken(s string)

SetToken sets the "token" field.

func (*SubscriptionMutation) SetUserID

func (m *SubscriptionMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*SubscriptionMutation) TermCleared

func (m *SubscriptionMutation) TermCleared() bool

TermCleared reports if the "term" edge to the Term entity was cleared.

func (*SubscriptionMutation) TermID

func (m *SubscriptionMutation) TermID() (r int, exists bool)

TermID returns the value of the "term_id" field in the mutation.

func (*SubscriptionMutation) TermIDCleared

func (m *SubscriptionMutation) TermIDCleared() bool

TermIDCleared returns if the "term_id" field was cleared in this mutation.

func (*SubscriptionMutation) TermIDs

func (m *SubscriptionMutation) TermIDs() (ids []int)

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

func (*SubscriptionMutation) Token

func (m *SubscriptionMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

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 int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*SubscriptionMutation) UserIDs

func (m *SubscriptionMutation) UserIDs() (ids []int)

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

func (*SubscriptionMutation) Where

Where appends a list predicates to the SubscriptionMutation builder.

func (*SubscriptionMutation) WhereP

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

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

type SubscriptionNotification

type SubscriptionNotification struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// Kind holds the value of the "kind" field.
	Kind string `json:"kind,omitempty"`
	// NodeID holds the value of the "node_id" field.
	NodeID int `json:"node_id,omitempty"`
	// CommentID holds the value of the "comment_id" field.
	CommentID *int `json:"comment_id,omitempty"`
	// ActorID holds the value of the "actor_id" field.
	ActorID *int `json:"actor_id,omitempty"`
	// TermID holds the value of the "term_id" field.
	TermID *int `json:"term_id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ReadAt holds the value of the "read_at" field.
	ReadAt *time.Time `json:"read_at,omitempty"`
	// MailState holds the value of the "mail_state" field.
	MailState int8 `json:"mail_state,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SubscriptionNotificationQuery when eager-loading is set.
	Edges SubscriptionNotificationEdges `json:"edges"`
	// contains filtered or unexported fields
}

SubscriptionNotification is the model entity for the SubscriptionNotification schema.

func (*SubscriptionNotification) QueryActor

func (_m *SubscriptionNotification) QueryActor() *UserQuery

QueryActor queries the "actor" edge of the SubscriptionNotification entity.

func (*SubscriptionNotification) QueryComment

func (_m *SubscriptionNotification) QueryComment() *CommentQuery

QueryComment queries the "comment" edge of the SubscriptionNotification entity.

func (*SubscriptionNotification) QueryNode

func (_m *SubscriptionNotification) QueryNode() *NodeQuery

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

func (*SubscriptionNotification) QueryTerm

func (_m *SubscriptionNotification) QueryTerm() *TermQuery

QueryTerm queries the "term" edge of the SubscriptionNotification entity.

func (*SubscriptionNotification) QueryUser

func (_m *SubscriptionNotification) QueryUser() *UserQuery

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

func (*SubscriptionNotification) String

func (_m *SubscriptionNotification) String() string

String implements the fmt.Stringer.

func (*SubscriptionNotification) Unwrap

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

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

func (*SubscriptionNotification) Value

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

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

type SubscriptionNotificationClient

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

SubscriptionNotificationClient is a client for the SubscriptionNotification schema.

func NewSubscriptionNotificationClient

func NewSubscriptionNotificationClient(c config) *SubscriptionNotificationClient

NewSubscriptionNotificationClient returns a client for the SubscriptionNotification from the given config.

func (*SubscriptionNotificationClient) Create

Create returns a builder for creating a SubscriptionNotification entity.

func (*SubscriptionNotificationClient) CreateBulk

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

func (*SubscriptionNotificationClient) Delete

Delete returns a delete builder for SubscriptionNotification.

func (*SubscriptionNotificationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionNotificationClient) DeleteOneID

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

func (*SubscriptionNotificationClient) Get

Get returns a SubscriptionNotification entity by its id.

func (*SubscriptionNotificationClient) GetX

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

func (*SubscriptionNotificationClient) Hooks

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

Hooks returns the client hooks.

func (*SubscriptionNotificationClient) Intercept

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

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

func (*SubscriptionNotificationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SubscriptionNotificationClient) MapCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SubscriptionNotificationClient) Query

Query returns a query builder for SubscriptionNotification.

func (*SubscriptionNotificationClient) QueryActor

QueryActor queries the actor edge of a SubscriptionNotification.

func (*SubscriptionNotificationClient) QueryComment

QueryComment queries the comment edge of a SubscriptionNotification.

func (*SubscriptionNotificationClient) QueryNode

QueryNode queries the node edge of a SubscriptionNotification.

func (*SubscriptionNotificationClient) QueryTerm

QueryTerm queries the term edge of a SubscriptionNotification.

func (*SubscriptionNotificationClient) QueryUser

QueryUser queries the user edge of a SubscriptionNotification.

func (*SubscriptionNotificationClient) Update

Update returns an update builder for SubscriptionNotification.

func (*SubscriptionNotificationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionNotificationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*SubscriptionNotificationClient) Use

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

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

type SubscriptionNotificationCreate

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

SubscriptionNotificationCreate is the builder for creating a SubscriptionNotification entity.

func (*SubscriptionNotificationCreate) Exec

Exec executes the query.

func (*SubscriptionNotificationCreate) ExecX

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

func (*SubscriptionNotificationCreate) Mutation

Mutation returns the SubscriptionNotificationMutation object of the builder.

func (*SubscriptionNotificationCreate) Save

Save creates the SubscriptionNotification in the database.

func (*SubscriptionNotificationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionNotificationCreate) SetActor

SetActor sets the "actor" edge to the User entity.

func (*SubscriptionNotificationCreate) SetActorID

SetActorID sets the "actor_id" field.

func (*SubscriptionNotificationCreate) SetComment

SetComment sets the "comment" edge to the Comment entity.

func (*SubscriptionNotificationCreate) SetCommentID

SetCommentID sets the "comment_id" field.

func (*SubscriptionNotificationCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionNotificationCreate) SetID

SetID sets the "id" field.

func (*SubscriptionNotificationCreate) SetKind

SetKind sets the "kind" field.

func (*SubscriptionNotificationCreate) SetMailState

SetMailState sets the "mail_state" field.

func (*SubscriptionNotificationCreate) SetNillableActorID

SetNillableActorID sets the "actor_id" field if the given value is not nil.

func (*SubscriptionNotificationCreate) SetNillableCommentID

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*SubscriptionNotificationCreate) SetNillableMailState

SetNillableMailState sets the "mail_state" field if the given value is not nil.

func (*SubscriptionNotificationCreate) SetNillableReadAt

SetNillableReadAt sets the "read_at" field if the given value is not nil.

func (*SubscriptionNotificationCreate) SetNillableTermID

SetNillableTermID sets the "term_id" field if the given value is not nil.

func (*SubscriptionNotificationCreate) SetNode

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

func (*SubscriptionNotificationCreate) SetNodeID

SetNodeID sets the "node_id" field.

func (*SubscriptionNotificationCreate) SetReadAt

SetReadAt sets the "read_at" field.

func (*SubscriptionNotificationCreate) SetTerm

SetTerm sets the "term" edge to the Term entity.

func (*SubscriptionNotificationCreate) SetTermID

SetTermID sets the "term_id" field.

func (*SubscriptionNotificationCreate) SetUser

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

func (*SubscriptionNotificationCreate) SetUserID

SetUserID sets the "user_id" field.

type SubscriptionNotificationCreateBulk

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

SubscriptionNotificationCreateBulk is the builder for creating many SubscriptionNotification entities in bulk.

func (*SubscriptionNotificationCreateBulk) Exec

Exec executes the query.

func (*SubscriptionNotificationCreateBulk) ExecX

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

func (*SubscriptionNotificationCreateBulk) Save

Save creates the SubscriptionNotification entities in the database.

func (*SubscriptionNotificationCreateBulk) SaveX

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

type SubscriptionNotificationDelete

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

SubscriptionNotificationDelete is the builder for deleting a SubscriptionNotification entity.

func (*SubscriptionNotificationDelete) Exec

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

func (*SubscriptionNotificationDelete) ExecX

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

func (*SubscriptionNotificationDelete) Where

Where appends a list predicates to the SubscriptionNotificationDelete builder.

type SubscriptionNotificationDeleteOne

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

SubscriptionNotificationDeleteOne is the builder for deleting a single SubscriptionNotification entity.

func (*SubscriptionNotificationDeleteOne) Exec

Exec executes the deletion query.

func (*SubscriptionNotificationDeleteOne) ExecX

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

func (*SubscriptionNotificationDeleteOne) Where

Where appends a list predicates to the SubscriptionNotificationDelete builder.

type SubscriptionNotificationEdges

type SubscriptionNotificationEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// Comment holds the value of the comment edge.
	Comment *Comment `json:"comment,omitempty"`
	// Actor holds the value of the actor edge.
	Actor *User `json:"actor,omitempty"`
	// Term holds the value of the term edge.
	Term *Term `json:"term,omitempty"`
	// contains filtered or unexported fields
}

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

func (SubscriptionNotificationEdges) ActorOrErr

func (e SubscriptionNotificationEdges) ActorOrErr() (*User, error)

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

func (SubscriptionNotificationEdges) CommentOrErr

func (e SubscriptionNotificationEdges) CommentOrErr() (*Comment, error)

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

func (SubscriptionNotificationEdges) NodeOrErr

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

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

func (SubscriptionNotificationEdges) TermOrErr

func (e SubscriptionNotificationEdges) TermOrErr() (*Term, error)

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

func (SubscriptionNotificationEdges) UserOrErr

func (e SubscriptionNotificationEdges) 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 SubscriptionNotificationGroupBy

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

SubscriptionNotificationGroupBy is the group-by builder for SubscriptionNotification entities.

func (*SubscriptionNotificationGroupBy) Aggregate

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

func (*SubscriptionNotificationGroupBy) Bool

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

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

func (*SubscriptionNotificationGroupBy) BoolX

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

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

func (*SubscriptionNotificationGroupBy) Bools

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

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

func (*SubscriptionNotificationGroupBy) BoolsX

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

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

func (*SubscriptionNotificationGroupBy) Float64

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

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

func (*SubscriptionNotificationGroupBy) Float64X

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

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

func (*SubscriptionNotificationGroupBy) Float64s

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

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

func (*SubscriptionNotificationGroupBy) Float64sX

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

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

func (*SubscriptionNotificationGroupBy) Int

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

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

func (*SubscriptionNotificationGroupBy) IntX

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

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

func (*SubscriptionNotificationGroupBy) Ints

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

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

func (*SubscriptionNotificationGroupBy) IntsX

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

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

func (*SubscriptionNotificationGroupBy) Scan

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

func (*SubscriptionNotificationGroupBy) ScanX

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

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

func (*SubscriptionNotificationGroupBy) String

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

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

func (*SubscriptionNotificationGroupBy) StringX

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

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

func (*SubscriptionNotificationGroupBy) Strings

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

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

func (*SubscriptionNotificationGroupBy) StringsX

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

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

type SubscriptionNotificationMutation

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

SubscriptionNotificationMutation represents an operation that mutates the SubscriptionNotification nodes in the graph.

func (*SubscriptionNotificationMutation) ActorCleared

func (m *SubscriptionNotificationMutation) ActorCleared() bool

ActorCleared reports if the "actor" edge to the User entity was cleared.

func (*SubscriptionNotificationMutation) ActorID

func (m *SubscriptionNotificationMutation) ActorID() (r int, exists bool)

ActorID returns the value of the "actor_id" field in the mutation.

func (*SubscriptionNotificationMutation) ActorIDCleared

func (m *SubscriptionNotificationMutation) ActorIDCleared() bool

ActorIDCleared returns if the "actor_id" field was cleared in this mutation.

func (*SubscriptionNotificationMutation) ActorIDs

func (m *SubscriptionNotificationMutation) ActorIDs() (ids []int)

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

func (*SubscriptionNotificationMutation) AddField

func (m *SubscriptionNotificationMutation) 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 (*SubscriptionNotificationMutation) AddMailState

func (m *SubscriptionNotificationMutation) AddMailState(i int8)

AddMailState adds i to the "mail_state" field.

func (*SubscriptionNotificationMutation) AddedEdges

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

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

func (*SubscriptionNotificationMutation) AddedField

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

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

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

func (*SubscriptionNotificationMutation) AddedIDs

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

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

func (*SubscriptionNotificationMutation) AddedMailState

func (m *SubscriptionNotificationMutation) AddedMailState() (r int8, exists bool)

AddedMailState returns the value that was added to the "mail_state" field in this mutation.

func (*SubscriptionNotificationMutation) ClearActor

func (m *SubscriptionNotificationMutation) ClearActor()

ClearActor clears the "actor" edge to the User entity.

func (*SubscriptionNotificationMutation) ClearActorID

func (m *SubscriptionNotificationMutation) ClearActorID()

ClearActorID clears the value of the "actor_id" field.

func (*SubscriptionNotificationMutation) ClearComment

func (m *SubscriptionNotificationMutation) ClearComment()

ClearComment clears the "comment" edge to the Comment entity.

func (*SubscriptionNotificationMutation) ClearCommentID

func (m *SubscriptionNotificationMutation) ClearCommentID()

ClearCommentID clears the value of the "comment_id" field.

func (*SubscriptionNotificationMutation) ClearEdge

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

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

func (m *SubscriptionNotificationMutation) ClearNode()

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

func (*SubscriptionNotificationMutation) ClearReadAt

func (m *SubscriptionNotificationMutation) ClearReadAt()

ClearReadAt clears the value of the "read_at" field.

func (*SubscriptionNotificationMutation) ClearTerm

func (m *SubscriptionNotificationMutation) ClearTerm()

ClearTerm clears the "term" edge to the Term entity.

func (*SubscriptionNotificationMutation) ClearTermID

func (m *SubscriptionNotificationMutation) ClearTermID()

ClearTermID clears the value of the "term_id" field.

func (*SubscriptionNotificationMutation) ClearUser

func (m *SubscriptionNotificationMutation) ClearUser()

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

func (*SubscriptionNotificationMutation) ClearedEdges

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

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

func (*SubscriptionNotificationMutation) ClearedFields

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

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

func (SubscriptionNotificationMutation) 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 (*SubscriptionNotificationMutation) CommentCleared

func (m *SubscriptionNotificationMutation) CommentCleared() bool

CommentCleared reports if the "comment" edge to the Comment entity was cleared.

func (*SubscriptionNotificationMutation) CommentID

func (m *SubscriptionNotificationMutation) CommentID() (r int, exists bool)

CommentID returns the value of the "comment_id" field in the mutation.

func (*SubscriptionNotificationMutation) CommentIDCleared

func (m *SubscriptionNotificationMutation) CommentIDCleared() bool

CommentIDCleared returns if the "comment_id" field was cleared in this mutation.

func (*SubscriptionNotificationMutation) CommentIDs

func (m *SubscriptionNotificationMutation) CommentIDs() (ids []int)

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

func (*SubscriptionNotificationMutation) CreatedAt

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

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

func (*SubscriptionNotificationMutation) EdgeCleared

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

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

func (*SubscriptionNotificationMutation) Field

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 (*SubscriptionNotificationMutation) FieldCleared

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

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

func (*SubscriptionNotificationMutation) Fields

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 (*SubscriptionNotificationMutation) ID

func (m *SubscriptionNotificationMutation) ID() (id int, exists bool)

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

func (*SubscriptionNotificationMutation) 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 (*SubscriptionNotificationMutation) Kind

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

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

func (*SubscriptionNotificationMutation) MailState

func (m *SubscriptionNotificationMutation) MailState() (r int8, exists bool)

MailState returns the value of the "mail_state" field in the mutation.

func (*SubscriptionNotificationMutation) NodeCleared

func (m *SubscriptionNotificationMutation) NodeCleared() bool

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

func (*SubscriptionNotificationMutation) NodeID

func (m *SubscriptionNotificationMutation) NodeID() (r int, exists bool)

NodeID returns the value of the "node_id" field in the mutation.

func (*SubscriptionNotificationMutation) NodeIDs

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

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

func (*SubscriptionNotificationMutation) OldActorID

func (m *SubscriptionNotificationMutation) OldActorID(ctx context.Context) (v *int, err error)

OldActorID returns the old "actor_id" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) OldCommentID

func (m *SubscriptionNotificationMutation) OldCommentID(ctx context.Context) (v *int, err error)

OldCommentID returns the old "comment_id" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) OldCreatedAt

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

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

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 (*SubscriptionNotificationMutation) OldKind

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

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

func (m *SubscriptionNotificationMutation) OldMailState(ctx context.Context) (v int8, err error)

OldMailState returns the old "mail_state" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) OldNodeID

func (m *SubscriptionNotificationMutation) OldNodeID(ctx context.Context) (v int, err error)

OldNodeID returns the old "node_id" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) OldReadAt

func (m *SubscriptionNotificationMutation) OldReadAt(ctx context.Context) (v *time.Time, err error)

OldReadAt returns the old "read_at" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) OldTermID

func (m *SubscriptionNotificationMutation) OldTermID(ctx context.Context) (v *int, err error)

OldTermID returns the old "term_id" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) OldUserID

func (m *SubscriptionNotificationMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the SubscriptionNotification entity. If the SubscriptionNotification 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 (*SubscriptionNotificationMutation) Op

Op returns the operation name.

func (*SubscriptionNotificationMutation) ReadAt

func (m *SubscriptionNotificationMutation) ReadAt() (r time.Time, exists bool)

ReadAt returns the value of the "read_at" field in the mutation.

func (*SubscriptionNotificationMutation) ReadAtCleared

func (m *SubscriptionNotificationMutation) ReadAtCleared() bool

ReadAtCleared returns if the "read_at" field was cleared in this mutation.

func (*SubscriptionNotificationMutation) RemovedEdges

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

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

func (*SubscriptionNotificationMutation) RemovedIDs

func (m *SubscriptionNotificationMutation) 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 (*SubscriptionNotificationMutation) ResetActor

func (m *SubscriptionNotificationMutation) ResetActor()

ResetActor resets all changes to the "actor" edge.

func (*SubscriptionNotificationMutation) ResetActorID

func (m *SubscriptionNotificationMutation) ResetActorID()

ResetActorID resets all changes to the "actor_id" field.

func (*SubscriptionNotificationMutation) ResetComment

func (m *SubscriptionNotificationMutation) ResetComment()

ResetComment resets all changes to the "comment" edge.

func (*SubscriptionNotificationMutation) ResetCommentID

func (m *SubscriptionNotificationMutation) ResetCommentID()

ResetCommentID resets all changes to the "comment_id" field.

func (*SubscriptionNotificationMutation) ResetCreatedAt

func (m *SubscriptionNotificationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SubscriptionNotificationMutation) ResetEdge

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

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

func (m *SubscriptionNotificationMutation) ResetKind()

ResetKind resets all changes to the "kind" field.

func (*SubscriptionNotificationMutation) ResetMailState

func (m *SubscriptionNotificationMutation) ResetMailState()

ResetMailState resets all changes to the "mail_state" field.

func (*SubscriptionNotificationMutation) ResetNode

func (m *SubscriptionNotificationMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*SubscriptionNotificationMutation) ResetNodeID

func (m *SubscriptionNotificationMutation) ResetNodeID()

ResetNodeID resets all changes to the "node_id" field.

func (*SubscriptionNotificationMutation) ResetReadAt

func (m *SubscriptionNotificationMutation) ResetReadAt()

ResetReadAt resets all changes to the "read_at" field.

func (*SubscriptionNotificationMutation) ResetTerm

func (m *SubscriptionNotificationMutation) ResetTerm()

ResetTerm resets all changes to the "term" edge.

func (*SubscriptionNotificationMutation) ResetTermID

func (m *SubscriptionNotificationMutation) ResetTermID()

ResetTermID resets all changes to the "term_id" field.

func (*SubscriptionNotificationMutation) ResetUser

func (m *SubscriptionNotificationMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SubscriptionNotificationMutation) ResetUserID

func (m *SubscriptionNotificationMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SubscriptionNotificationMutation) SetActorID

func (m *SubscriptionNotificationMutation) SetActorID(i int)

SetActorID sets the "actor_id" field.

func (*SubscriptionNotificationMutation) SetCommentID

func (m *SubscriptionNotificationMutation) SetCommentID(i int)

SetCommentID sets the "comment_id" field.

func (*SubscriptionNotificationMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SubscriptionNotificationMutation) SetField

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

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

func (*SubscriptionNotificationMutation) SetKind

SetKind sets the "kind" field.

func (*SubscriptionNotificationMutation) SetMailState

func (m *SubscriptionNotificationMutation) SetMailState(i int8)

SetMailState sets the "mail_state" field.

func (*SubscriptionNotificationMutation) SetNodeID

func (m *SubscriptionNotificationMutation) SetNodeID(i int)

SetNodeID sets the "node_id" field.

func (*SubscriptionNotificationMutation) SetOp

func (m *SubscriptionNotificationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscriptionNotificationMutation) SetReadAt

func (m *SubscriptionNotificationMutation) SetReadAt(t time.Time)

SetReadAt sets the "read_at" field.

func (*SubscriptionNotificationMutation) SetTermID

func (m *SubscriptionNotificationMutation) SetTermID(i int)

SetTermID sets the "term_id" field.

func (*SubscriptionNotificationMutation) SetUserID

func (m *SubscriptionNotificationMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*SubscriptionNotificationMutation) TermCleared

func (m *SubscriptionNotificationMutation) TermCleared() bool

TermCleared reports if the "term" edge to the Term entity was cleared.

func (*SubscriptionNotificationMutation) TermID

func (m *SubscriptionNotificationMutation) TermID() (r int, exists bool)

TermID returns the value of the "term_id" field in the mutation.

func (*SubscriptionNotificationMutation) TermIDCleared

func (m *SubscriptionNotificationMutation) TermIDCleared() bool

TermIDCleared returns if the "term_id" field was cleared in this mutation.

func (*SubscriptionNotificationMutation) TermIDs

func (m *SubscriptionNotificationMutation) TermIDs() (ids []int)

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

func (SubscriptionNotificationMutation) Tx

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

func (*SubscriptionNotificationMutation) Type

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

func (*SubscriptionNotificationMutation) UserCleared

func (m *SubscriptionNotificationMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*SubscriptionNotificationMutation) UserID

func (m *SubscriptionNotificationMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*SubscriptionNotificationMutation) UserIDs

func (m *SubscriptionNotificationMutation) UserIDs() (ids []int)

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

func (*SubscriptionNotificationMutation) Where

Where appends a list predicates to the SubscriptionNotificationMutation builder.

func (*SubscriptionNotificationMutation) WhereP

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

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

type SubscriptionNotificationQuery

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

SubscriptionNotificationQuery is the builder for querying SubscriptionNotification entities.

func (*SubscriptionNotificationQuery) Aggregate

Aggregate returns a SubscriptionNotificationSelect configured with the given aggregations.

func (*SubscriptionNotificationQuery) All

All executes the query and returns a list of SubscriptionNotifications.

func (*SubscriptionNotificationQuery) AllX

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

func (*SubscriptionNotificationQuery) Clone

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

func (*SubscriptionNotificationQuery) Count

Count returns the count of the given query.

func (*SubscriptionNotificationQuery) CountX

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

func (*SubscriptionNotificationQuery) Exist

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

func (*SubscriptionNotificationQuery) ExistX

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

func (*SubscriptionNotificationQuery) First

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

func (*SubscriptionNotificationQuery) FirstID

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

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

func (*SubscriptionNotificationQuery) FirstIDX

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

func (*SubscriptionNotificationQuery) FirstX

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

func (*SubscriptionNotificationQuery) GroupBy

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

client.SubscriptionNotification.Query().
	GroupBy(subscriptionnotification.FieldUserID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*SubscriptionNotificationQuery) IDs

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

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

func (*SubscriptionNotificationQuery) IDsX

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

func (*SubscriptionNotificationQuery) Limit

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

func (*SubscriptionNotificationQuery) Offset

Offset to start from.

func (*SubscriptionNotificationQuery) Only

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

func (*SubscriptionNotificationQuery) OnlyID

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

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

func (*SubscriptionNotificationQuery) OnlyIDX

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

func (*SubscriptionNotificationQuery) OnlyX

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

func (*SubscriptionNotificationQuery) Order

Order specifies how the records should be ordered.

func (*SubscriptionNotificationQuery) QueryActor

func (_q *SubscriptionNotificationQuery) QueryActor() *UserQuery

QueryActor chains the current query on the "actor" edge.

func (*SubscriptionNotificationQuery) QueryComment

func (_q *SubscriptionNotificationQuery) QueryComment() *CommentQuery

QueryComment chains the current query on the "comment" edge.

func (*SubscriptionNotificationQuery) QueryNode

func (_q *SubscriptionNotificationQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*SubscriptionNotificationQuery) QueryTerm

func (_q *SubscriptionNotificationQuery) QueryTerm() *TermQuery

QueryTerm chains the current query on the "term" edge.

func (*SubscriptionNotificationQuery) QueryUser

func (_q *SubscriptionNotificationQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SubscriptionNotificationQuery) Select

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

Example:

var v []struct {
	UserID int `json:"user_id,omitempty"`
}

client.SubscriptionNotification.Query().
	Select(subscriptionnotification.FieldUserID).
	Scan(ctx, &v)

func (*SubscriptionNotificationQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SubscriptionNotificationQuery) Where

Where adds a new predicate for the SubscriptionNotificationQuery builder.

func (*SubscriptionNotificationQuery) WithActor

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

func (*SubscriptionNotificationQuery) WithComment

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

func (*SubscriptionNotificationQuery) WithNode

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

func (*SubscriptionNotificationQuery) WithTerm

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

func (*SubscriptionNotificationQuery) WithUser

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 SubscriptionNotificationSelect

type SubscriptionNotificationSelect struct {
	*SubscriptionNotificationQuery
	// contains filtered or unexported fields
}

SubscriptionNotificationSelect is the builder for selecting fields of SubscriptionNotification entities.

func (*SubscriptionNotificationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*SubscriptionNotificationSelect) Bool

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

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

func (*SubscriptionNotificationSelect) BoolX

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

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

func (*SubscriptionNotificationSelect) Bools

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

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

func (*SubscriptionNotificationSelect) BoolsX

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

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

func (*SubscriptionNotificationSelect) Float64

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

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

func (*SubscriptionNotificationSelect) Float64X

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

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

func (*SubscriptionNotificationSelect) Float64s

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

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

func (*SubscriptionNotificationSelect) Float64sX

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

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

func (*SubscriptionNotificationSelect) Int

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

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

func (*SubscriptionNotificationSelect) IntX

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

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

func (*SubscriptionNotificationSelect) Ints

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

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

func (*SubscriptionNotificationSelect) IntsX

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

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

func (*SubscriptionNotificationSelect) Scan

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

func (*SubscriptionNotificationSelect) ScanX

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

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

func (*SubscriptionNotificationSelect) String

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

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

func (*SubscriptionNotificationSelect) StringX

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

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

func (*SubscriptionNotificationSelect) Strings

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

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

func (*SubscriptionNotificationSelect) StringsX

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

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

type SubscriptionNotificationUpdate

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

SubscriptionNotificationUpdate is the builder for updating SubscriptionNotification entities.

func (*SubscriptionNotificationUpdate) AddMailState

AddMailState adds value to the "mail_state" field.

func (*SubscriptionNotificationUpdate) ClearActor

ClearActor clears the "actor" edge to the User entity.

func (*SubscriptionNotificationUpdate) ClearActorID

ClearActorID clears the value of the "actor_id" field.

func (*SubscriptionNotificationUpdate) ClearComment

ClearComment clears the "comment" edge to the Comment entity.

func (*SubscriptionNotificationUpdate) ClearCommentID

ClearCommentID clears the value of the "comment_id" field.

func (*SubscriptionNotificationUpdate) ClearNode

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

func (*SubscriptionNotificationUpdate) ClearReadAt

ClearReadAt clears the value of the "read_at" field.

func (*SubscriptionNotificationUpdate) ClearTerm

ClearTerm clears the "term" edge to the Term entity.

func (*SubscriptionNotificationUpdate) ClearTermID

ClearTermID clears the value of the "term_id" field.

func (*SubscriptionNotificationUpdate) ClearUser

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

func (*SubscriptionNotificationUpdate) Exec

Exec executes the query.

func (*SubscriptionNotificationUpdate) ExecX

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

func (*SubscriptionNotificationUpdate) Mutation

Mutation returns the SubscriptionNotificationMutation object of the builder.

func (*SubscriptionNotificationUpdate) Save

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

func (*SubscriptionNotificationUpdate) SaveX

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

func (*SubscriptionNotificationUpdate) SetActor

SetActor sets the "actor" edge to the User entity.

func (*SubscriptionNotificationUpdate) SetActorID

SetActorID sets the "actor_id" field.

func (*SubscriptionNotificationUpdate) SetComment

SetComment sets the "comment" edge to the Comment entity.

func (*SubscriptionNotificationUpdate) SetCommentID

SetCommentID sets the "comment_id" field.

func (*SubscriptionNotificationUpdate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionNotificationUpdate) SetKind

SetKind sets the "kind" field.

func (*SubscriptionNotificationUpdate) SetMailState

SetMailState sets the "mail_state" field.

func (*SubscriptionNotificationUpdate) SetNillableActorID

SetNillableActorID sets the "actor_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNillableCommentID

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNillableCreatedAt

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

func (*SubscriptionNotificationUpdate) SetNillableKind

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

func (*SubscriptionNotificationUpdate) SetNillableMailState

SetNillableMailState sets the "mail_state" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNillableNodeID

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNillableReadAt

SetNillableReadAt sets the "read_at" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNillableTermID

SetNillableTermID sets the "term_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdate) SetNode

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

func (*SubscriptionNotificationUpdate) SetNodeID

SetNodeID sets the "node_id" field.

func (*SubscriptionNotificationUpdate) SetReadAt

SetReadAt sets the "read_at" field.

func (*SubscriptionNotificationUpdate) SetTerm

SetTerm sets the "term" edge to the Term entity.

func (*SubscriptionNotificationUpdate) SetTermID

SetTermID sets the "term_id" field.

func (*SubscriptionNotificationUpdate) SetUser

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

func (*SubscriptionNotificationUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionNotificationUpdate) Where

Where appends a list predicates to the SubscriptionNotificationUpdate builder.

type SubscriptionNotificationUpdateOne

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

SubscriptionNotificationUpdateOne is the builder for updating a single SubscriptionNotification entity.

func (*SubscriptionNotificationUpdateOne) AddMailState

AddMailState adds value to the "mail_state" field.

func (*SubscriptionNotificationUpdateOne) ClearActor

ClearActor clears the "actor" edge to the User entity.

func (*SubscriptionNotificationUpdateOne) ClearActorID

ClearActorID clears the value of the "actor_id" field.

func (*SubscriptionNotificationUpdateOne) ClearComment

ClearComment clears the "comment" edge to the Comment entity.

func (*SubscriptionNotificationUpdateOne) ClearCommentID

ClearCommentID clears the value of the "comment_id" field.

func (*SubscriptionNotificationUpdateOne) ClearNode

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

func (*SubscriptionNotificationUpdateOne) ClearReadAt

ClearReadAt clears the value of the "read_at" field.

func (*SubscriptionNotificationUpdateOne) ClearTerm

ClearTerm clears the "term" edge to the Term entity.

func (*SubscriptionNotificationUpdateOne) ClearTermID

ClearTermID clears the value of the "term_id" field.

func (*SubscriptionNotificationUpdateOne) ClearUser

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

func (*SubscriptionNotificationUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionNotificationUpdateOne) ExecX

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

func (*SubscriptionNotificationUpdateOne) Mutation

Mutation returns the SubscriptionNotificationMutation object of the builder.

func (*SubscriptionNotificationUpdateOne) Save

Save executes the query and returns the updated SubscriptionNotification entity.

func (*SubscriptionNotificationUpdateOne) SaveX

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

func (*SubscriptionNotificationUpdateOne) Select

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

func (*SubscriptionNotificationUpdateOne) SetActor

SetActor sets the "actor" edge to the User entity.

func (*SubscriptionNotificationUpdateOne) SetActorID

SetActorID sets the "actor_id" field.

func (*SubscriptionNotificationUpdateOne) SetComment

SetComment sets the "comment" edge to the Comment entity.

func (*SubscriptionNotificationUpdateOne) SetCommentID

SetCommentID sets the "comment_id" field.

func (*SubscriptionNotificationUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionNotificationUpdateOne) SetKind

SetKind sets the "kind" field.

func (*SubscriptionNotificationUpdateOne) SetMailState

SetMailState sets the "mail_state" field.

func (*SubscriptionNotificationUpdateOne) SetNillableActorID

SetNillableActorID sets the "actor_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNillableCommentID

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNillableCreatedAt

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

func (*SubscriptionNotificationUpdateOne) SetNillableKind

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

func (*SubscriptionNotificationUpdateOne) SetNillableMailState

SetNillableMailState sets the "mail_state" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNillableNodeID

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNillableReadAt

SetNillableReadAt sets the "read_at" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNillableTermID

SetNillableTermID sets the "term_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionNotificationUpdateOne) SetNode

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

func (*SubscriptionNotificationUpdateOne) SetNodeID

SetNodeID sets the "node_id" field.

func (*SubscriptionNotificationUpdateOne) SetReadAt

SetReadAt sets the "read_at" field.

func (*SubscriptionNotificationUpdateOne) SetTerm

SetTerm sets the "term" edge to the Term entity.

func (*SubscriptionNotificationUpdateOne) SetTermID

SetTermID sets the "term_id" field.

func (*SubscriptionNotificationUpdateOne) SetUser

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

func (*SubscriptionNotificationUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionNotificationUpdateOne) Where

Where appends a list predicates to the SubscriptionNotificationUpdate builder.

type SubscriptionNotifications

type SubscriptionNotifications []*SubscriptionNotification

SubscriptionNotifications is a parsable slice of SubscriptionNotification.

type SubscriptionQuery

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

SubscriptionQuery is the builder for querying Subscription entities.

func (*SubscriptionQuery) Aggregate

func (_q *SubscriptionQuery) Aggregate(fns ...AggregateFunc) *SubscriptionSelect

Aggregate returns a SubscriptionSelect configured with the given aggregations.

func (*SubscriptionQuery) All

func (_q *SubscriptionQuery) All(ctx context.Context) ([]*Subscription, error)

All executes the query and returns a list of Subscriptions.

func (*SubscriptionQuery) AllX

func (_q *SubscriptionQuery) AllX(ctx context.Context) []*Subscription

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

func (*SubscriptionQuery) Clone

func (_q *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 (_q *SubscriptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionQuery) CountX

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

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

func (*SubscriptionQuery) Exist

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

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

func (*SubscriptionQuery) ExistX

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

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

func (*SubscriptionQuery) First

func (_q *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 (_q *SubscriptionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SubscriptionQuery) FirstIDX

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

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

func (*SubscriptionQuery) FirstX

func (_q *SubscriptionQuery) FirstX(ctx context.Context) *Subscription

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

func (*SubscriptionQuery) GroupBy

func (_q *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 int `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Subscription.Query().
	GroupBy(subscription.FieldUserID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*SubscriptionQuery) IDs

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

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

func (*SubscriptionQuery) IDsX

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

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

func (*SubscriptionQuery) Limit

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

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

func (*SubscriptionQuery) Offset

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

Offset to start from.

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 (_q *SubscriptionQuery) OnlyID(ctx context.Context) (id int, 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 (_q *SubscriptionQuery) OnlyIDX(ctx context.Context) int

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 specifies how the records should be ordered.

func (*SubscriptionQuery) QueryNode

func (_q *SubscriptionQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*SubscriptionQuery) QueryTerm

func (_q *SubscriptionQuery) QueryTerm() *TermQuery

QueryTerm chains the current query on the "term" edge.

func (*SubscriptionQuery) QueryUser

func (_q *SubscriptionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SubscriptionQuery) Select

func (_q *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 int `json:"user_id,omitempty"`
}

client.Subscription.Query().
	Select(subscription.FieldUserID).
	Scan(ctx, &v)

func (*SubscriptionQuery) Unique

func (_q *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) WithNode

func (_q *SubscriptionQuery) WithNode(opts ...func(*NodeQuery)) *SubscriptionQuery

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

func (*SubscriptionQuery) WithTerm

func (_q *SubscriptionQuery) WithTerm(opts ...func(*TermQuery)) *SubscriptionQuery

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

func (*SubscriptionQuery) WithUser

func (_q *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) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

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 (_s *SubscriptionSelect) Scan(ctx context.Context, v any) 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 any)

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 SubscriptionSettings

type SubscriptionSettings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// MailSubject holds the value of the "mail_subject" field.
	MailSubject string `json:"mail_subject,omitempty"`
	// MailBody holds the value of the "mail_body" field.
	MailBody string `json:"mail_body,omitempty"`
	// DigestDay holds the value of the "digest_day" field.
	DigestDay string `json:"digest_day,omitempty"`
	// contains filtered or unexported fields
}

SubscriptionSettings is the model entity for the SubscriptionSettings schema.

func (*SubscriptionSettings) String

func (_m *SubscriptionSettings) String() string

String implements the fmt.Stringer.

func (*SubscriptionSettings) Unwrap

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

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

func (*SubscriptionSettings) Value

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

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

type SubscriptionSettingsClient

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

SubscriptionSettingsClient is a client for the SubscriptionSettings schema.

func NewSubscriptionSettingsClient

func NewSubscriptionSettingsClient(c config) *SubscriptionSettingsClient

NewSubscriptionSettingsClient returns a client for the SubscriptionSettings from the given config.

func (*SubscriptionSettingsClient) Create

Create returns a builder for creating a SubscriptionSettings entity.

func (*SubscriptionSettingsClient) CreateBulk

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

func (*SubscriptionSettingsClient) Delete

Delete returns a delete builder for SubscriptionSettings.

func (*SubscriptionSettingsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionSettingsClient) DeleteOneID

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

func (*SubscriptionSettingsClient) Get

Get returns a SubscriptionSettings entity by its id.

func (*SubscriptionSettingsClient) GetX

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

func (*SubscriptionSettingsClient) Hooks

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

Hooks returns the client hooks.

func (*SubscriptionSettingsClient) Intercept

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

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

func (*SubscriptionSettingsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SubscriptionSettingsClient) MapCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SubscriptionSettingsClient) Query

Query returns a query builder for SubscriptionSettings.

func (*SubscriptionSettingsClient) Update

Update returns an update builder for SubscriptionSettings.

func (*SubscriptionSettingsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionSettingsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*SubscriptionSettingsClient) Use

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

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

type SubscriptionSettingsCreate

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

SubscriptionSettingsCreate is the builder for creating a SubscriptionSettings entity.

func (*SubscriptionSettingsCreate) Exec

Exec executes the query.

func (*SubscriptionSettingsCreate) ExecX

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

func (*SubscriptionSettingsCreate) Mutation

Mutation returns the SubscriptionSettingsMutation object of the builder.

func (*SubscriptionSettingsCreate) Save

Save creates the SubscriptionSettings in the database.

func (*SubscriptionSettingsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionSettingsCreate) SetDigestDay

SetDigestDay sets the "digest_day" field.

func (*SubscriptionSettingsCreate) SetID

SetID sets the "id" field.

func (*SubscriptionSettingsCreate) SetMailBody

SetMailBody sets the "mail_body" field.

func (*SubscriptionSettingsCreate) SetMailSubject

SetMailSubject sets the "mail_subject" field.

func (*SubscriptionSettingsCreate) SetNillableDigestDay

func (_c *SubscriptionSettingsCreate) SetNillableDigestDay(v *string) *SubscriptionSettingsCreate

SetNillableDigestDay sets the "digest_day" field if the given value is not nil.

func (*SubscriptionSettingsCreate) SetNillableMailBody

func (_c *SubscriptionSettingsCreate) SetNillableMailBody(v *string) *SubscriptionSettingsCreate

SetNillableMailBody sets the "mail_body" field if the given value is not nil.

func (*SubscriptionSettingsCreate) SetNillableMailSubject

func (_c *SubscriptionSettingsCreate) SetNillableMailSubject(v *string) *SubscriptionSettingsCreate

SetNillableMailSubject sets the "mail_subject" field if the given value is not nil.

type SubscriptionSettingsCreateBulk

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

SubscriptionSettingsCreateBulk is the builder for creating many SubscriptionSettings entities in bulk.

func (*SubscriptionSettingsCreateBulk) Exec

Exec executes the query.

func (*SubscriptionSettingsCreateBulk) ExecX

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

func (*SubscriptionSettingsCreateBulk) Save

Save creates the SubscriptionSettings entities in the database.

func (*SubscriptionSettingsCreateBulk) SaveX

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

type SubscriptionSettingsDelete

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

SubscriptionSettingsDelete is the builder for deleting a SubscriptionSettings entity.

func (*SubscriptionSettingsDelete) Exec

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

func (*SubscriptionSettingsDelete) ExecX

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

func (*SubscriptionSettingsDelete) Where

Where appends a list predicates to the SubscriptionSettingsDelete builder.

type SubscriptionSettingsDeleteOne

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

SubscriptionSettingsDeleteOne is the builder for deleting a single SubscriptionSettings entity.

func (*SubscriptionSettingsDeleteOne) Exec

Exec executes the deletion query.

func (*SubscriptionSettingsDeleteOne) ExecX

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

func (*SubscriptionSettingsDeleteOne) Where

Where appends a list predicates to the SubscriptionSettingsDelete builder.

type SubscriptionSettingsGroupBy

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

SubscriptionSettingsGroupBy is the group-by builder for SubscriptionSettings entities.

func (*SubscriptionSettingsGroupBy) Aggregate

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

func (*SubscriptionSettingsGroupBy) Bool

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

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

func (*SubscriptionSettingsGroupBy) BoolX

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

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

func (*SubscriptionSettingsGroupBy) Bools

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

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

func (*SubscriptionSettingsGroupBy) BoolsX

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

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

func (*SubscriptionSettingsGroupBy) Float64

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

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

func (*SubscriptionSettingsGroupBy) Float64X

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

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

func (*SubscriptionSettingsGroupBy) Float64s

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

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

func (*SubscriptionSettingsGroupBy) Float64sX

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

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

func (*SubscriptionSettingsGroupBy) Int

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

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

func (*SubscriptionSettingsGroupBy) IntX

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

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

func (*SubscriptionSettingsGroupBy) Ints

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

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

func (*SubscriptionSettingsGroupBy) IntsX

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

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

func (*SubscriptionSettingsGroupBy) Scan

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

func (*SubscriptionSettingsGroupBy) ScanX

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

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

func (*SubscriptionSettingsGroupBy) String

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

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

func (*SubscriptionSettingsGroupBy) StringX

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

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

func (*SubscriptionSettingsGroupBy) Strings

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

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

func (*SubscriptionSettingsGroupBy) StringsX

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

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

type SubscriptionSettingsMutation

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

SubscriptionSettingsMutation represents an operation that mutates the SubscriptionSettings nodes in the graph.

func (*SubscriptionSettingsMutation) AddField

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

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

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

func (*SubscriptionSettingsMutation) AddedField

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

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

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

func (*SubscriptionSettingsMutation) AddedIDs

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

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

func (*SubscriptionSettingsMutation) ClearEdge

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

func (m *SubscriptionSettingsMutation) 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 (*SubscriptionSettingsMutation) ClearMailBody

func (m *SubscriptionSettingsMutation) ClearMailBody()

ClearMailBody clears the value of the "mail_body" field.

func (*SubscriptionSettingsMutation) ClearedEdges

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

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

func (*SubscriptionSettingsMutation) ClearedFields

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

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

func (SubscriptionSettingsMutation) 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 (*SubscriptionSettingsMutation) DigestDay

func (m *SubscriptionSettingsMutation) DigestDay() (r string, exists bool)

DigestDay returns the value of the "digest_day" field in the mutation.

func (*SubscriptionSettingsMutation) EdgeCleared

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

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

func (*SubscriptionSettingsMutation) Field

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

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

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

func (*SubscriptionSettingsMutation) Fields

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

func (m *SubscriptionSettingsMutation) ID() (id int, exists bool)

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

func (*SubscriptionSettingsMutation) 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 (*SubscriptionSettingsMutation) MailBody

func (m *SubscriptionSettingsMutation) MailBody() (r string, exists bool)

MailBody returns the value of the "mail_body" field in the mutation.

func (*SubscriptionSettingsMutation) MailBodyCleared

func (m *SubscriptionSettingsMutation) MailBodyCleared() bool

MailBodyCleared returns if the "mail_body" field was cleared in this mutation.

func (*SubscriptionSettingsMutation) MailSubject

func (m *SubscriptionSettingsMutation) MailSubject() (r string, exists bool)

MailSubject returns the value of the "mail_subject" field in the mutation.

func (*SubscriptionSettingsMutation) OldDigestDay

func (m *SubscriptionSettingsMutation) OldDigestDay(ctx context.Context) (v string, err error)

OldDigestDay returns the old "digest_day" field's value of the SubscriptionSettings entity. If the SubscriptionSettings 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 (*SubscriptionSettingsMutation) OldField

func (m *SubscriptionSettingsMutation) 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 (*SubscriptionSettingsMutation) OldMailBody

func (m *SubscriptionSettingsMutation) OldMailBody(ctx context.Context) (v string, err error)

OldMailBody returns the old "mail_body" field's value of the SubscriptionSettings entity. If the SubscriptionSettings 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 (*SubscriptionSettingsMutation) OldMailSubject

func (m *SubscriptionSettingsMutation) OldMailSubject(ctx context.Context) (v string, err error)

OldMailSubject returns the old "mail_subject" field's value of the SubscriptionSettings entity. If the SubscriptionSettings 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 (*SubscriptionSettingsMutation) Op

Op returns the operation name.

func (*SubscriptionSettingsMutation) RemovedEdges

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

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

func (*SubscriptionSettingsMutation) RemovedIDs

func (m *SubscriptionSettingsMutation) 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 (*SubscriptionSettingsMutation) ResetDigestDay

func (m *SubscriptionSettingsMutation) ResetDigestDay()

ResetDigestDay resets all changes to the "digest_day" field.

func (*SubscriptionSettingsMutation) ResetEdge

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

func (m *SubscriptionSettingsMutation) 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 (*SubscriptionSettingsMutation) ResetMailBody

func (m *SubscriptionSettingsMutation) ResetMailBody()

ResetMailBody resets all changes to the "mail_body" field.

func (*SubscriptionSettingsMutation) ResetMailSubject

func (m *SubscriptionSettingsMutation) ResetMailSubject()

ResetMailSubject resets all changes to the "mail_subject" field.

func (*SubscriptionSettingsMutation) SetDigestDay

func (m *SubscriptionSettingsMutation) SetDigestDay(s string)

SetDigestDay sets the "digest_day" field.

func (*SubscriptionSettingsMutation) SetField

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

func (m *SubscriptionSettingsMutation) SetID(id int)

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

func (*SubscriptionSettingsMutation) SetMailBody

func (m *SubscriptionSettingsMutation) SetMailBody(s string)

SetMailBody sets the "mail_body" field.

func (*SubscriptionSettingsMutation) SetMailSubject

func (m *SubscriptionSettingsMutation) SetMailSubject(s string)

SetMailSubject sets the "mail_subject" field.

func (*SubscriptionSettingsMutation) SetOp

func (m *SubscriptionSettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (SubscriptionSettingsMutation) Tx

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

func (*SubscriptionSettingsMutation) Type

Type returns the node type of this mutation (SubscriptionSettings).

func (*SubscriptionSettingsMutation) Where

Where appends a list predicates to the SubscriptionSettingsMutation builder.

func (*SubscriptionSettingsMutation) WhereP

func (m *SubscriptionSettingsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SubscriptionSettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SubscriptionSettingsQuery

type SubscriptionSettingsQuery struct {
	// contains filtered or unexported fields
}

SubscriptionSettingsQuery is the builder for querying SubscriptionSettings entities.

func (*SubscriptionSettingsQuery) Aggregate

Aggregate returns a SubscriptionSettingsSelect configured with the given aggregations.

func (*SubscriptionSettingsQuery) All

All executes the query and returns a list of SubscriptionSettingsSlice.

func (*SubscriptionSettingsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*SubscriptionSettingsQuery) Clone

Clone returns a duplicate of the SubscriptionSettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SubscriptionSettingsQuery) Count

Count returns the count of the given query.

func (*SubscriptionSettingsQuery) CountX

func (_q *SubscriptionSettingsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SubscriptionSettingsQuery) Exist

Exist returns true if the query has elements in the graph.

func (*SubscriptionSettingsQuery) ExistX

ExistX is like Exist, but panics if an error occurs.

func (*SubscriptionSettingsQuery) First

First returns the first SubscriptionSettings entity from the query. Returns a *NotFoundError when no SubscriptionSettings was found.

func (*SubscriptionSettingsQuery) FirstID

func (_q *SubscriptionSettingsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SubscriptionSettings ID from the query. Returns a *NotFoundError when no SubscriptionSettings ID was found.

func (*SubscriptionSettingsQuery) FirstIDX

func (_q *SubscriptionSettingsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SubscriptionSettingsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*SubscriptionSettingsQuery) GroupBy

func (_q *SubscriptionSettingsQuery) GroupBy(field string, fields ...string) *SubscriptionSettingsGroupBy

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 {
	MailSubject string `json:"mail_subject,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SubscriptionSettings.Query().
	GroupBy(subscriptionsettings.FieldMailSubject).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*SubscriptionSettingsQuery) IDs

func (_q *SubscriptionSettingsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of SubscriptionSettings IDs.

func (*SubscriptionSettingsQuery) IDsX

func (_q *SubscriptionSettingsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SubscriptionSettingsQuery) Limit

Limit the number of records to be returned by this query.

func (*SubscriptionSettingsQuery) Offset

Offset to start from.

func (*SubscriptionSettingsQuery) Only

Only returns a single SubscriptionSettings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SubscriptionSettings entity is found. Returns a *NotFoundError when no SubscriptionSettings entities are found.

func (*SubscriptionSettingsQuery) OnlyID

func (_q *SubscriptionSettingsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SubscriptionSettings ID in the query. Returns a *NotSingularError when more than one SubscriptionSettings ID is found. Returns a *NotFoundError when no entities are found.

func (*SubscriptionSettingsQuery) OnlyIDX

func (_q *SubscriptionSettingsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SubscriptionSettingsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*SubscriptionSettingsQuery) Order

Order specifies how the records should be ordered.

func (*SubscriptionSettingsQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	MailSubject string `json:"mail_subject,omitempty"`
}

client.SubscriptionSettings.Query().
	Select(subscriptionsettings.FieldMailSubject).
	Scan(ctx, &v)

func (*SubscriptionSettingsQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SubscriptionSettingsQuery) Where

Where adds a new predicate for the SubscriptionSettingsQuery builder.

type SubscriptionSettingsSelect

type SubscriptionSettingsSelect struct {
	*SubscriptionSettingsQuery
	// contains filtered or unexported fields
}

SubscriptionSettingsSelect is the builder for selecting fields of SubscriptionSettings entities.

func (*SubscriptionSettingsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*SubscriptionSettingsSelect) Bool

func (s *SubscriptionSettingsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) BoolX

func (s *SubscriptionSettingsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Bools

func (s *SubscriptionSettingsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) BoolsX

func (s *SubscriptionSettingsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Float64

func (s *SubscriptionSettingsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) Float64X

func (s *SubscriptionSettingsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Float64s

func (s *SubscriptionSettingsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) Float64sX

func (s *SubscriptionSettingsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Int

func (s *SubscriptionSettingsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) IntX

func (s *SubscriptionSettingsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Ints

func (s *SubscriptionSettingsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) IntsX

func (s *SubscriptionSettingsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionSettingsSelect) ScanX

func (s *SubscriptionSettingsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionSettingsSelect) String

func (s *SubscriptionSettingsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) StringX

func (s *SubscriptionSettingsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionSettingsSelect) Strings

func (s *SubscriptionSettingsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionSettingsSelect) StringsX

func (s *SubscriptionSettingsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionSettingsSlice

type SubscriptionSettingsSlice []*SubscriptionSettings

SubscriptionSettingsSlice is a parsable slice of SubscriptionSettings.

type SubscriptionSettingsUpdate

type SubscriptionSettingsUpdate struct {
	// contains filtered or unexported fields
}

SubscriptionSettingsUpdate is the builder for updating SubscriptionSettings entities.

func (*SubscriptionSettingsUpdate) ClearMailBody

ClearMailBody clears the value of the "mail_body" field.

func (*SubscriptionSettingsUpdate) Exec

Exec executes the query.

func (*SubscriptionSettingsUpdate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionSettingsUpdate) Mutation

Mutation returns the SubscriptionSettingsMutation object of the builder.

func (*SubscriptionSettingsUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*SubscriptionSettingsUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionSettingsUpdate) SetDigestDay

SetDigestDay sets the "digest_day" field.

func (*SubscriptionSettingsUpdate) SetMailBody

SetMailBody sets the "mail_body" field.

func (*SubscriptionSettingsUpdate) SetMailSubject

SetMailSubject sets the "mail_subject" field.

func (*SubscriptionSettingsUpdate) SetNillableDigestDay

func (_u *SubscriptionSettingsUpdate) SetNillableDigestDay(v *string) *SubscriptionSettingsUpdate

SetNillableDigestDay sets the "digest_day" field if the given value is not nil.

func (*SubscriptionSettingsUpdate) SetNillableMailBody

func (_u *SubscriptionSettingsUpdate) SetNillableMailBody(v *string) *SubscriptionSettingsUpdate

SetNillableMailBody sets the "mail_body" field if the given value is not nil.

func (*SubscriptionSettingsUpdate) SetNillableMailSubject

func (_u *SubscriptionSettingsUpdate) SetNillableMailSubject(v *string) *SubscriptionSettingsUpdate

SetNillableMailSubject sets the "mail_subject" field if the given value is not nil.

func (*SubscriptionSettingsUpdate) Where

Where appends a list predicates to the SubscriptionSettingsUpdate builder.

type SubscriptionSettingsUpdateOne

type SubscriptionSettingsUpdateOne struct {
	// contains filtered or unexported fields
}

SubscriptionSettingsUpdateOne is the builder for updating a single SubscriptionSettings entity.

func (*SubscriptionSettingsUpdateOne) ClearMailBody

ClearMailBody clears the value of the "mail_body" field.

func (*SubscriptionSettingsUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionSettingsUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionSettingsUpdateOne) Mutation

Mutation returns the SubscriptionSettingsMutation object of the builder.

func (*SubscriptionSettingsUpdateOne) Save

Save executes the query and returns the updated SubscriptionSettings entity.

func (*SubscriptionSettingsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionSettingsUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SubscriptionSettingsUpdateOne) SetDigestDay

SetDigestDay sets the "digest_day" field.

func (*SubscriptionSettingsUpdateOne) SetMailBody

SetMailBody sets the "mail_body" field.

func (*SubscriptionSettingsUpdateOne) SetMailSubject

SetMailSubject sets the "mail_subject" field.

func (*SubscriptionSettingsUpdateOne) SetNillableDigestDay

SetNillableDigestDay sets the "digest_day" field if the given value is not nil.

func (*SubscriptionSettingsUpdateOne) SetNillableMailBody

SetNillableMailBody sets the "mail_body" field if the given value is not nil.

func (*SubscriptionSettingsUpdateOne) SetNillableMailSubject

func (_u *SubscriptionSettingsUpdateOne) SetNillableMailSubject(v *string) *SubscriptionSettingsUpdateOne

SetNillableMailSubject sets the "mail_subject" field if the given value is not nil.

func (*SubscriptionSettingsUpdateOne) Where

Where appends a list predicates to the SubscriptionSettingsUpdate builder.

type SubscriptionUpdate

type SubscriptionUpdate struct {
	// contains filtered or unexported fields
}

SubscriptionUpdate is the builder for updating Subscription entities.

func (*SubscriptionUpdate) ClearNode

func (_u *SubscriptionUpdate) ClearNode() *SubscriptionUpdate

ClearNode clears the "node" edge to the Node entity.

func (*SubscriptionUpdate) ClearNodeID

func (_u *SubscriptionUpdate) ClearNodeID() *SubscriptionUpdate

ClearNodeID clears the value of the "node_id" field.

func (*SubscriptionUpdate) ClearTerm

func (_u *SubscriptionUpdate) ClearTerm() *SubscriptionUpdate

ClearTerm clears the "term" edge to the Term entity.

func (*SubscriptionUpdate) ClearTermID

func (_u *SubscriptionUpdate) ClearTermID() *SubscriptionUpdate

ClearTermID clears the value of the "term_id" field.

func (*SubscriptionUpdate) ClearUser

func (_u *SubscriptionUpdate) ClearUser() *SubscriptionUpdate

ClearUser clears the "user" edge to the User entity.

func (*SubscriptionUpdate) Exec

func (_u *SubscriptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionUpdate) ExecX

func (_u *SubscriptionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUpdate) Mutation

func (_u *SubscriptionUpdate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdate) Save

func (_u *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 (_u *SubscriptionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUpdate) SetCreatedAt

func (_u *SubscriptionUpdate) SetCreatedAt(v time.Time) *SubscriptionUpdate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpdate) SetMuted

func (_u *SubscriptionUpdate) SetMuted(v bool) *SubscriptionUpdate

SetMuted sets the "muted" field.

func (*SubscriptionUpdate) SetNillableCreatedAt

func (_u *SubscriptionUpdate) SetNillableCreatedAt(v *time.Time) *SubscriptionUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableMuted

func (_u *SubscriptionUpdate) SetNillableMuted(v *bool) *SubscriptionUpdate

SetNillableMuted sets the "muted" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableNodeID

func (_u *SubscriptionUpdate) SetNillableNodeID(v *int) *SubscriptionUpdate

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableTermID

func (_u *SubscriptionUpdate) SetNillableTermID(v *int) *SubscriptionUpdate

SetNillableTermID sets the "term_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableToken

func (_u *SubscriptionUpdate) SetNillableToken(v *string) *SubscriptionUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableUserID

func (_u *SubscriptionUpdate) SetNillableUserID(v *int) *SubscriptionUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNode

func (_u *SubscriptionUpdate) SetNode(v *Node) *SubscriptionUpdate

SetNode sets the "node" edge to the Node entity.

func (*SubscriptionUpdate) SetNodeID

func (_u *SubscriptionUpdate) SetNodeID(v int) *SubscriptionUpdate

SetNodeID sets the "node_id" field.

func (*SubscriptionUpdate) SetTerm

func (_u *SubscriptionUpdate) SetTerm(v *Term) *SubscriptionUpdate

SetTerm sets the "term" edge to the Term entity.

func (*SubscriptionUpdate) SetTermID

func (_u *SubscriptionUpdate) SetTermID(v int) *SubscriptionUpdate

SetTermID sets the "term_id" field.

func (*SubscriptionUpdate) SetToken

func (_u *SubscriptionUpdate) SetToken(v string) *SubscriptionUpdate

SetToken sets the "token" field.

func (*SubscriptionUpdate) SetUser

func (_u *SubscriptionUpdate) SetUser(v *User) *SubscriptionUpdate

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUpdate) SetUserID

func (_u *SubscriptionUpdate) SetUserID(v int) *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) ClearNode

ClearNode clears the "node" edge to the Node entity.

func (*SubscriptionUpdateOne) ClearNodeID

func (_u *SubscriptionUpdateOne) ClearNodeID() *SubscriptionUpdateOne

ClearNodeID clears the value of the "node_id" field.

func (*SubscriptionUpdateOne) ClearTerm

ClearTerm clears the "term" edge to the Term entity.

func (*SubscriptionUpdateOne) ClearTermID

func (_u *SubscriptionUpdateOne) ClearTermID() *SubscriptionUpdateOne

ClearTermID clears the value of the "term_id" field.

func (*SubscriptionUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*SubscriptionUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionUpdateOne) ExecX

func (_u *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 (_u *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

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpdateOne) SetMuted

SetMuted sets the "muted" field.

func (*SubscriptionUpdateOne) SetNillableCreatedAt

func (_u *SubscriptionUpdateOne) SetNillableCreatedAt(v *time.Time) *SubscriptionUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableMuted

func (_u *SubscriptionUpdateOne) SetNillableMuted(v *bool) *SubscriptionUpdateOne

SetNillableMuted sets the "muted" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableNodeID

func (_u *SubscriptionUpdateOne) SetNillableNodeID(v *int) *SubscriptionUpdateOne

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableTermID

func (_u *SubscriptionUpdateOne) SetNillableTermID(v *int) *SubscriptionUpdateOne

SetNillableTermID sets the "term_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableToken

func (_u *SubscriptionUpdateOne) SetNillableToken(v *string) *SubscriptionUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableUserID

func (_u *SubscriptionUpdateOne) SetNillableUserID(v *int) *SubscriptionUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNode

SetNode sets the "node" edge to the Node entity.

func (*SubscriptionUpdateOne) SetNodeID

SetNodeID sets the "node_id" field.

func (*SubscriptionUpdateOne) SetTerm

SetTerm sets the "term" edge to the Term entity.

func (*SubscriptionUpdateOne) SetTermID

SetTermID sets the "term_id" field.

func (*SubscriptionUpdateOne) SetToken

SetToken sets the "token" field.

func (*SubscriptionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpdateOne) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUserSettings

type SubscriptionUserSettings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// Mail holds the value of the "mail" field.
	Mail string `json:"mail,omitempty"`
	// Replies holds the value of the "replies" field.
	Replies bool `json:"replies,omitempty"`
	// AutoOwn holds the value of the "auto_own" field.
	AutoOwn bool `json:"auto_own,omitempty"`
	// AutoCommented holds the value of the "auto_commented" field.
	AutoCommented bool `json:"auto_commented,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SubscriptionUserSettingsQuery when eager-loading is set.
	Edges SubscriptionUserSettingsEdges `json:"edges"`
	// contains filtered or unexported fields
}

SubscriptionUserSettings is the model entity for the SubscriptionUserSettings schema.

func (*SubscriptionUserSettings) QueryUser

func (_m *SubscriptionUserSettings) QueryUser() *UserQuery

QueryUser queries the "user" edge of the SubscriptionUserSettings entity.

func (*SubscriptionUserSettings) String

func (_m *SubscriptionUserSettings) String() string

String implements the fmt.Stringer.

func (*SubscriptionUserSettings) Unwrap

Unwrap unwraps the SubscriptionUserSettings 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 (*SubscriptionUserSettings) Update

Update returns a builder for updating this SubscriptionUserSettings. Note that you need to call SubscriptionUserSettings.Unwrap() before calling this method if this SubscriptionUserSettings was returned from a transaction, and the transaction was committed or rolled back.

func (*SubscriptionUserSettings) Value

func (_m *SubscriptionUserSettings) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SubscriptionUserSettings. This includes values selected through modifiers, order, etc.

type SubscriptionUserSettingsClient

type SubscriptionUserSettingsClient struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsClient is a client for the SubscriptionUserSettings schema.

func NewSubscriptionUserSettingsClient

func NewSubscriptionUserSettingsClient(c config) *SubscriptionUserSettingsClient

NewSubscriptionUserSettingsClient returns a client for the SubscriptionUserSettings from the given config.

func (*SubscriptionUserSettingsClient) Create

Create returns a builder for creating a SubscriptionUserSettings entity.

func (*SubscriptionUserSettingsClient) CreateBulk

CreateBulk returns a builder for creating a bulk of SubscriptionUserSettings entities.

func (*SubscriptionUserSettingsClient) Delete

Delete returns a delete builder for SubscriptionUserSettings.

func (*SubscriptionUserSettingsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionUserSettingsClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SubscriptionUserSettingsClient) Get

Get returns a SubscriptionUserSettings entity by its id.

func (*SubscriptionUserSettingsClient) GetX

GetX is like Get, but panics if an error occurs.

func (*SubscriptionUserSettingsClient) Hooks

func (c *SubscriptionUserSettingsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SubscriptionUserSettingsClient) Intercept

func (c *SubscriptionUserSettingsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `subscriptionusersettings.Intercept(f(g(h())))`.

func (*SubscriptionUserSettingsClient) Interceptors

func (c *SubscriptionUserSettingsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SubscriptionUserSettingsClient) MapCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SubscriptionUserSettingsClient) Query

Query returns a query builder for SubscriptionUserSettings.

func (*SubscriptionUserSettingsClient) QueryUser

QueryUser queries the user edge of a SubscriptionUserSettings.

func (*SubscriptionUserSettingsClient) Update

Update returns an update builder for SubscriptionUserSettings.

func (*SubscriptionUserSettingsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionUserSettingsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*SubscriptionUserSettingsClient) Use

func (c *SubscriptionUserSettingsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `subscriptionusersettings.Hooks(f(g(h())))`.

type SubscriptionUserSettingsCreate

type SubscriptionUserSettingsCreate struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsCreate is the builder for creating a SubscriptionUserSettings entity.

func (*SubscriptionUserSettingsCreate) Exec

Exec executes the query.

func (*SubscriptionUserSettingsCreate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUserSettingsCreate) Mutation

Mutation returns the SubscriptionUserSettingsMutation object of the builder.

func (*SubscriptionUserSettingsCreate) Save

Save creates the SubscriptionUserSettings in the database.

func (*SubscriptionUserSettingsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionUserSettingsCreate) SetAutoCommented

SetAutoCommented sets the "auto_commented" field.

func (*SubscriptionUserSettingsCreate) SetAutoOwn

SetAutoOwn sets the "auto_own" field.

func (*SubscriptionUserSettingsCreate) SetID

SetID sets the "id" field.

func (*SubscriptionUserSettingsCreate) SetMail

SetMail sets the "mail" field.

func (*SubscriptionUserSettingsCreate) SetNillableAutoCommented

func (_c *SubscriptionUserSettingsCreate) SetNillableAutoCommented(v *bool) *SubscriptionUserSettingsCreate

SetNillableAutoCommented sets the "auto_commented" field if the given value is not nil.

func (*SubscriptionUserSettingsCreate) SetNillableAutoOwn

SetNillableAutoOwn sets the "auto_own" field if the given value is not nil.

func (*SubscriptionUserSettingsCreate) SetNillableMail

SetNillableMail sets the "mail" field if the given value is not nil.

func (*SubscriptionUserSettingsCreate) SetNillableReplies

SetNillableReplies sets the "replies" field if the given value is not nil.

func (*SubscriptionUserSettingsCreate) SetReplies

SetReplies sets the "replies" field.

func (*SubscriptionUserSettingsCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUserSettingsCreate) SetUserID

SetUserID sets the "user_id" field.

type SubscriptionUserSettingsCreateBulk

type SubscriptionUserSettingsCreateBulk struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsCreateBulk is the builder for creating many SubscriptionUserSettings entities in bulk.

func (*SubscriptionUserSettingsCreateBulk) Exec

Exec executes the query.

func (*SubscriptionUserSettingsCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUserSettingsCreateBulk) Save

Save creates the SubscriptionUserSettings entities in the database.

func (*SubscriptionUserSettingsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type SubscriptionUserSettingsDelete

type SubscriptionUserSettingsDelete struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsDelete is the builder for deleting a SubscriptionUserSettings entity.

func (*SubscriptionUserSettingsDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*SubscriptionUserSettingsDelete) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUserSettingsDelete) Where

Where appends a list predicates to the SubscriptionUserSettingsDelete builder.

type SubscriptionUserSettingsDeleteOne

type SubscriptionUserSettingsDeleteOne struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsDeleteOne is the builder for deleting a single SubscriptionUserSettings entity.

func (*SubscriptionUserSettingsDeleteOne) Exec

Exec executes the deletion query.

func (*SubscriptionUserSettingsDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUserSettingsDeleteOne) Where

Where appends a list predicates to the SubscriptionUserSettingsDelete builder.

type SubscriptionUserSettingsEdges

type SubscriptionUserSettingsEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

SubscriptionUserSettingsEdges holds the relations/edges for other nodes in the graph.

func (SubscriptionUserSettingsEdges) UserOrErr

func (e SubscriptionUserSettingsEdges) 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 SubscriptionUserSettingsGroupBy

type SubscriptionUserSettingsGroupBy struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsGroupBy is the group-by builder for SubscriptionUserSettings entities.

func (*SubscriptionUserSettingsGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*SubscriptionUserSettingsGroupBy) Bool

func (s *SubscriptionUserSettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) BoolX

func (s *SubscriptionUserSettingsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Bools

func (s *SubscriptionUserSettingsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) BoolsX

func (s *SubscriptionUserSettingsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Float64

func (s *SubscriptionUserSettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) Float64X

func (s *SubscriptionUserSettingsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Float64s

func (s *SubscriptionUserSettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) Float64sX

func (s *SubscriptionUserSettingsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Int

func (s *SubscriptionUserSettingsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) IntX

func (s *SubscriptionUserSettingsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Ints

func (s *SubscriptionUserSettingsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) IntsX

func (s *SubscriptionUserSettingsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionUserSettingsGroupBy) ScanX

func (s *SubscriptionUserSettingsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) String

func (s *SubscriptionUserSettingsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) StringX

func (s *SubscriptionUserSettingsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionUserSettingsGroupBy) Strings

func (s *SubscriptionUserSettingsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsGroupBy) StringsX

func (s *SubscriptionUserSettingsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionUserSettingsMutation

type SubscriptionUserSettingsMutation struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsMutation represents an operation that mutates the SubscriptionUserSettings nodes in the graph.

func (*SubscriptionUserSettingsMutation) AddField

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) AddedEdges

func (m *SubscriptionUserSettingsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SubscriptionUserSettingsMutation) AddedField

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) AddedFields

func (m *SubscriptionUserSettingsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SubscriptionUserSettingsMutation) AddedIDs

func (m *SubscriptionUserSettingsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SubscriptionUserSettingsMutation) AutoCommented

func (m *SubscriptionUserSettingsMutation) AutoCommented() (r bool, exists bool)

AutoCommented returns the value of the "auto_commented" field in the mutation.

func (*SubscriptionUserSettingsMutation) AutoOwn

func (m *SubscriptionUserSettingsMutation) AutoOwn() (r bool, exists bool)

AutoOwn returns the value of the "auto_own" field in the mutation.

func (*SubscriptionUserSettingsMutation) ClearEdge

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) ClearField

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) ClearUser

func (m *SubscriptionUserSettingsMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*SubscriptionUserSettingsMutation) ClearedEdges

func (m *SubscriptionUserSettingsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SubscriptionUserSettingsMutation) ClearedFields

func (m *SubscriptionUserSettingsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) EdgeCleared

func (m *SubscriptionUserSettingsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SubscriptionUserSettingsMutation) Field

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 (*SubscriptionUserSettingsMutation) FieldCleared

func (m *SubscriptionUserSettingsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SubscriptionUserSettingsMutation) Fields

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 (*SubscriptionUserSettingsMutation) ID

func (m *SubscriptionUserSettingsMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) Mail

func (m *SubscriptionUserSettingsMutation) Mail() (r string, exists bool)

Mail returns the value of the "mail" field in the mutation.

func (*SubscriptionUserSettingsMutation) OldAutoCommented

func (m *SubscriptionUserSettingsMutation) OldAutoCommented(ctx context.Context) (v bool, err error)

OldAutoCommented returns the old "auto_commented" field's value of the SubscriptionUserSettings entity. If the SubscriptionUserSettings 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 (*SubscriptionUserSettingsMutation) OldAutoOwn

func (m *SubscriptionUserSettingsMutation) OldAutoOwn(ctx context.Context) (v bool, err error)

OldAutoOwn returns the old "auto_own" field's value of the SubscriptionUserSettings entity. If the SubscriptionUserSettings 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 (*SubscriptionUserSettingsMutation) OldField

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 (*SubscriptionUserSettingsMutation) OldMail

func (m *SubscriptionUserSettingsMutation) OldMail(ctx context.Context) (v string, err error)

OldMail returns the old "mail" field's value of the SubscriptionUserSettings entity. If the SubscriptionUserSettings 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 (*SubscriptionUserSettingsMutation) OldReplies

func (m *SubscriptionUserSettingsMutation) OldReplies(ctx context.Context) (v bool, err error)

OldReplies returns the old "replies" field's value of the SubscriptionUserSettings entity. If the SubscriptionUserSettings 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 (*SubscriptionUserSettingsMutation) OldUserID

func (m *SubscriptionUserSettingsMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the SubscriptionUserSettings entity. If the SubscriptionUserSettings 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 (*SubscriptionUserSettingsMutation) Op

Op returns the operation name.

func (*SubscriptionUserSettingsMutation) RemovedEdges

func (m *SubscriptionUserSettingsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SubscriptionUserSettingsMutation) RemovedIDs

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) Replies

func (m *SubscriptionUserSettingsMutation) Replies() (r bool, exists bool)

Replies returns the value of the "replies" field in the mutation.

func (*SubscriptionUserSettingsMutation) ResetAutoCommented

func (m *SubscriptionUserSettingsMutation) ResetAutoCommented()

ResetAutoCommented resets all changes to the "auto_commented" field.

func (*SubscriptionUserSettingsMutation) ResetAutoOwn

func (m *SubscriptionUserSettingsMutation) ResetAutoOwn()

ResetAutoOwn resets all changes to the "auto_own" field.

func (*SubscriptionUserSettingsMutation) ResetEdge

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) ResetField

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) ResetMail

func (m *SubscriptionUserSettingsMutation) ResetMail()

ResetMail resets all changes to the "mail" field.

func (*SubscriptionUserSettingsMutation) ResetReplies

func (m *SubscriptionUserSettingsMutation) ResetReplies()

ResetReplies resets all changes to the "replies" field.

func (*SubscriptionUserSettingsMutation) ResetUser

func (m *SubscriptionUserSettingsMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SubscriptionUserSettingsMutation) ResetUserID

func (m *SubscriptionUserSettingsMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SubscriptionUserSettingsMutation) SetAutoCommented

func (m *SubscriptionUserSettingsMutation) SetAutoCommented(b bool)

SetAutoCommented sets the "auto_commented" field.

func (*SubscriptionUserSettingsMutation) SetAutoOwn

func (m *SubscriptionUserSettingsMutation) SetAutoOwn(b bool)

SetAutoOwn sets the "auto_own" field.

func (*SubscriptionUserSettingsMutation) SetField

func (m *SubscriptionUserSettingsMutation) 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 (*SubscriptionUserSettingsMutation) SetID

SetID sets the value of the id field. Note that this operation is only accepted on creation of SubscriptionUserSettings entities.

func (*SubscriptionUserSettingsMutation) SetMail

SetMail sets the "mail" field.

func (*SubscriptionUserSettingsMutation) SetOp

func (m *SubscriptionUserSettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscriptionUserSettingsMutation) SetReplies

func (m *SubscriptionUserSettingsMutation) SetReplies(b bool)

SetReplies sets the "replies" field.

func (*SubscriptionUserSettingsMutation) SetUserID

func (m *SubscriptionUserSettingsMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (SubscriptionUserSettingsMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SubscriptionUserSettingsMutation) Type

Type returns the node type of this mutation (SubscriptionUserSettings).

func (*SubscriptionUserSettingsMutation) UserCleared

func (m *SubscriptionUserSettingsMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*SubscriptionUserSettingsMutation) UserID

func (m *SubscriptionUserSettingsMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*SubscriptionUserSettingsMutation) UserIDs

func (m *SubscriptionUserSettingsMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*SubscriptionUserSettingsMutation) Where

Where appends a list predicates to the SubscriptionUserSettingsMutation builder.

func (*SubscriptionUserSettingsMutation) WhereP

func (m *SubscriptionUserSettingsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SubscriptionUserSettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SubscriptionUserSettingsQuery

type SubscriptionUserSettingsQuery struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsQuery is the builder for querying SubscriptionUserSettings entities.

func (*SubscriptionUserSettingsQuery) Aggregate

Aggregate returns a SubscriptionUserSettingsSelect configured with the given aggregations.

func (*SubscriptionUserSettingsQuery) All

All executes the query and returns a list of SubscriptionUserSettingsSlice.

func (*SubscriptionUserSettingsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) Clone

Clone returns a duplicate of the SubscriptionUserSettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SubscriptionUserSettingsQuery) Count

Count returns the count of the given query.

func (*SubscriptionUserSettingsQuery) CountX

CountX is like Count, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) Exist

Exist returns true if the query has elements in the graph.

func (*SubscriptionUserSettingsQuery) ExistX

ExistX is like Exist, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) First

First returns the first SubscriptionUserSettings entity from the query. Returns a *NotFoundError when no SubscriptionUserSettings was found.

func (*SubscriptionUserSettingsQuery) FirstID

func (_q *SubscriptionUserSettingsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SubscriptionUserSettings ID from the query. Returns a *NotFoundError when no SubscriptionUserSettings ID was found.

func (*SubscriptionUserSettingsQuery) FirstIDX

FirstIDX is like FirstID, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) GroupBy

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 int `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SubscriptionUserSettings.Query().
	GroupBy(subscriptionusersettings.FieldUserID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*SubscriptionUserSettingsQuery) IDs

func (_q *SubscriptionUserSettingsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of SubscriptionUserSettings IDs.

func (*SubscriptionUserSettingsQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) Limit

Limit the number of records to be returned by this query.

func (*SubscriptionUserSettingsQuery) Offset

Offset to start from.

func (*SubscriptionUserSettingsQuery) Only

Only returns a single SubscriptionUserSettings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SubscriptionUserSettings entity is found. Returns a *NotFoundError when no SubscriptionUserSettings entities are found.

func (*SubscriptionUserSettingsQuery) OnlyID

func (_q *SubscriptionUserSettingsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SubscriptionUserSettings ID in the query. Returns a *NotSingularError when more than one SubscriptionUserSettings ID is found. Returns a *NotFoundError when no entities are found.

func (*SubscriptionUserSettingsQuery) OnlyIDX

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*SubscriptionUserSettingsQuery) Order

Order specifies how the records should be ordered.

func (*SubscriptionUserSettingsQuery) QueryUser

func (_q *SubscriptionUserSettingsQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SubscriptionUserSettingsQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UserID int `json:"user_id,omitempty"`
}

client.SubscriptionUserSettings.Query().
	Select(subscriptionusersettings.FieldUserID).
	Scan(ctx, &v)

func (*SubscriptionUserSettingsQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SubscriptionUserSettingsQuery) Where

Where adds a new predicate for the SubscriptionUserSettingsQuery builder.

func (*SubscriptionUserSettingsQuery) WithUser

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 SubscriptionUserSettingsSelect

type SubscriptionUserSettingsSelect struct {
	*SubscriptionUserSettingsQuery
	// contains filtered or unexported fields
}

SubscriptionUserSettingsSelect is the builder for selecting fields of SubscriptionUserSettings entities.

func (*SubscriptionUserSettingsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*SubscriptionUserSettingsSelect) Bool

func (s *SubscriptionUserSettingsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) BoolX

func (s *SubscriptionUserSettingsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Bools

func (s *SubscriptionUserSettingsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) BoolsX

func (s *SubscriptionUserSettingsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Float64

func (s *SubscriptionUserSettingsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) Float64X

func (s *SubscriptionUserSettingsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Float64s

func (s *SubscriptionUserSettingsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) Float64sX

func (s *SubscriptionUserSettingsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Int

func (s *SubscriptionUserSettingsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) IntX

func (s *SubscriptionUserSettingsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Ints

func (s *SubscriptionUserSettingsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) IntsX

func (s *SubscriptionUserSettingsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionUserSettingsSelect) ScanX

func (s *SubscriptionUserSettingsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) String

func (s *SubscriptionUserSettingsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) StringX

func (s *SubscriptionUserSettingsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionUserSettingsSelect) Strings

func (s *SubscriptionUserSettingsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionUserSettingsSelect) StringsX

func (s *SubscriptionUserSettingsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionUserSettingsSlice

type SubscriptionUserSettingsSlice []*SubscriptionUserSettings

SubscriptionUserSettingsSlice is a parsable slice of SubscriptionUserSettings.

type SubscriptionUserSettingsUpdate

type SubscriptionUserSettingsUpdate struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsUpdate is the builder for updating SubscriptionUserSettings entities.

func (*SubscriptionUserSettingsUpdate) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*SubscriptionUserSettingsUpdate) Exec

Exec executes the query.

func (*SubscriptionUserSettingsUpdate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUserSettingsUpdate) Mutation

Mutation returns the SubscriptionUserSettingsMutation object of the builder.

func (*SubscriptionUserSettingsUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*SubscriptionUserSettingsUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUserSettingsUpdate) SetAutoCommented

SetAutoCommented sets the "auto_commented" field.

func (*SubscriptionUserSettingsUpdate) SetAutoOwn

SetAutoOwn sets the "auto_own" field.

func (*SubscriptionUserSettingsUpdate) SetMail

SetMail sets the "mail" field.

func (*SubscriptionUserSettingsUpdate) SetNillableAutoCommented

func (_u *SubscriptionUserSettingsUpdate) SetNillableAutoCommented(v *bool) *SubscriptionUserSettingsUpdate

SetNillableAutoCommented sets the "auto_commented" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdate) SetNillableAutoOwn

SetNillableAutoOwn sets the "auto_own" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdate) SetNillableMail

SetNillableMail sets the "mail" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdate) SetNillableReplies

SetNillableReplies sets the "replies" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdate) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdate) SetReplies

SetReplies sets the "replies" field.

func (*SubscriptionUserSettingsUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUserSettingsUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUserSettingsUpdate) Where

Where appends a list predicates to the SubscriptionUserSettingsUpdate builder.

type SubscriptionUserSettingsUpdateOne

type SubscriptionUserSettingsUpdateOne struct {
	// contains filtered or unexported fields
}

SubscriptionUserSettingsUpdateOne is the builder for updating a single SubscriptionUserSettings entity.

func (*SubscriptionUserSettingsUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*SubscriptionUserSettingsUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionUserSettingsUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUserSettingsUpdateOne) Mutation

Mutation returns the SubscriptionUserSettingsMutation object of the builder.

func (*SubscriptionUserSettingsUpdateOne) Save

Save executes the query and returns the updated SubscriptionUserSettings entity.

func (*SubscriptionUserSettingsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUserSettingsUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SubscriptionUserSettingsUpdateOne) SetAutoCommented

SetAutoCommented sets the "auto_commented" field.

func (*SubscriptionUserSettingsUpdateOne) SetAutoOwn

SetAutoOwn sets the "auto_own" field.

func (*SubscriptionUserSettingsUpdateOne) SetMail

SetMail sets the "mail" field.

func (*SubscriptionUserSettingsUpdateOne) SetNillableAutoCommented

SetNillableAutoCommented sets the "auto_commented" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdateOne) SetNillableAutoOwn

SetNillableAutoOwn sets the "auto_own" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdateOne) SetNillableMail

SetNillableMail sets the "mail" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdateOne) SetNillableReplies

SetNillableReplies sets the "replies" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdateOne) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionUserSettingsUpdateOne) SetReplies

SetReplies sets the "replies" field.

func (*SubscriptionUserSettingsUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*SubscriptionUserSettingsUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUserSettingsUpdateOne) Where

Where appends a list predicates to the SubscriptionUserSettingsUpdate builder.

type Subscriptions

type Subscriptions []*Subscription

Subscriptions is a parsable slice of Subscription.

type Term

type Term struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Term is the model entity for the Term schema.

func (*Term) String

func (_m *Term) String() string

String implements the fmt.Stringer.

func (*Term) Unwrap

func (_m *Term) Unwrap() *Term

Unwrap unwraps the Term 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 (*Term) Update

func (_m *Term) Update() *TermUpdateOne

Update returns a builder for updating this Term. Note that you need to call Term.Unwrap() before calling this method if this Term was returned from a transaction, and the transaction was committed or rolled back.

func (*Term) Value

func (_m *Term) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Term. This includes values selected through modifiers, order, etc.

type TermClient

type TermClient struct {
	// contains filtered or unexported fields
}

TermClient is a client for the Term schema.

func NewTermClient

func NewTermClient(c config) *TermClient

NewTermClient returns a client for the Term from the given config.

func (*TermClient) Create

func (c *TermClient) Create() *TermCreate

Create returns a builder for creating a Term entity.

func (*TermClient) CreateBulk

func (c *TermClient) CreateBulk(builders ...*TermCreate) *TermCreateBulk

CreateBulk returns a builder for creating a bulk of Term entities.

func (*TermClient) Delete

func (c *TermClient) Delete() *TermDelete

Delete returns a delete builder for Term.

func (*TermClient) DeleteOne

func (c *TermClient) DeleteOne(_m *Term) *TermDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TermClient) DeleteOneID

func (c *TermClient) DeleteOneID(id int) *TermDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TermClient) Get

func (c *TermClient) Get(ctx context.Context, id int) (*Term, error)

Get returns a Term entity by its id.

func (*TermClient) GetX

func (c *TermClient) GetX(ctx context.Context, id int) *Term

GetX is like Get, but panics if an error occurs.

func (*TermClient) Hooks

func (c *TermClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TermClient) Intercept

func (c *TermClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `term.Intercept(f(g(h())))`.

func (*TermClient) Interceptors

func (c *TermClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TermClient) MapCreateBulk

func (c *TermClient) MapCreateBulk(slice any, setFunc func(*TermCreate, int)) *TermCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TermClient) Query

func (c *TermClient) Query() *TermQuery

Query returns a query builder for Term.

func (*TermClient) Update

func (c *TermClient) Update() *TermUpdate

Update returns an update builder for Term.

func (*TermClient) UpdateOne

func (c *TermClient) UpdateOne(_m *Term) *TermUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TermClient) UpdateOneID

func (c *TermClient) UpdateOneID(id int) *TermUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TermClient) Use

func (c *TermClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `term.Hooks(f(g(h())))`.

type TermCreate

type TermCreate struct {
	// contains filtered or unexported fields
}

TermCreate is the builder for creating a Term entity.

func (*TermCreate) Exec

func (_c *TermCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TermCreate) ExecX

func (_c *TermCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TermCreate) Mutation

func (_c *TermCreate) Mutation() *TermMutation

Mutation returns the TermMutation object of the builder.

func (*TermCreate) Save

func (_c *TermCreate) Save(ctx context.Context) (*Term, error)

Save creates the Term in the database.

func (*TermCreate) SaveX

func (_c *TermCreate) SaveX(ctx context.Context) *Term

SaveX calls Save and panics if Save returns an error.

func (*TermCreate) SetID

func (_c *TermCreate) SetID(v int) *TermCreate

SetID sets the "id" field.

type TermCreateBulk

type TermCreateBulk struct {
	// contains filtered or unexported fields
}

TermCreateBulk is the builder for creating many Term entities in bulk.

func (*TermCreateBulk) Exec

func (_c *TermCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TermCreateBulk) ExecX

func (_c *TermCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TermCreateBulk) Save

func (_c *TermCreateBulk) Save(ctx context.Context) ([]*Term, error)

Save creates the Term entities in the database.

func (*TermCreateBulk) SaveX

func (_c *TermCreateBulk) SaveX(ctx context.Context) []*Term

SaveX is like Save, but panics if an error occurs.

type TermDelete

type TermDelete struct {
	// contains filtered or unexported fields
}

TermDelete is the builder for deleting a Term entity.

func (*TermDelete) Exec

func (_d *TermDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TermDelete) ExecX

func (_d *TermDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TermDelete) Where

func (_d *TermDelete) Where(ps ...predicate.Term) *TermDelete

Where appends a list predicates to the TermDelete builder.

type TermDeleteOne

type TermDeleteOne struct {
	// contains filtered or unexported fields
}

TermDeleteOne is the builder for deleting a single Term entity.

func (*TermDeleteOne) Exec

func (_d *TermDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TermDeleteOne) ExecX

func (_d *TermDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TermDeleteOne) Where

func (_d *TermDeleteOne) Where(ps ...predicate.Term) *TermDeleteOne

Where appends a list predicates to the TermDelete builder.

type TermGroupBy

type TermGroupBy struct {
	// contains filtered or unexported fields
}

TermGroupBy is the group-by builder for Term entities.

func (*TermGroupBy) Aggregate

func (_g *TermGroupBy) Aggregate(fns ...AggregateFunc) *TermGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TermGroupBy) Bool

func (s *TermGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) BoolX

func (s *TermGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TermGroupBy) Bools

func (s *TermGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) BoolsX

func (s *TermGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TermGroupBy) Float64

func (s *TermGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) Float64X

func (s *TermGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TermGroupBy) Float64s

func (s *TermGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) Float64sX

func (s *TermGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TermGroupBy) Int

func (s *TermGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) IntX

func (s *TermGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TermGroupBy) Ints

func (s *TermGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) IntsX

func (s *TermGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TermGroupBy) Scan

func (_g *TermGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TermGroupBy) ScanX

func (s *TermGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TermGroupBy) String

func (s *TermGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) StringX

func (s *TermGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TermGroupBy) Strings

func (s *TermGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TermGroupBy) StringsX

func (s *TermGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TermMutation

type TermMutation struct {
	// contains filtered or unexported fields
}

TermMutation represents an operation that mutates the Term nodes in the graph.

func (*TermMutation) AddField

func (m *TermMutation) 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 (*TermMutation) AddedEdges

func (m *TermMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TermMutation) AddedField

func (m *TermMutation) 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 (*TermMutation) AddedFields

func (m *TermMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TermMutation) AddedIDs

func (m *TermMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TermMutation) ClearEdge

func (m *TermMutation) 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 (*TermMutation) ClearField

func (m *TermMutation) 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 (*TermMutation) ClearedEdges

func (m *TermMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TermMutation) ClearedFields

func (m *TermMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TermMutation) Client

func (m TermMutation) 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 (*TermMutation) EdgeCleared

func (m *TermMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TermMutation) Field

func (m *TermMutation) 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 (*TermMutation) FieldCleared

func (m *TermMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TermMutation) Fields

func (m *TermMutation) 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 (*TermMutation) ID

func (m *TermMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TermMutation) IDs

func (m *TermMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TermMutation) OldField

func (m *TermMutation) 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 (*TermMutation) Op

func (m *TermMutation) Op() Op

Op returns the operation name.

func (*TermMutation) RemovedEdges

func (m *TermMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TermMutation) RemovedIDs

func (m *TermMutation) 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 (*TermMutation) ResetEdge

func (m *TermMutation) 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 (*TermMutation) ResetField

func (m *TermMutation) 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 (*TermMutation) SetField

func (m *TermMutation) 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 (*TermMutation) SetID

func (m *TermMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Term entities.

func (*TermMutation) SetOp

func (m *TermMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (TermMutation) Tx

func (m TermMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TermMutation) Type

func (m *TermMutation) Type() string

Type returns the node type of this mutation (Term).

func (*TermMutation) Where

func (m *TermMutation) Where(ps ...predicate.Term)

Where appends a list predicates to the TermMutation builder.

func (*TermMutation) WhereP

func (m *TermMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TermMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TermQuery

type TermQuery struct {
	// contains filtered or unexported fields
}

TermQuery is the builder for querying Term entities.

func (*TermQuery) Aggregate

func (_q *TermQuery) Aggregate(fns ...AggregateFunc) *TermSelect

Aggregate returns a TermSelect configured with the given aggregations.

func (*TermQuery) All

func (_q *TermQuery) All(ctx context.Context) ([]*Term, error)

All executes the query and returns a list of Terms.

func (*TermQuery) AllX

func (_q *TermQuery) AllX(ctx context.Context) []*Term

AllX is like All, but panics if an error occurs.

func (*TermQuery) Clone

func (_q *TermQuery) Clone() *TermQuery

Clone returns a duplicate of the TermQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TermQuery) Count

func (_q *TermQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TermQuery) CountX

func (_q *TermQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TermQuery) Exist

func (_q *TermQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TermQuery) ExistX

func (_q *TermQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TermQuery) First

func (_q *TermQuery) First(ctx context.Context) (*Term, error)

First returns the first Term entity from the query. Returns a *NotFoundError when no Term was found.

func (*TermQuery) FirstID

func (_q *TermQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Term ID from the query. Returns a *NotFoundError when no Term ID was found.

func (*TermQuery) FirstIDX

func (_q *TermQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TermQuery) FirstX

func (_q *TermQuery) FirstX(ctx context.Context) *Term

FirstX is like First, but panics if an error occurs.

func (*TermQuery) GroupBy

func (_q *TermQuery) GroupBy(field string, fields ...string) *TermGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*TermQuery) IDs

func (_q *TermQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Term IDs.

func (*TermQuery) IDsX

func (_q *TermQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TermQuery) Limit

func (_q *TermQuery) Limit(limit int) *TermQuery

Limit the number of records to be returned by this query.

func (*TermQuery) Offset

func (_q *TermQuery) Offset(offset int) *TermQuery

Offset to start from.

func (*TermQuery) Only

func (_q *TermQuery) Only(ctx context.Context) (*Term, error)

Only returns a single Term entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Term entity is found. Returns a *NotFoundError when no Term entities are found.

func (*TermQuery) OnlyID

func (_q *TermQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Term ID in the query. Returns a *NotSingularError when more than one Term ID is found. Returns a *NotFoundError when no entities are found.

func (*TermQuery) OnlyIDX

func (_q *TermQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TermQuery) OnlyX

func (_q *TermQuery) OnlyX(ctx context.Context) *Term

OnlyX is like Only, but panics if an error occurs.

func (*TermQuery) Order

func (_q *TermQuery) Order(o ...term.OrderOption) *TermQuery

Order specifies how the records should be ordered.

func (*TermQuery) Select

func (_q *TermQuery) Select(fields ...string) *TermSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*TermQuery) Unique

func (_q *TermQuery) Unique(unique bool) *TermQuery

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 (*TermQuery) Where

func (_q *TermQuery) Where(ps ...predicate.Term) *TermQuery

Where adds a new predicate for the TermQuery builder.

type TermSelect

type TermSelect struct {
	*TermQuery
	// contains filtered or unexported fields
}

TermSelect is the builder for selecting fields of Term entities.

func (*TermSelect) Aggregate

func (_s *TermSelect) Aggregate(fns ...AggregateFunc) *TermSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TermSelect) Bool

func (s *TermSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TermSelect) BoolX

func (s *TermSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TermSelect) Bools

func (s *TermSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TermSelect) BoolsX

func (s *TermSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TermSelect) Float64

func (s *TermSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TermSelect) Float64X

func (s *TermSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TermSelect) Float64s

func (s *TermSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TermSelect) Float64sX

func (s *TermSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TermSelect) Int

func (s *TermSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TermSelect) IntX

func (s *TermSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TermSelect) Ints

func (s *TermSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TermSelect) IntsX

func (s *TermSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TermSelect) Scan

func (_s *TermSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TermSelect) ScanX

func (s *TermSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TermSelect) String

func (s *TermSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TermSelect) StringX

func (s *TermSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TermSelect) Strings

func (s *TermSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TermSelect) StringsX

func (s *TermSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TermUpdate

type TermUpdate struct {
	// contains filtered or unexported fields
}

TermUpdate is the builder for updating Term entities.

func (*TermUpdate) Exec

func (_u *TermUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TermUpdate) ExecX

func (_u *TermUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TermUpdate) Mutation

func (_u *TermUpdate) Mutation() *TermMutation

Mutation returns the TermMutation object of the builder.

func (*TermUpdate) Save

func (_u *TermUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TermUpdate) SaveX

func (_u *TermUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TermUpdate) Where

func (_u *TermUpdate) Where(ps ...predicate.Term) *TermUpdate

Where appends a list predicates to the TermUpdate builder.

type TermUpdateOne

type TermUpdateOne struct {
	// contains filtered or unexported fields
}

TermUpdateOne is the builder for updating a single Term entity.

func (*TermUpdateOne) Exec

func (_u *TermUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TermUpdateOne) ExecX

func (_u *TermUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TermUpdateOne) Mutation

func (_u *TermUpdateOne) Mutation() *TermMutation

Mutation returns the TermMutation object of the builder.

func (*TermUpdateOne) Save

func (_u *TermUpdateOne) Save(ctx context.Context) (*Term, error)

Save executes the query and returns the updated Term entity.

func (*TermUpdateOne) SaveX

func (_u *TermUpdateOne) SaveX(ctx context.Context) *Term

SaveX is like Save, but panics if an error occurs.

func (*TermUpdateOne) Select

func (_u *TermUpdateOne) Select(field string, fields ...string) *TermUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TermUpdateOne) Where

func (_u *TermUpdateOne) Where(ps ...predicate.Term) *TermUpdateOne

Where appends a list predicates to the TermUpdate builder.

type Terms

type Terms []*Term

Terms is a parsable slice of Term.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// SubscriptionNotification is the client for interacting with the SubscriptionNotification builders.
	SubscriptionNotification *SubscriptionNotificationClient
	// SubscriptionSettings is the client for interacting with the SubscriptionSettings builders.
	SubscriptionSettings *SubscriptionSettingsClient
	// SubscriptionUserSettings is the client for interacting with the SubscriptionUserSettings builders.
	SubscriptionUserSettings *SubscriptionUserSettingsClient
	// Term is the client for interacting with the Term builders.
	Term *TermClient
	// 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 int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String

func (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (_m *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 (_m *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.

func (*User) Value

func (_m *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

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(_m *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

func (_c *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (_c *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetID

func (_c *UserCreate) SetID(v int) *UserCreate

SetID sets the "id" 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 (_c *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (_c *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (_c *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 (_d *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (_d *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (_d *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 (_d *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (_d *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (_g *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 (_g *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type 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) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) 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) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

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) 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) 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 int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

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) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (_q *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (_q *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 (_q *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (_q *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (_q *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (_q *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (_q *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 (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (_q *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (_q *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (_q *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.

func (*UserQuery) IDs

func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (_q *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (_q *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (_q *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (_q *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 (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (_q *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (_q *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Select

func (_q *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.

func (*UserQuery) Unique

func (_q *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 (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (_s *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) Exec

func (_u *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (_u *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

func (_u *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 (_u *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) Where

func (_u *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) Exec

func (_u *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (_u *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (_u *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) Where

func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL