ent

package
v0.0.0-...-06621f0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 26 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.
	TypeCollaboration = "Collaboration"
	TypeMemo          = "Memo"
	TypeSubscription  = "Subscription"
	TypeTag           = "Tag"
	TypeUser          = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Collaboration is the client for interacting with the Collaboration builders.
	Collaboration *CollaborationClient
	// Memo is the client for interacting with the Memo builders.
	Memo *MemoClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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().
	Collaboration.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) Ping(ctx context.Context) error

func (*Client) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 Collaboration

type Collaboration struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// MemoID holds the value of the "memo_id" field.
	MemoID uuid.UUID `json:"memo_id,omitempty"`
	// Approved holds the value of the "approved" field.
	Approved bool `json:"approved,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CollaborationQuery when eager-loading is set.
	Edges CollaborationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Collaboration is the model entity for the Collaboration schema.

func (*Collaboration) ExecContext

func (c *Collaboration) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Collaboration) QueryCollaborator

func (c *Collaboration) QueryCollaborator() *UserQuery

QueryCollaborator queries the "collaborator" edge of the Collaboration entity.

func (*Collaboration) QueryContext

func (c *Collaboration) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Collaboration) QueryMemo

func (c *Collaboration) QueryMemo() *MemoQuery

QueryMemo queries the "memo" edge of the Collaboration entity.

func (*Collaboration) String

func (c *Collaboration) String() string

String implements the fmt.Stringer.

func (*Collaboration) Unwrap

func (c *Collaboration) Unwrap() *Collaboration

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

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

func (*Collaboration) Value

func (c *Collaboration) Value(name string) (ent.Value, error)

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

type CollaborationClient

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

CollaborationClient is a client for the Collaboration schema.

func NewCollaborationClient

func NewCollaborationClient(c config) *CollaborationClient

NewCollaborationClient returns a client for the Collaboration from the given config.

func (*CollaborationClient) Create

Create returns a builder for creating a Collaboration entity.

func (*CollaborationClient) CreateBulk

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

func (*CollaborationClient) Delete

Delete returns a delete builder for Collaboration.

func (*CollaborationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CollaborationClient) DeleteOneID

func (c *CollaborationClient) DeleteOneID(id int) *CollaborationDeleteOne

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

func (*CollaborationClient) ExecContext

func (c *CollaborationClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationClient) Get

Get returns a Collaboration entity by its id.

func (*CollaborationClient) GetX

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

func (*CollaborationClient) Hooks

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

Hooks returns the client hooks.

func (*CollaborationClient) Intercept

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

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

func (*CollaborationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CollaborationClient) MapCreateBulk

func (c *CollaborationClient) MapCreateBulk(slice any, setFunc func(*CollaborationCreate, int)) *CollaborationCreateBulk

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

Query returns a query builder for Collaboration.

func (*CollaborationClient) QueryCollaborator

func (c *CollaborationClient) QueryCollaborator(co *Collaboration) *UserQuery

QueryCollaborator queries the collaborator edge of a Collaboration.

func (*CollaborationClient) QueryContext

func (c *CollaborationClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationClient) QueryMemo

func (c *CollaborationClient) QueryMemo(co *Collaboration) *MemoQuery

QueryMemo queries the memo edge of a Collaboration.

func (*CollaborationClient) Update

Update returns an update builder for Collaboration.

func (*CollaborationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CollaborationClient) UpdateOneID

func (c *CollaborationClient) UpdateOneID(id int) *CollaborationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CollaborationClient) Use

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

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

type CollaborationCreate

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

CollaborationCreate is the builder for creating a Collaboration entity.

func (*CollaborationCreate) Exec

func (cc *CollaborationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CollaborationCreate) ExecContext

func (c *CollaborationCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationCreate) ExecX

func (cc *CollaborationCreate) ExecX(ctx context.Context)

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

func (*CollaborationCreate) Mutation

Mutation returns the CollaborationMutation object of the builder.

func (*CollaborationCreate) OnConflict

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

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

func (*CollaborationCreate) OnConflictColumns

func (cc *CollaborationCreate) OnConflictColumns(columns ...string) *CollaborationUpsertOne

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

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

func (*CollaborationCreate) QueryContext

func (c *CollaborationCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationCreate) Save

Save creates the Collaboration in the database.

func (*CollaborationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CollaborationCreate) SetApproved

func (cc *CollaborationCreate) SetApproved(b bool) *CollaborationCreate

SetApproved sets the "approved" field.

func (*CollaborationCreate) SetCollaborator

func (cc *CollaborationCreate) SetCollaborator(u *User) *CollaborationCreate

SetCollaborator sets the "collaborator" edge to the User entity.

func (*CollaborationCreate) SetCollaboratorID

func (cc *CollaborationCreate) SetCollaboratorID(id uuid.UUID) *CollaborationCreate

SetCollaboratorID sets the "collaborator" edge to the User entity by ID.

func (*CollaborationCreate) SetCreateTime

func (cc *CollaborationCreate) SetCreateTime(t time.Time) *CollaborationCreate

SetCreateTime sets the "create_time" field.

func (*CollaborationCreate) SetMemo

func (cc *CollaborationCreate) SetMemo(m *Memo) *CollaborationCreate

SetMemo sets the "memo" edge to the Memo entity.

func (*CollaborationCreate) SetMemoID

SetMemoID sets the "memo_id" field.

func (*CollaborationCreate) SetNillableApproved

func (cc *CollaborationCreate) SetNillableApproved(b *bool) *CollaborationCreate

SetNillableApproved sets the "approved" field if the given value is not nil.

func (*CollaborationCreate) SetNillableCreateTime

func (cc *CollaborationCreate) SetNillableCreateTime(t *time.Time) *CollaborationCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CollaborationCreate) SetNillableUpdateTime

func (cc *CollaborationCreate) SetNillableUpdateTime(t *time.Time) *CollaborationCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CollaborationCreate) SetUpdateTime

func (cc *CollaborationCreate) SetUpdateTime(t time.Time) *CollaborationCreate

SetUpdateTime sets the "update_time" field.

func (*CollaborationCreate) SetUserID

SetUserID sets the "user_id" field.

type CollaborationCreateBulk

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

CollaborationCreateBulk is the builder for creating many Collaboration entities in bulk.

func (*CollaborationCreateBulk) Exec

Exec executes the query.

func (*CollaborationCreateBulk) ExecContext

func (c *CollaborationCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationCreateBulk) ExecX

func (ccb *CollaborationCreateBulk) ExecX(ctx context.Context)

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

func (*CollaborationCreateBulk) OnConflict

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

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

func (*CollaborationCreateBulk) OnConflictColumns

func (ccb *CollaborationCreateBulk) OnConflictColumns(columns ...string) *CollaborationUpsertBulk

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

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

func (*CollaborationCreateBulk) QueryContext

func (c *CollaborationCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationCreateBulk) Save

Save creates the Collaboration entities in the database.

func (*CollaborationCreateBulk) SaveX

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

type CollaborationDelete

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

CollaborationDelete is the builder for deleting a Collaboration entity.

func (*CollaborationDelete) Exec

func (cd *CollaborationDelete) Exec(ctx context.Context) (int, error)

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

func (*CollaborationDelete) ExecContext

func (c *CollaborationDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationDelete) ExecX

func (cd *CollaborationDelete) ExecX(ctx context.Context) int

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

func (*CollaborationDelete) QueryContext

func (c *CollaborationDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationDelete) Where

Where appends a list predicates to the CollaborationDelete builder.

type CollaborationDeleteOne

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

CollaborationDeleteOne is the builder for deleting a single Collaboration entity.

func (*CollaborationDeleteOne) Exec

Exec executes the deletion query.

func (*CollaborationDeleteOne) ExecX

func (cdo *CollaborationDeleteOne) ExecX(ctx context.Context)

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

func (*CollaborationDeleteOne) Where

Where appends a list predicates to the CollaborationDelete builder.

type CollaborationEdges

type CollaborationEdges struct {
	// Collaborator holds the value of the collaborator edge.
	Collaborator *User `json:"collaborator,omitempty"`
	// Memo holds the value of the memo edge.
	Memo *Memo `json:"memo,omitempty"`
	// contains filtered or unexported fields
}

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

func (CollaborationEdges) CollaboratorOrErr

func (e CollaborationEdges) CollaboratorOrErr() (*User, error)

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

func (CollaborationEdges) MemoOrErr

func (e CollaborationEdges) MemoOrErr() (*Memo, error)

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

type CollaborationGroupBy

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

CollaborationGroupBy is the group-by builder for Collaboration entities.

func (*CollaborationGroupBy) Aggregate

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

func (*CollaborationGroupBy) Bool

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

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

func (*CollaborationGroupBy) BoolX

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

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

func (*CollaborationGroupBy) Bools

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

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

func (*CollaborationGroupBy) BoolsX

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

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

func (*CollaborationGroupBy) Float64

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

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

func (*CollaborationGroupBy) Float64X

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

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

func (*CollaborationGroupBy) Float64s

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

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

func (*CollaborationGroupBy) Float64sX

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

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

func (*CollaborationGroupBy) Int

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

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

func (*CollaborationGroupBy) IntX

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

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

func (*CollaborationGroupBy) Ints

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

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

func (*CollaborationGroupBy) IntsX

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

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

func (*CollaborationGroupBy) Scan

func (cgb *CollaborationGroupBy) Scan(ctx context.Context, v any) error

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

func (*CollaborationGroupBy) ScanX

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

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

func (*CollaborationGroupBy) String

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

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

func (*CollaborationGroupBy) StringX

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

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

func (*CollaborationGroupBy) Strings

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

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

func (*CollaborationGroupBy) StringsX

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

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

type CollaborationMutation

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

CollaborationMutation represents an operation that mutates the Collaboration nodes in the graph.

func (*CollaborationMutation) AddField

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

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

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

func (*CollaborationMutation) AddedField

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

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

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

func (*CollaborationMutation) AddedIDs

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

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

func (*CollaborationMutation) Approved

func (m *CollaborationMutation) Approved() (r bool, exists bool)

Approved returns the value of the "approved" field in the mutation.

func (*CollaborationMutation) ClearCollaborator

func (m *CollaborationMutation) ClearCollaborator()

ClearCollaborator clears the "collaborator" edge to the User entity.

func (*CollaborationMutation) ClearEdge

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

func (m *CollaborationMutation) 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 (*CollaborationMutation) ClearMemo

func (m *CollaborationMutation) ClearMemo()

ClearMemo clears the "memo" edge to the Memo entity.

func (*CollaborationMutation) ClearedEdges

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

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

func (*CollaborationMutation) ClearedFields

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

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

func (CollaborationMutation) Client

func (m CollaborationMutation) 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 (*CollaborationMutation) CollaboratorCleared

func (m *CollaborationMutation) CollaboratorCleared() bool

CollaboratorCleared reports if the "collaborator" edge to the User entity was cleared.

func (*CollaborationMutation) CollaboratorID

func (m *CollaborationMutation) CollaboratorID() (id uuid.UUID, exists bool)

CollaboratorID returns the "collaborator" edge ID in the mutation.

func (*CollaborationMutation) CollaboratorIDs

func (m *CollaborationMutation) CollaboratorIDs() (ids []uuid.UUID)

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

func (*CollaborationMutation) CreateTime

func (m *CollaborationMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*CollaborationMutation) EdgeCleared

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

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

func (*CollaborationMutation) ExecContext

func (c *CollaborationMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationMutation) Field

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

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

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

func (*CollaborationMutation) Fields

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

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

func (m *CollaborationMutation) 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 (*CollaborationMutation) MemoCleared

func (m *CollaborationMutation) MemoCleared() bool

MemoCleared reports if the "memo" edge to the Memo entity was cleared.

func (*CollaborationMutation) MemoID

func (m *CollaborationMutation) MemoID() (r uuid.UUID, exists bool)

MemoID returns the value of the "memo_id" field in the mutation.

func (*CollaborationMutation) MemoIDs

func (m *CollaborationMutation) MemoIDs() (ids []uuid.UUID)

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

func (*CollaborationMutation) OldApproved

func (m *CollaborationMutation) OldApproved(ctx context.Context) (v bool, err error)

OldApproved returns the old "approved" field's value of the Collaboration entity. If the Collaboration 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 (*CollaborationMutation) OldCreateTime

func (m *CollaborationMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Collaboration entity. If the Collaboration 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 (*CollaborationMutation) OldField

func (m *CollaborationMutation) 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 (*CollaborationMutation) OldMemoID

func (m *CollaborationMutation) OldMemoID(ctx context.Context) (v uuid.UUID, err error)

OldMemoID returns the old "memo_id" field's value of the Collaboration entity. If the Collaboration 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 (*CollaborationMutation) OldUpdateTime

func (m *CollaborationMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Collaboration entity. If the Collaboration 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 (*CollaborationMutation) OldUserID

func (m *CollaborationMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

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

func (m *CollaborationMutation) Op() Op

Op returns the operation name.

func (*CollaborationMutation) QueryContext

func (c *CollaborationMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationMutation) RemovedEdges

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

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

func (*CollaborationMutation) RemovedIDs

func (m *CollaborationMutation) 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 (*CollaborationMutation) ResetApproved

func (m *CollaborationMutation) ResetApproved()

ResetApproved resets all changes to the "approved" field.

func (*CollaborationMutation) ResetCollaborator

func (m *CollaborationMutation) ResetCollaborator()

ResetCollaborator resets all changes to the "collaborator" edge.

func (*CollaborationMutation) ResetCreateTime

func (m *CollaborationMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*CollaborationMutation) ResetEdge

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

func (m *CollaborationMutation) 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 (*CollaborationMutation) ResetMemo

func (m *CollaborationMutation) ResetMemo()

ResetMemo resets all changes to the "memo" edge.

func (*CollaborationMutation) ResetMemoID

func (m *CollaborationMutation) ResetMemoID()

ResetMemoID resets all changes to the "memo_id" field.

func (*CollaborationMutation) ResetUpdateTime

func (m *CollaborationMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*CollaborationMutation) ResetUserID

func (m *CollaborationMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*CollaborationMutation) SetApproved

func (m *CollaborationMutation) SetApproved(b bool)

SetApproved sets the "approved" field.

func (*CollaborationMutation) SetCollaboratorID

func (m *CollaborationMutation) SetCollaboratorID(id uuid.UUID)

SetCollaboratorID sets the "collaborator" edge to the User entity by id.

func (*CollaborationMutation) SetCreateTime

func (m *CollaborationMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*CollaborationMutation) SetField

func (m *CollaborationMutation) 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 (*CollaborationMutation) SetMemoID

func (m *CollaborationMutation) SetMemoID(u uuid.UUID)

SetMemoID sets the "memo_id" field.

func (*CollaborationMutation) SetOp

func (m *CollaborationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CollaborationMutation) SetUpdateTime

func (m *CollaborationMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*CollaborationMutation) SetUserID

func (m *CollaborationMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (CollaborationMutation) Tx

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

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

func (*CollaborationMutation) Type

func (m *CollaborationMutation) Type() string

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

func (*CollaborationMutation) UpdateTime

func (m *CollaborationMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*CollaborationMutation) UserID

func (m *CollaborationMutation) UserID() (r uuid.UUID, exists bool)

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

func (*CollaborationMutation) Where

Where appends a list predicates to the CollaborationMutation builder.

func (*CollaborationMutation) WhereP

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

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

type CollaborationQuery

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

CollaborationQuery is the builder for querying Collaboration entities.

func (*CollaborationQuery) Aggregate

func (cq *CollaborationQuery) Aggregate(fns ...AggregateFunc) *CollaborationSelect

Aggregate returns a CollaborationSelect configured with the given aggregations.

func (*CollaborationQuery) All

All executes the query and returns a list of Collaborations.

func (*CollaborationQuery) AllX

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

func (*CollaborationQuery) Clone

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

func (*CollaborationQuery) Count

func (cq *CollaborationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CollaborationQuery) CountX

func (cq *CollaborationQuery) CountX(ctx context.Context) int

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

func (*CollaborationQuery) ExecContext

func (c *CollaborationQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationQuery) Exist

func (cq *CollaborationQuery) Exist(ctx context.Context) (bool, error)

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

func (*CollaborationQuery) ExistX

func (cq *CollaborationQuery) ExistX(ctx context.Context) bool

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

func (*CollaborationQuery) First

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

func (*CollaborationQuery) FirstID

func (cq *CollaborationQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CollaborationQuery) FirstIDX

func (cq *CollaborationQuery) FirstIDX(ctx context.Context) int

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

func (*CollaborationQuery) FirstX

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

func (*CollaborationQuery) GroupBy

func (cq *CollaborationQuery) GroupBy(field string, fields ...string) *CollaborationGroupBy

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Collaboration.Query().
	GroupBy(collaboration.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CollaborationQuery) IDs

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

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

func (*CollaborationQuery) IDsX

func (cq *CollaborationQuery) IDsX(ctx context.Context) []int

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

func (*CollaborationQuery) Limit

func (cq *CollaborationQuery) Limit(limit int) *CollaborationQuery

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

func (*CollaborationQuery) Offset

func (cq *CollaborationQuery) Offset(offset int) *CollaborationQuery

Offset to start from.

func (*CollaborationQuery) Only

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

func (*CollaborationQuery) OnlyID

func (cq *CollaborationQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CollaborationQuery) OnlyIDX

func (cq *CollaborationQuery) OnlyIDX(ctx context.Context) int

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

func (*CollaborationQuery) OnlyX

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

func (*CollaborationQuery) Order

Order specifies how the records should be ordered.

func (*CollaborationQuery) QueryCollaborator

func (cq *CollaborationQuery) QueryCollaborator() *UserQuery

QueryCollaborator chains the current query on the "collaborator" edge.

func (*CollaborationQuery) QueryContext

func (c *CollaborationQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationQuery) QueryMemo

func (cq *CollaborationQuery) QueryMemo() *MemoQuery

QueryMemo chains the current query on the "memo" edge.

func (*CollaborationQuery) Select

func (cq *CollaborationQuery) Select(fields ...string) *CollaborationSelect

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
}

client.Collaboration.Query().
	Select(collaboration.FieldUserID).
	Scan(ctx, &v)

func (*CollaborationQuery) Unique

func (cq *CollaborationQuery) Unique(unique bool) *CollaborationQuery

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

Where adds a new predicate for the CollaborationQuery builder.

func (*CollaborationQuery) WithCollaborator

func (cq *CollaborationQuery) WithCollaborator(opts ...func(*UserQuery)) *CollaborationQuery

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

func (*CollaborationQuery) WithMemo

func (cq *CollaborationQuery) WithMemo(opts ...func(*MemoQuery)) *CollaborationQuery

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

type CollaborationSelect

type CollaborationSelect struct {
	*CollaborationQuery
	// contains filtered or unexported fields
}

CollaborationSelect is the builder for selecting fields of Collaboration entities.

func (*CollaborationSelect) Aggregate

func (cs *CollaborationSelect) Aggregate(fns ...AggregateFunc) *CollaborationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CollaborationSelect) Bool

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

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

func (*CollaborationSelect) BoolX

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

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

func (*CollaborationSelect) Bools

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

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

func (*CollaborationSelect) BoolsX

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

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

func (CollaborationSelect) ExecContext

func (c CollaborationSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationSelect) Float64

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

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

func (*CollaborationSelect) Float64X

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

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

func (*CollaborationSelect) Float64s

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

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

func (*CollaborationSelect) Float64sX

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

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

func (*CollaborationSelect) Int

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

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

func (*CollaborationSelect) IntX

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

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

func (*CollaborationSelect) Ints

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

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

func (*CollaborationSelect) IntsX

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

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

func (CollaborationSelect) QueryContext

func (c CollaborationSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationSelect) Scan

func (cs *CollaborationSelect) Scan(ctx context.Context, v any) error

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

func (*CollaborationSelect) ScanX

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

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

func (*CollaborationSelect) String

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

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

func (*CollaborationSelect) StringX

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

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

func (*CollaborationSelect) Strings

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

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

func (*CollaborationSelect) StringsX

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

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

type CollaborationUpdate

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

CollaborationUpdate is the builder for updating Collaboration entities.

func (*CollaborationUpdate) ClearCollaborator

func (cu *CollaborationUpdate) ClearCollaborator() *CollaborationUpdate

ClearCollaborator clears the "collaborator" edge to the User entity.

func (*CollaborationUpdate) ClearMemo

func (cu *CollaborationUpdate) ClearMemo() *CollaborationUpdate

ClearMemo clears the "memo" edge to the Memo entity.

func (*CollaborationUpdate) Exec

func (cu *CollaborationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CollaborationUpdate) ExecContext

func (c *CollaborationUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationUpdate) ExecX

func (cu *CollaborationUpdate) ExecX(ctx context.Context)

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

func (*CollaborationUpdate) Mutation

Mutation returns the CollaborationMutation object of the builder.

func (*CollaborationUpdate) QueryContext

func (c *CollaborationUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationUpdate) Save

func (cu *CollaborationUpdate) Save(ctx context.Context) (int, error)

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

func (*CollaborationUpdate) SaveX

func (cu *CollaborationUpdate) SaveX(ctx context.Context) int

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

func (*CollaborationUpdate) SetApproved

func (cu *CollaborationUpdate) SetApproved(b bool) *CollaborationUpdate

SetApproved sets the "approved" field.

func (*CollaborationUpdate) SetCollaborator

func (cu *CollaborationUpdate) SetCollaborator(u *User) *CollaborationUpdate

SetCollaborator sets the "collaborator" edge to the User entity.

func (*CollaborationUpdate) SetCollaboratorID

func (cu *CollaborationUpdate) SetCollaboratorID(id uuid.UUID) *CollaborationUpdate

SetCollaboratorID sets the "collaborator" edge to the User entity by ID.

func (*CollaborationUpdate) SetMemo

func (cu *CollaborationUpdate) SetMemo(m *Memo) *CollaborationUpdate

SetMemo sets the "memo" edge to the Memo entity.

func (*CollaborationUpdate) SetMemoID

SetMemoID sets the "memo_id" field.

func (*CollaborationUpdate) SetNillableApproved

func (cu *CollaborationUpdate) SetNillableApproved(b *bool) *CollaborationUpdate

SetNillableApproved sets the "approved" field if the given value is not nil.

func (*CollaborationUpdate) SetNillableMemoID

func (cu *CollaborationUpdate) SetNillableMemoID(u *uuid.UUID) *CollaborationUpdate

SetNillableMemoID sets the "memo_id" field if the given value is not nil.

func (*CollaborationUpdate) SetNillableUpdateTime

func (cu *CollaborationUpdate) SetNillableUpdateTime(t *time.Time) *CollaborationUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CollaborationUpdate) SetNillableUserID

func (cu *CollaborationUpdate) SetNillableUserID(u *uuid.UUID) *CollaborationUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CollaborationUpdate) SetUpdateTime

func (cu *CollaborationUpdate) SetUpdateTime(t time.Time) *CollaborationUpdate

SetUpdateTime sets the "update_time" field.

func (*CollaborationUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*CollaborationUpdate) Where

Where appends a list predicates to the CollaborationUpdate builder.

type CollaborationUpdateOne

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

CollaborationUpdateOne is the builder for updating a single Collaboration entity.

func (*CollaborationUpdateOne) ClearCollaborator

func (cuo *CollaborationUpdateOne) ClearCollaborator() *CollaborationUpdateOne

ClearCollaborator clears the "collaborator" edge to the User entity.

func (*CollaborationUpdateOne) ClearMemo

ClearMemo clears the "memo" edge to the Memo entity.

func (*CollaborationUpdateOne) Exec

Exec executes the query on the entity.

func (*CollaborationUpdateOne) ExecContext

func (c *CollaborationUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CollaborationUpdateOne) ExecX

func (cuo *CollaborationUpdateOne) ExecX(ctx context.Context)

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

func (*CollaborationUpdateOne) Mutation

Mutation returns the CollaborationMutation object of the builder.

func (*CollaborationUpdateOne) QueryContext

func (c *CollaborationUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CollaborationUpdateOne) Save

Save executes the query and returns the updated Collaboration entity.

func (*CollaborationUpdateOne) SaveX

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

func (*CollaborationUpdateOne) Select

func (cuo *CollaborationUpdateOne) Select(field string, fields ...string) *CollaborationUpdateOne

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

func (*CollaborationUpdateOne) SetApproved

func (cuo *CollaborationUpdateOne) SetApproved(b bool) *CollaborationUpdateOne

SetApproved sets the "approved" field.

func (*CollaborationUpdateOne) SetCollaborator

func (cuo *CollaborationUpdateOne) SetCollaborator(u *User) *CollaborationUpdateOne

SetCollaborator sets the "collaborator" edge to the User entity.

func (*CollaborationUpdateOne) SetCollaboratorID

func (cuo *CollaborationUpdateOne) SetCollaboratorID(id uuid.UUID) *CollaborationUpdateOne

SetCollaboratorID sets the "collaborator" edge to the User entity by ID.

func (*CollaborationUpdateOne) SetMemo

SetMemo sets the "memo" edge to the Memo entity.

func (*CollaborationUpdateOne) SetMemoID

SetMemoID sets the "memo_id" field.

func (*CollaborationUpdateOne) SetNillableApproved

func (cuo *CollaborationUpdateOne) SetNillableApproved(b *bool) *CollaborationUpdateOne

SetNillableApproved sets the "approved" field if the given value is not nil.

func (*CollaborationUpdateOne) SetNillableMemoID

func (cuo *CollaborationUpdateOne) SetNillableMemoID(u *uuid.UUID) *CollaborationUpdateOne

SetNillableMemoID sets the "memo_id" field if the given value is not nil.

func (*CollaborationUpdateOne) SetNillableUpdateTime

func (cuo *CollaborationUpdateOne) SetNillableUpdateTime(t *time.Time) *CollaborationUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CollaborationUpdateOne) SetNillableUserID

func (cuo *CollaborationUpdateOne) SetNillableUserID(u *uuid.UUID) *CollaborationUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CollaborationUpdateOne) SetUpdateTime

func (cuo *CollaborationUpdateOne) SetUpdateTime(t time.Time) *CollaborationUpdateOne

SetUpdateTime sets the "update_time" field.

func (*CollaborationUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*CollaborationUpdateOne) Where

Where appends a list predicates to the CollaborationUpdate builder.

type CollaborationUpsert

type CollaborationUpsert struct {
	*sql.UpdateSet
}

CollaborationUpsert is the "OnConflict" setter.

func (*CollaborationUpsert) SetApproved

func (u *CollaborationUpsert) SetApproved(v bool) *CollaborationUpsert

SetApproved sets the "approved" field.

func (*CollaborationUpsert) SetMemoID

SetMemoID sets the "memo_id" field.

func (*CollaborationUpsert) SetUpdateTime

func (u *CollaborationUpsert) SetUpdateTime(v time.Time) *CollaborationUpsert

SetUpdateTime sets the "update_time" field.

func (*CollaborationUpsert) SetUserID

SetUserID sets the "user_id" field.

func (*CollaborationUpsert) UpdateApproved

func (u *CollaborationUpsert) UpdateApproved() *CollaborationUpsert

UpdateApproved sets the "approved" field to the value that was provided on create.

func (*CollaborationUpsert) UpdateMemoID

func (u *CollaborationUpsert) UpdateMemoID() *CollaborationUpsert

UpdateMemoID sets the "memo_id" field to the value that was provided on create.

func (*CollaborationUpsert) UpdateUpdateTime

func (u *CollaborationUpsert) UpdateUpdateTime() *CollaborationUpsert

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*CollaborationUpsert) UpdateUserID

func (u *CollaborationUpsert) UpdateUserID() *CollaborationUpsert

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

type CollaborationUpsertBulk

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

CollaborationUpsertBulk is the builder for "upsert"-ing a bulk of Collaboration nodes.

func (*CollaborationUpsertBulk) DoNothing

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

func (*CollaborationUpsertBulk) Exec

Exec executes the query.

func (*CollaborationUpsertBulk) ExecX

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

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

func (*CollaborationUpsertBulk) Ignore

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

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

func (*CollaborationUpsertBulk) SetApproved

SetApproved sets the "approved" field.

func (*CollaborationUpsertBulk) SetMemoID

SetMemoID sets the "memo_id" field.

func (*CollaborationUpsertBulk) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*CollaborationUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*CollaborationUpsertBulk) Update

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

func (*CollaborationUpsertBulk) UpdateApproved

func (u *CollaborationUpsertBulk) UpdateApproved() *CollaborationUpsertBulk

UpdateApproved sets the "approved" field to the value that was provided on create.

func (*CollaborationUpsertBulk) UpdateMemoID

UpdateMemoID sets the "memo_id" field to the value that was provided on create.

func (*CollaborationUpsertBulk) UpdateNewValues

func (u *CollaborationUpsertBulk) UpdateNewValues() *CollaborationUpsertBulk

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

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

func (*CollaborationUpsertBulk) UpdateUpdateTime

func (u *CollaborationUpsertBulk) UpdateUpdateTime() *CollaborationUpsertBulk

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*CollaborationUpsertBulk) UpdateUserID

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

type CollaborationUpsertOne

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

CollaborationUpsertOne is the builder for "upsert"-ing

one Collaboration node.

func (*CollaborationUpsertOne) DoNothing

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

func (*CollaborationUpsertOne) Exec

Exec executes the query.

func (*CollaborationUpsertOne) ExecX

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

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

func (*CollaborationUpsertOne) ID

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

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

func (*CollaborationUpsertOne) IDX

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

func (*CollaborationUpsertOne) Ignore

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

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

func (*CollaborationUpsertOne) SetApproved

SetApproved sets the "approved" field.

func (*CollaborationUpsertOne) SetMemoID

SetMemoID sets the "memo_id" field.

func (*CollaborationUpsertOne) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*CollaborationUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*CollaborationUpsertOne) Update

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

func (*CollaborationUpsertOne) UpdateApproved

func (u *CollaborationUpsertOne) UpdateApproved() *CollaborationUpsertOne

UpdateApproved sets the "approved" field to the value that was provided on create.

func (*CollaborationUpsertOne) UpdateMemoID

UpdateMemoID sets the "memo_id" field to the value that was provided on create.

func (*CollaborationUpsertOne) UpdateNewValues

func (u *CollaborationUpsertOne) UpdateNewValues() *CollaborationUpsertOne

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

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

func (*CollaborationUpsertOne) UpdateUpdateTime

func (u *CollaborationUpsertOne) UpdateUpdateTime() *CollaborationUpsertOne

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*CollaborationUpsertOne) UpdateUserID

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

type Collaborations

type Collaborations []*Collaboration

Collaborations is a parsable slice of Collaboration.

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 Memo

type Memo struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID uuid.UUID `json:"owner_id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// IsPublished holds the value of the "is_published" field.
	IsPublished bool `json:"is_published,omitempty"`
	// Version holds the value of the "version" field.
	Version int `json:"version,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemoQuery when eager-loading is set.
	Edges MemoEdges `json:"edges"`
	// contains filtered or unexported fields
}

Memo is the model entity for the Memo schema.

func (*Memo) ExecContext

func (c *Memo) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Memo) QueryCollaborations

func (m *Memo) QueryCollaborations() *CollaborationQuery

QueryCollaborations queries the "collaborations" edge of the Memo entity.

func (*Memo) QueryCollaborators

func (m *Memo) QueryCollaborators() *UserQuery

QueryCollaborators queries the "collaborators" edge of the Memo entity.

func (*Memo) QueryContext

func (c *Memo) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Memo) QueryOwner

func (m *Memo) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Memo entity.

func (*Memo) QuerySubscribers

func (m *Memo) QuerySubscribers() *UserQuery

QuerySubscribers queries the "subscribers" edge of the Memo entity.

func (*Memo) QuerySubscriptions

func (m *Memo) QuerySubscriptions() *SubscriptionQuery

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

func (*Memo) QueryTags

func (m *Memo) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Memo entity.

func (*Memo) String

func (m *Memo) String() string

String implements the fmt.Stringer.

func (*Memo) Unwrap

func (m *Memo) Unwrap() *Memo

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

func (m *Memo) Update() *MemoUpdateOne

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

func (*Memo) Value

func (m *Memo) Value(name string) (ent.Value, error)

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

type MemoClient

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

MemoClient is a client for the Memo schema.

func NewMemoClient

func NewMemoClient(c config) *MemoClient

NewMemoClient returns a client for the Memo from the given config.

func (*MemoClient) Create

func (c *MemoClient) Create() *MemoCreate

Create returns a builder for creating a Memo entity.

func (*MemoClient) CreateBulk

func (c *MemoClient) CreateBulk(builders ...*MemoCreate) *MemoCreateBulk

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

func (*MemoClient) Delete

func (c *MemoClient) Delete() *MemoDelete

Delete returns a delete builder for Memo.

func (*MemoClient) DeleteOne

func (c *MemoClient) DeleteOne(m *Memo) *MemoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MemoClient) DeleteOneID

func (c *MemoClient) DeleteOneID(id uuid.UUID) *MemoDeleteOne

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

func (*MemoClient) ExecContext

func (c *MemoClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoClient) Get

func (c *MemoClient) Get(ctx context.Context, id uuid.UUID) (*Memo, error)

Get returns a Memo entity by its id.

func (*MemoClient) GetX

func (c *MemoClient) GetX(ctx context.Context, id uuid.UUID) *Memo

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

func (*MemoClient) Hooks

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

Hooks returns the client hooks.

func (*MemoClient) Intercept

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

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

func (*MemoClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MemoClient) MapCreateBulk

func (c *MemoClient) MapCreateBulk(slice any, setFunc func(*MemoCreate, int)) *MemoCreateBulk

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

func (c *MemoClient) Query() *MemoQuery

Query returns a query builder for Memo.

func (*MemoClient) QueryCollaborations

func (c *MemoClient) QueryCollaborations(m *Memo) *CollaborationQuery

QueryCollaborations queries the collaborations edge of a Memo.

func (*MemoClient) QueryCollaborators

func (c *MemoClient) QueryCollaborators(m *Memo) *UserQuery

QueryCollaborators queries the collaborators edge of a Memo.

func (*MemoClient) QueryContext

func (c *MemoClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoClient) QueryOwner

func (c *MemoClient) QueryOwner(m *Memo) *UserQuery

QueryOwner queries the owner edge of a Memo.

func (*MemoClient) QuerySubscribers

func (c *MemoClient) QuerySubscribers(m *Memo) *UserQuery

QuerySubscribers queries the subscribers edge of a Memo.

func (*MemoClient) QuerySubscriptions

func (c *MemoClient) QuerySubscriptions(m *Memo) *SubscriptionQuery

QuerySubscriptions queries the subscriptions edge of a Memo.

func (*MemoClient) QueryTags

func (c *MemoClient) QueryTags(m *Memo) *TagQuery

QueryTags queries the tags edge of a Memo.

func (*MemoClient) Update

func (c *MemoClient) Update() *MemoUpdate

Update returns an update builder for Memo.

func (*MemoClient) UpdateOne

func (c *MemoClient) UpdateOne(m *Memo) *MemoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MemoClient) UpdateOneID

func (c *MemoClient) UpdateOneID(id uuid.UUID) *MemoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemoClient) Use

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

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

type MemoCreate

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

MemoCreate is the builder for creating a Memo entity.

func (*MemoCreate) AddCollaborationIDs

func (mc *MemoCreate) AddCollaborationIDs(ids ...int) *MemoCreate

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by IDs.

func (*MemoCreate) AddCollaborations

func (mc *MemoCreate) AddCollaborations(c ...*Collaboration) *MemoCreate

AddCollaborations adds the "collaborations" edges to the Collaboration entity.

func (*MemoCreate) AddCollaboratorIDs

func (mc *MemoCreate) AddCollaboratorIDs(ids ...uuid.UUID) *MemoCreate

AddCollaboratorIDs adds the "collaborators" edge to the User entity by IDs.

func (*MemoCreate) AddCollaborators

func (mc *MemoCreate) AddCollaborators(u ...*User) *MemoCreate

AddCollaborators adds the "collaborators" edges to the User entity.

func (*MemoCreate) AddSubscriberIDs

func (mc *MemoCreate) AddSubscriberIDs(ids ...uuid.UUID) *MemoCreate

AddSubscriberIDs adds the "subscribers" edge to the User entity by IDs.

func (*MemoCreate) AddSubscribers

func (mc *MemoCreate) AddSubscribers(u ...*User) *MemoCreate

AddSubscribers adds the "subscribers" edges to the User entity.

func (*MemoCreate) AddSubscriptionIDs

func (mc *MemoCreate) AddSubscriptionIDs(ids ...int) *MemoCreate

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

func (*MemoCreate) AddSubscriptions

func (mc *MemoCreate) AddSubscriptions(s ...*Subscription) *MemoCreate

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

func (*MemoCreate) AddTagIDs

func (mc *MemoCreate) AddTagIDs(ids ...int) *MemoCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*MemoCreate) AddTags

func (mc *MemoCreate) AddTags(t ...*Tag) *MemoCreate

AddTags adds the "tags" edges to the Tag entity.

func (*MemoCreate) Exec

func (mc *MemoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemoCreate) ExecContext

func (c *MemoCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoCreate) ExecX

func (mc *MemoCreate) ExecX(ctx context.Context)

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

func (*MemoCreate) Mutation

func (mc *MemoCreate) Mutation() *MemoMutation

Mutation returns the MemoMutation object of the builder.

func (*MemoCreate) OnConflict

func (mc *MemoCreate) OnConflict(opts ...sql.ConflictOption) *MemoUpsertOne

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

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

func (*MemoCreate) OnConflictColumns

func (mc *MemoCreate) OnConflictColumns(columns ...string) *MemoUpsertOne

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

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

func (*MemoCreate) QueryContext

func (c *MemoCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoCreate) Save

func (mc *MemoCreate) Save(ctx context.Context) (*Memo, error)

Save creates the Memo in the database.

func (*MemoCreate) SaveX

func (mc *MemoCreate) SaveX(ctx context.Context) *Memo

SaveX calls Save and panics if Save returns an error.

func (*MemoCreate) SetContent

func (mc *MemoCreate) SetContent(s string) *MemoCreate

SetContent sets the "content" field.

func (*MemoCreate) SetCreateTime

func (mc *MemoCreate) SetCreateTime(t time.Time) *MemoCreate

SetCreateTime sets the "create_time" field.

func (*MemoCreate) SetID

func (mc *MemoCreate) SetID(u uuid.UUID) *MemoCreate

SetID sets the "id" field.

func (*MemoCreate) SetIsPublished

func (mc *MemoCreate) SetIsPublished(b bool) *MemoCreate

SetIsPublished sets the "is_published" field.

func (*MemoCreate) SetNillableCreateTime

func (mc *MemoCreate) SetNillableCreateTime(t *time.Time) *MemoCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MemoCreate) SetNillableID

func (mc *MemoCreate) SetNillableID(u *uuid.UUID) *MemoCreate

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

func (*MemoCreate) SetNillableIsPublished

func (mc *MemoCreate) SetNillableIsPublished(b *bool) *MemoCreate

SetNillableIsPublished sets the "is_published" field if the given value is not nil.

func (*MemoCreate) SetNillableUpdateTime

func (mc *MemoCreate) SetNillableUpdateTime(t *time.Time) *MemoCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MemoCreate) SetNillableVersion

func (mc *MemoCreate) SetNillableVersion(i *int) *MemoCreate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MemoCreate) SetOwner

func (mc *MemoCreate) SetOwner(u *User) *MemoCreate

SetOwner sets the "owner" edge to the User entity.

func (*MemoCreate) SetOwnerID

func (mc *MemoCreate) SetOwnerID(u uuid.UUID) *MemoCreate

SetOwnerID sets the "owner_id" field.

func (*MemoCreate) SetTitle

func (mc *MemoCreate) SetTitle(s string) *MemoCreate

SetTitle sets the "title" field.

func (*MemoCreate) SetUpdateTime

func (mc *MemoCreate) SetUpdateTime(t time.Time) *MemoCreate

SetUpdateTime sets the "update_time" field.

func (*MemoCreate) SetVersion

func (mc *MemoCreate) SetVersion(i int) *MemoCreate

SetVersion sets the "version" field.

type MemoCreateBulk

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

MemoCreateBulk is the builder for creating many Memo entities in bulk.

func (*MemoCreateBulk) Exec

func (mcb *MemoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemoCreateBulk) ExecContext

func (c *MemoCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoCreateBulk) ExecX

func (mcb *MemoCreateBulk) ExecX(ctx context.Context)

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

func (*MemoCreateBulk) OnConflict

func (mcb *MemoCreateBulk) OnConflict(opts ...sql.ConflictOption) *MemoUpsertBulk

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

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

func (*MemoCreateBulk) OnConflictColumns

func (mcb *MemoCreateBulk) OnConflictColumns(columns ...string) *MemoUpsertBulk

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

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

func (*MemoCreateBulk) QueryContext

func (c *MemoCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoCreateBulk) Save

func (mcb *MemoCreateBulk) Save(ctx context.Context) ([]*Memo, error)

Save creates the Memo entities in the database.

func (*MemoCreateBulk) SaveX

func (mcb *MemoCreateBulk) SaveX(ctx context.Context) []*Memo

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

type MemoDelete

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

MemoDelete is the builder for deleting a Memo entity.

func (*MemoDelete) Exec

func (md *MemoDelete) Exec(ctx context.Context) (int, error)

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

func (*MemoDelete) ExecContext

func (c *MemoDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoDelete) ExecX

func (md *MemoDelete) ExecX(ctx context.Context) int

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

func (*MemoDelete) QueryContext

func (c *MemoDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoDelete) Where

func (md *MemoDelete) Where(ps ...predicate.Memo) *MemoDelete

Where appends a list predicates to the MemoDelete builder.

type MemoDeleteOne

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

MemoDeleteOne is the builder for deleting a single Memo entity.

func (*MemoDeleteOne) Exec

func (mdo *MemoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MemoDeleteOne) ExecX

func (mdo *MemoDeleteOne) ExecX(ctx context.Context)

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

func (*MemoDeleteOne) Where

func (mdo *MemoDeleteOne) Where(ps ...predicate.Memo) *MemoDeleteOne

Where appends a list predicates to the MemoDelete builder.

type MemoEdges

type MemoEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// Subscribers holds the value of the subscribers edge.
	Subscribers []*User `json:"subscribers,omitempty"`
	// Collaborators holds the value of the collaborators edge.
	Collaborators []*User `json:"collaborators,omitempty"`
	// Subscriptions holds the value of the subscriptions edge.
	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
	// Collaborations holds the value of the collaborations edge.
	Collaborations []*Collaboration `json:"collaborations,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemoEdges) CollaborationsOrErr

func (e MemoEdges) CollaborationsOrErr() ([]*Collaboration, error)

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

func (MemoEdges) CollaboratorsOrErr

func (e MemoEdges) CollaboratorsOrErr() ([]*User, error)

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

func (MemoEdges) OwnerOrErr

func (e MemoEdges) OwnerOrErr() (*User, error)

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

func (MemoEdges) SubscribersOrErr

func (e MemoEdges) SubscribersOrErr() ([]*User, error)

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

func (MemoEdges) SubscriptionsOrErr

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

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

func (MemoEdges) TagsOrErr

func (e MemoEdges) TagsOrErr() ([]*Tag, error)

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

type MemoGroupBy

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

MemoGroupBy is the group-by builder for Memo entities.

func (*MemoGroupBy) Aggregate

func (mgb *MemoGroupBy) Aggregate(fns ...AggregateFunc) *MemoGroupBy

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

func (*MemoGroupBy) Bool

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

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

func (*MemoGroupBy) BoolX

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

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

func (*MemoGroupBy) Bools

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

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

func (*MemoGroupBy) BoolsX

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

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

func (*MemoGroupBy) Float64

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

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

func (*MemoGroupBy) Float64X

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

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

func (*MemoGroupBy) Float64s

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

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

func (*MemoGroupBy) Float64sX

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

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

func (*MemoGroupBy) Int

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

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

func (*MemoGroupBy) IntX

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

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

func (*MemoGroupBy) Ints

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

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

func (*MemoGroupBy) IntsX

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

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

func (*MemoGroupBy) Scan

func (mgb *MemoGroupBy) Scan(ctx context.Context, v any) error

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

func (*MemoGroupBy) ScanX

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

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

func (*MemoGroupBy) String

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

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

func (*MemoGroupBy) StringX

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

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

func (*MemoGroupBy) Strings

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

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

func (*MemoGroupBy) StringsX

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

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

type MemoMutation

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

MemoMutation represents an operation that mutates the Memo nodes in the graph.

func (*MemoMutation) AddCollaborationIDs

func (m *MemoMutation) AddCollaborationIDs(ids ...int)

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by ids.

func (*MemoMutation) AddCollaboratorIDs

func (m *MemoMutation) AddCollaboratorIDs(ids ...uuid.UUID)

AddCollaboratorIDs adds the "collaborators" edge to the User entity by ids.

func (*MemoMutation) AddField

func (m *MemoMutation) 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 (*MemoMutation) AddSubscriberIDs

func (m *MemoMutation) AddSubscriberIDs(ids ...uuid.UUID)

AddSubscriberIDs adds the "subscribers" edge to the User entity by ids.

func (*MemoMutation) AddSubscriptionIDs

func (m *MemoMutation) AddSubscriptionIDs(ids ...int)

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

func (*MemoMutation) AddTagIDs

func (m *MemoMutation) AddTagIDs(ids ...int)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*MemoMutation) AddVersion

func (m *MemoMutation) AddVersion(i int)

AddVersion adds i to the "version" field.

func (*MemoMutation) AddedEdges

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

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

func (*MemoMutation) AddedField

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

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

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

func (*MemoMutation) AddedIDs

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

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

func (*MemoMutation) AddedVersion

func (m *MemoMutation) AddedVersion() (r int, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*MemoMutation) ClearCollaborations

func (m *MemoMutation) ClearCollaborations()

ClearCollaborations clears the "collaborations" edge to the Collaboration entity.

func (*MemoMutation) ClearCollaborators

func (m *MemoMutation) ClearCollaborators()

ClearCollaborators clears the "collaborators" edge to the User entity.

func (*MemoMutation) ClearEdge

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

func (m *MemoMutation) 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 (*MemoMutation) ClearOwner

func (m *MemoMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*MemoMutation) ClearSubscribers

func (m *MemoMutation) ClearSubscribers()

ClearSubscribers clears the "subscribers" edge to the User entity.

func (*MemoMutation) ClearSubscriptions

func (m *MemoMutation) ClearSubscriptions()

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

func (*MemoMutation) ClearTags

func (m *MemoMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*MemoMutation) ClearedEdges

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

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

func (*MemoMutation) ClearedFields

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

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

func (MemoMutation) Client

func (m MemoMutation) 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 (*MemoMutation) CollaborationsCleared

func (m *MemoMutation) CollaborationsCleared() bool

CollaborationsCleared reports if the "collaborations" edge to the Collaboration entity was cleared.

func (*MemoMutation) CollaborationsIDs

func (m *MemoMutation) CollaborationsIDs() (ids []int)

CollaborationsIDs returns the "collaborations" edge IDs in the mutation.

func (*MemoMutation) CollaboratorsCleared

func (m *MemoMutation) CollaboratorsCleared() bool

CollaboratorsCleared reports if the "collaborators" edge to the User entity was cleared.

func (*MemoMutation) CollaboratorsIDs

func (m *MemoMutation) CollaboratorsIDs() (ids []uuid.UUID)

CollaboratorsIDs returns the "collaborators" edge IDs in the mutation.

func (*MemoMutation) Content

func (m *MemoMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*MemoMutation) CreateTime

func (m *MemoMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MemoMutation) EdgeCleared

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

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

func (*MemoMutation) ExecContext

func (c *MemoMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoMutation) Field

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

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

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

func (*MemoMutation) Fields

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

func (m *MemoMutation) ID() (id uuid.UUID, exists bool)

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

func (*MemoMutation) IDs

func (m *MemoMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*MemoMutation) IsPublished

func (m *MemoMutation) IsPublished() (r bool, exists bool)

IsPublished returns the value of the "is_published" field in the mutation.

func (*MemoMutation) OldContent

func (m *MemoMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Memo entity. If the Memo 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 (*MemoMutation) OldCreateTime

func (m *MemoMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Memo entity. If the Memo 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 (*MemoMutation) OldField

func (m *MemoMutation) 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 (*MemoMutation) OldIsPublished

func (m *MemoMutation) OldIsPublished(ctx context.Context) (v bool, err error)

OldIsPublished returns the old "is_published" field's value of the Memo entity. If the Memo 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 (*MemoMutation) OldOwnerID

func (m *MemoMutation) OldOwnerID(ctx context.Context) (v uuid.UUID, err error)

OldOwnerID returns the old "owner_id" field's value of the Memo entity. If the Memo 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 (*MemoMutation) OldTitle

func (m *MemoMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Memo entity. If the Memo 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 (*MemoMutation) OldUpdateTime

func (m *MemoMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Memo entity. If the Memo 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 (*MemoMutation) OldVersion

func (m *MemoMutation) OldVersion(ctx context.Context) (v int, err error)

OldVersion returns the old "version" field's value of the Memo entity. If the Memo 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 (*MemoMutation) Op

func (m *MemoMutation) Op() Op

Op returns the operation name.

func (*MemoMutation) OwnerCleared

func (m *MemoMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*MemoMutation) OwnerID

func (m *MemoMutation) OwnerID() (r uuid.UUID, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*MemoMutation) OwnerIDs

func (m *MemoMutation) OwnerIDs() (ids []uuid.UUID)

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

func (*MemoMutation) QueryContext

func (c *MemoMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoMutation) RemoveCollaborationIDs

func (m *MemoMutation) RemoveCollaborationIDs(ids ...int)

RemoveCollaborationIDs removes the "collaborations" edge to the Collaboration entity by IDs.

func (*MemoMutation) RemoveCollaboratorIDs

func (m *MemoMutation) RemoveCollaboratorIDs(ids ...uuid.UUID)

RemoveCollaboratorIDs removes the "collaborators" edge to the User entity by IDs.

func (*MemoMutation) RemoveSubscriberIDs

func (m *MemoMutation) RemoveSubscriberIDs(ids ...uuid.UUID)

RemoveSubscriberIDs removes the "subscribers" edge to the User entity by IDs.

func (*MemoMutation) RemoveSubscriptionIDs

func (m *MemoMutation) RemoveSubscriptionIDs(ids ...int)

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

func (*MemoMutation) RemoveTagIDs

func (m *MemoMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*MemoMutation) RemovedCollaborationsIDs

func (m *MemoMutation) RemovedCollaborationsIDs() (ids []int)

RemovedCollaborations returns the removed IDs of the "collaborations" edge to the Collaboration entity.

func (*MemoMutation) RemovedCollaboratorsIDs

func (m *MemoMutation) RemovedCollaboratorsIDs() (ids []uuid.UUID)

RemovedCollaborators returns the removed IDs of the "collaborators" edge to the User entity.

func (*MemoMutation) RemovedEdges

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

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

func (*MemoMutation) RemovedIDs

func (m *MemoMutation) 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 (*MemoMutation) RemovedSubscribersIDs

func (m *MemoMutation) RemovedSubscribersIDs() (ids []uuid.UUID)

RemovedSubscribers returns the removed IDs of the "subscribers" edge to the User entity.

func (*MemoMutation) RemovedSubscriptionsIDs

func (m *MemoMutation) RemovedSubscriptionsIDs() (ids []int)

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

func (*MemoMutation) RemovedTagsIDs

func (m *MemoMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*MemoMutation) ResetCollaborations

func (m *MemoMutation) ResetCollaborations()

ResetCollaborations resets all changes to the "collaborations" edge.

func (*MemoMutation) ResetCollaborators

func (m *MemoMutation) ResetCollaborators()

ResetCollaborators resets all changes to the "collaborators" edge.

func (*MemoMutation) ResetContent

func (m *MemoMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*MemoMutation) ResetCreateTime

func (m *MemoMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MemoMutation) ResetEdge

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

func (m *MemoMutation) 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 (*MemoMutation) ResetIsPublished

func (m *MemoMutation) ResetIsPublished()

ResetIsPublished resets all changes to the "is_published" field.

func (*MemoMutation) ResetOwner

func (m *MemoMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*MemoMutation) ResetOwnerID

func (m *MemoMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*MemoMutation) ResetSubscribers

func (m *MemoMutation) ResetSubscribers()

ResetSubscribers resets all changes to the "subscribers" edge.

func (*MemoMutation) ResetSubscriptions

func (m *MemoMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*MemoMutation) ResetTags

func (m *MemoMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*MemoMutation) ResetTitle

func (m *MemoMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*MemoMutation) ResetUpdateTime

func (m *MemoMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MemoMutation) ResetVersion

func (m *MemoMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*MemoMutation) SetContent

func (m *MemoMutation) SetContent(s string)

SetContent sets the "content" field.

func (*MemoMutation) SetCreateTime

func (m *MemoMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MemoMutation) SetField

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

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

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

func (*MemoMutation) SetIsPublished

func (m *MemoMutation) SetIsPublished(b bool)

SetIsPublished sets the "is_published" field.

func (*MemoMutation) SetOp

func (m *MemoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MemoMutation) SetOwnerID

func (m *MemoMutation) SetOwnerID(u uuid.UUID)

SetOwnerID sets the "owner_id" field.

func (*MemoMutation) SetTitle

func (m *MemoMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*MemoMutation) SetUpdateTime

func (m *MemoMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*MemoMutation) SetVersion

func (m *MemoMutation) SetVersion(i int)

SetVersion sets the "version" field.

func (*MemoMutation) SubscribersCleared

func (m *MemoMutation) SubscribersCleared() bool

SubscribersCleared reports if the "subscribers" edge to the User entity was cleared.

func (*MemoMutation) SubscribersIDs

func (m *MemoMutation) SubscribersIDs() (ids []uuid.UUID)

SubscribersIDs returns the "subscribers" edge IDs in the mutation.

func (*MemoMutation) SubscriptionsCleared

func (m *MemoMutation) SubscriptionsCleared() bool

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

func (*MemoMutation) SubscriptionsIDs

func (m *MemoMutation) SubscriptionsIDs() (ids []int)

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

func (*MemoMutation) TagsCleared

func (m *MemoMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*MemoMutation) TagsIDs

func (m *MemoMutation) TagsIDs() (ids []int)

TagsIDs returns the "tags" edge IDs in the mutation.

func (*MemoMutation) Title

func (m *MemoMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (MemoMutation) Tx

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

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

func (*MemoMutation) Type

func (m *MemoMutation) Type() string

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

func (*MemoMutation) UpdateTime

func (m *MemoMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MemoMutation) Version

func (m *MemoMutation) Version() (r int, exists bool)

Version returns the value of the "version" field in the mutation.

func (*MemoMutation) Where

func (m *MemoMutation) Where(ps ...predicate.Memo)

Where appends a list predicates to the MemoMutation builder.

func (*MemoMutation) WhereP

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

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

type MemoQuery

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

MemoQuery is the builder for querying Memo entities.

func (*MemoQuery) Aggregate

func (mq *MemoQuery) Aggregate(fns ...AggregateFunc) *MemoSelect

Aggregate returns a MemoSelect configured with the given aggregations.

func (*MemoQuery) All

func (mq *MemoQuery) All(ctx context.Context) ([]*Memo, error)

All executes the query and returns a list of Memos.

func (*MemoQuery) AllX

func (mq *MemoQuery) AllX(ctx context.Context) []*Memo

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

func (*MemoQuery) Clone

func (mq *MemoQuery) Clone() *MemoQuery

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

func (*MemoQuery) Count

func (mq *MemoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemoQuery) CountX

func (mq *MemoQuery) CountX(ctx context.Context) int

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

func (*MemoQuery) ExecContext

func (c *MemoQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoQuery) Exist

func (mq *MemoQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemoQuery) ExistX

func (mq *MemoQuery) ExistX(ctx context.Context) bool

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

func (*MemoQuery) First

func (mq *MemoQuery) First(ctx context.Context) (*Memo, error)

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

func (*MemoQuery) FirstID

func (mq *MemoQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*MemoQuery) FirstIDX

func (mq *MemoQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*MemoQuery) FirstX

func (mq *MemoQuery) FirstX(ctx context.Context) *Memo

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

func (*MemoQuery) GroupBy

func (mq *MemoQuery) GroupBy(field string, fields ...string) *MemoGroupBy

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 {
	OwnerID uuid.UUID `json:"owner_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Memo.Query().
	GroupBy(memo.FieldOwnerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MemoQuery) IDs

func (mq *MemoQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*MemoQuery) IDsX

func (mq *MemoQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*MemoQuery) Limit

func (mq *MemoQuery) Limit(limit int) *MemoQuery

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

func (*MemoQuery) Offset

func (mq *MemoQuery) Offset(offset int) *MemoQuery

Offset to start from.

func (*MemoQuery) Only

func (mq *MemoQuery) Only(ctx context.Context) (*Memo, error)

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

func (*MemoQuery) OnlyID

func (mq *MemoQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*MemoQuery) OnlyIDX

func (mq *MemoQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*MemoQuery) OnlyX

func (mq *MemoQuery) OnlyX(ctx context.Context) *Memo

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

func (*MemoQuery) Order

func (mq *MemoQuery) Order(o ...memo.OrderOption) *MemoQuery

Order specifies how the records should be ordered.

func (*MemoQuery) QueryCollaborations

func (mq *MemoQuery) QueryCollaborations() *CollaborationQuery

QueryCollaborations chains the current query on the "collaborations" edge.

func (*MemoQuery) QueryCollaborators

func (mq *MemoQuery) QueryCollaborators() *UserQuery

QueryCollaborators chains the current query on the "collaborators" edge.

func (*MemoQuery) QueryContext

func (c *MemoQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoQuery) QueryOwner

func (mq *MemoQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*MemoQuery) QuerySubscribers

func (mq *MemoQuery) QuerySubscribers() *UserQuery

QuerySubscribers chains the current query on the "subscribers" edge.

func (*MemoQuery) QuerySubscriptions

func (mq *MemoQuery) QuerySubscriptions() *SubscriptionQuery

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

func (*MemoQuery) QueryTags

func (mq *MemoQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*MemoQuery) Select

func (mq *MemoQuery) Select(fields ...string) *MemoSelect

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 {
	OwnerID uuid.UUID `json:"owner_id,omitempty"`
}

client.Memo.Query().
	Select(memo.FieldOwnerID).
	Scan(ctx, &v)

func (*MemoQuery) Unique

func (mq *MemoQuery) Unique(unique bool) *MemoQuery

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

func (mq *MemoQuery) Where(ps ...predicate.Memo) *MemoQuery

Where adds a new predicate for the MemoQuery builder.

func (*MemoQuery) WithCollaborations

func (mq *MemoQuery) WithCollaborations(opts ...func(*CollaborationQuery)) *MemoQuery

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

func (*MemoQuery) WithCollaborators

func (mq *MemoQuery) WithCollaborators(opts ...func(*UserQuery)) *MemoQuery

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

func (*MemoQuery) WithOwner

func (mq *MemoQuery) WithOwner(opts ...func(*UserQuery)) *MemoQuery

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

func (*MemoQuery) WithSubscribers

func (mq *MemoQuery) WithSubscribers(opts ...func(*UserQuery)) *MemoQuery

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

func (*MemoQuery) WithSubscriptions

func (mq *MemoQuery) WithSubscriptions(opts ...func(*SubscriptionQuery)) *MemoQuery

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

func (*MemoQuery) WithTags

func (mq *MemoQuery) WithTags(opts ...func(*TagQuery)) *MemoQuery

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

type MemoSelect

type MemoSelect struct {
	*MemoQuery
	// contains filtered or unexported fields
}

MemoSelect is the builder for selecting fields of Memo entities.

func (*MemoSelect) Aggregate

func (ms *MemoSelect) Aggregate(fns ...AggregateFunc) *MemoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MemoSelect) Bool

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

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

func (*MemoSelect) BoolX

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

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

func (*MemoSelect) Bools

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

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

func (*MemoSelect) BoolsX

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

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

func (MemoSelect) ExecContext

func (c MemoSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoSelect) Float64

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

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

func (*MemoSelect) Float64X

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

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

func (*MemoSelect) Float64s

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

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

func (*MemoSelect) Float64sX

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

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

func (*MemoSelect) Int

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

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

func (*MemoSelect) IntX

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

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

func (*MemoSelect) Ints

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

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

func (*MemoSelect) IntsX

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

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

func (MemoSelect) QueryContext

func (c MemoSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoSelect) Scan

func (ms *MemoSelect) Scan(ctx context.Context, v any) error

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

func (*MemoSelect) ScanX

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

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

func (*MemoSelect) String

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

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

func (*MemoSelect) StringX

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

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

func (*MemoSelect) Strings

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

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

func (*MemoSelect) StringsX

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

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

type MemoUpdate

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

MemoUpdate is the builder for updating Memo entities.

func (*MemoUpdate) AddCollaborationIDs

func (mu *MemoUpdate) AddCollaborationIDs(ids ...int) *MemoUpdate

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by IDs.

func (*MemoUpdate) AddCollaborations

func (mu *MemoUpdate) AddCollaborations(c ...*Collaboration) *MemoUpdate

AddCollaborations adds the "collaborations" edges to the Collaboration entity.

func (*MemoUpdate) AddCollaboratorIDs

func (mu *MemoUpdate) AddCollaboratorIDs(ids ...uuid.UUID) *MemoUpdate

AddCollaboratorIDs adds the "collaborators" edge to the User entity by IDs.

func (*MemoUpdate) AddCollaborators

func (mu *MemoUpdate) AddCollaborators(u ...*User) *MemoUpdate

AddCollaborators adds the "collaborators" edges to the User entity.

func (*MemoUpdate) AddSubscriberIDs

func (mu *MemoUpdate) AddSubscriberIDs(ids ...uuid.UUID) *MemoUpdate

AddSubscriberIDs adds the "subscribers" edge to the User entity by IDs.

func (*MemoUpdate) AddSubscribers

func (mu *MemoUpdate) AddSubscribers(u ...*User) *MemoUpdate

AddSubscribers adds the "subscribers" edges to the User entity.

func (*MemoUpdate) AddSubscriptionIDs

func (mu *MemoUpdate) AddSubscriptionIDs(ids ...int) *MemoUpdate

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

func (*MemoUpdate) AddSubscriptions

func (mu *MemoUpdate) AddSubscriptions(s ...*Subscription) *MemoUpdate

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

func (*MemoUpdate) AddTagIDs

func (mu *MemoUpdate) AddTagIDs(ids ...int) *MemoUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*MemoUpdate) AddTags

func (mu *MemoUpdate) AddTags(t ...*Tag) *MemoUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*MemoUpdate) AddVersion

func (mu *MemoUpdate) AddVersion(i int) *MemoUpdate

AddVersion adds i to the "version" field.

func (*MemoUpdate) ClearCollaborations

func (mu *MemoUpdate) ClearCollaborations() *MemoUpdate

ClearCollaborations clears all "collaborations" edges to the Collaboration entity.

func (*MemoUpdate) ClearCollaborators

func (mu *MemoUpdate) ClearCollaborators() *MemoUpdate

ClearCollaborators clears all "collaborators" edges to the User entity.

func (*MemoUpdate) ClearOwner

func (mu *MemoUpdate) ClearOwner() *MemoUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*MemoUpdate) ClearSubscribers

func (mu *MemoUpdate) ClearSubscribers() *MemoUpdate

ClearSubscribers clears all "subscribers" edges to the User entity.

func (*MemoUpdate) ClearSubscriptions

func (mu *MemoUpdate) ClearSubscriptions() *MemoUpdate

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

func (*MemoUpdate) ClearTags

func (mu *MemoUpdate) ClearTags() *MemoUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*MemoUpdate) Exec

func (mu *MemoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemoUpdate) ExecContext

func (c *MemoUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoUpdate) ExecX

func (mu *MemoUpdate) ExecX(ctx context.Context)

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

func (*MemoUpdate) Mutation

func (mu *MemoUpdate) Mutation() *MemoMutation

Mutation returns the MemoMutation object of the builder.

func (*MemoUpdate) QueryContext

func (c *MemoUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoUpdate) RemoveCollaborationIDs

func (mu *MemoUpdate) RemoveCollaborationIDs(ids ...int) *MemoUpdate

RemoveCollaborationIDs removes the "collaborations" edge to Collaboration entities by IDs.

func (*MemoUpdate) RemoveCollaborations

func (mu *MemoUpdate) RemoveCollaborations(c ...*Collaboration) *MemoUpdate

RemoveCollaborations removes "collaborations" edges to Collaboration entities.

func (*MemoUpdate) RemoveCollaboratorIDs

func (mu *MemoUpdate) RemoveCollaboratorIDs(ids ...uuid.UUID) *MemoUpdate

RemoveCollaboratorIDs removes the "collaborators" edge to User entities by IDs.

func (*MemoUpdate) RemoveCollaborators

func (mu *MemoUpdate) RemoveCollaborators(u ...*User) *MemoUpdate

RemoveCollaborators removes "collaborators" edges to User entities.

func (*MemoUpdate) RemoveSubscriberIDs

func (mu *MemoUpdate) RemoveSubscriberIDs(ids ...uuid.UUID) *MemoUpdate

RemoveSubscriberIDs removes the "subscribers" edge to User entities by IDs.

func (*MemoUpdate) RemoveSubscribers

func (mu *MemoUpdate) RemoveSubscribers(u ...*User) *MemoUpdate

RemoveSubscribers removes "subscribers" edges to User entities.

func (*MemoUpdate) RemoveSubscriptionIDs

func (mu *MemoUpdate) RemoveSubscriptionIDs(ids ...int) *MemoUpdate

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

func (*MemoUpdate) RemoveSubscriptions

func (mu *MemoUpdate) RemoveSubscriptions(s ...*Subscription) *MemoUpdate

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*MemoUpdate) RemoveTagIDs

func (mu *MemoUpdate) RemoveTagIDs(ids ...int) *MemoUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*MemoUpdate) RemoveTags

func (mu *MemoUpdate) RemoveTags(t ...*Tag) *MemoUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*MemoUpdate) Save

func (mu *MemoUpdate) Save(ctx context.Context) (int, error)

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

func (*MemoUpdate) SaveX

func (mu *MemoUpdate) SaveX(ctx context.Context) int

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

func (*MemoUpdate) SetContent

func (mu *MemoUpdate) SetContent(s string) *MemoUpdate

SetContent sets the "content" field.

func (*MemoUpdate) SetIsPublished

func (mu *MemoUpdate) SetIsPublished(b bool) *MemoUpdate

SetIsPublished sets the "is_published" field.

func (*MemoUpdate) SetNillableContent

func (mu *MemoUpdate) SetNillableContent(s *string) *MemoUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*MemoUpdate) SetNillableIsPublished

func (mu *MemoUpdate) SetNillableIsPublished(b *bool) *MemoUpdate

SetNillableIsPublished sets the "is_published" field if the given value is not nil.

func (*MemoUpdate) SetNillableOwnerID

func (mu *MemoUpdate) SetNillableOwnerID(u *uuid.UUID) *MemoUpdate

SetNillableOwnerID sets the "owner_id" field if the given value is not nil.

func (*MemoUpdate) SetNillableTitle

func (mu *MemoUpdate) SetNillableTitle(s *string) *MemoUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*MemoUpdate) SetNillableUpdateTime

func (mu *MemoUpdate) SetNillableUpdateTime(t *time.Time) *MemoUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MemoUpdate) SetNillableVersion

func (mu *MemoUpdate) SetNillableVersion(i *int) *MemoUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MemoUpdate) SetOwner

func (mu *MemoUpdate) SetOwner(u *User) *MemoUpdate

SetOwner sets the "owner" edge to the User entity.

func (*MemoUpdate) SetOwnerID

func (mu *MemoUpdate) SetOwnerID(u uuid.UUID) *MemoUpdate

SetOwnerID sets the "owner_id" field.

func (*MemoUpdate) SetTitle

func (mu *MemoUpdate) SetTitle(s string) *MemoUpdate

SetTitle sets the "title" field.

func (*MemoUpdate) SetUpdateTime

func (mu *MemoUpdate) SetUpdateTime(t time.Time) *MemoUpdate

SetUpdateTime sets the "update_time" field.

func (*MemoUpdate) SetVersion

func (mu *MemoUpdate) SetVersion(i int) *MemoUpdate

SetVersion sets the "version" field.

func (*MemoUpdate) Where

func (mu *MemoUpdate) Where(ps ...predicate.Memo) *MemoUpdate

Where appends a list predicates to the MemoUpdate builder.

type MemoUpdateOne

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

MemoUpdateOne is the builder for updating a single Memo entity.

func (*MemoUpdateOne) AddCollaborationIDs

func (muo *MemoUpdateOne) AddCollaborationIDs(ids ...int) *MemoUpdateOne

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by IDs.

func (*MemoUpdateOne) AddCollaborations

func (muo *MemoUpdateOne) AddCollaborations(c ...*Collaboration) *MemoUpdateOne

AddCollaborations adds the "collaborations" edges to the Collaboration entity.

func (*MemoUpdateOne) AddCollaboratorIDs

func (muo *MemoUpdateOne) AddCollaboratorIDs(ids ...uuid.UUID) *MemoUpdateOne

AddCollaboratorIDs adds the "collaborators" edge to the User entity by IDs.

func (*MemoUpdateOne) AddCollaborators

func (muo *MemoUpdateOne) AddCollaborators(u ...*User) *MemoUpdateOne

AddCollaborators adds the "collaborators" edges to the User entity.

func (*MemoUpdateOne) AddSubscriberIDs

func (muo *MemoUpdateOne) AddSubscriberIDs(ids ...uuid.UUID) *MemoUpdateOne

AddSubscriberIDs adds the "subscribers" edge to the User entity by IDs.

func (*MemoUpdateOne) AddSubscribers

func (muo *MemoUpdateOne) AddSubscribers(u ...*User) *MemoUpdateOne

AddSubscribers adds the "subscribers" edges to the User entity.

func (*MemoUpdateOne) AddSubscriptionIDs

func (muo *MemoUpdateOne) AddSubscriptionIDs(ids ...int) *MemoUpdateOne

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

func (*MemoUpdateOne) AddSubscriptions

func (muo *MemoUpdateOne) AddSubscriptions(s ...*Subscription) *MemoUpdateOne

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

func (*MemoUpdateOne) AddTagIDs

func (muo *MemoUpdateOne) AddTagIDs(ids ...int) *MemoUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*MemoUpdateOne) AddTags

func (muo *MemoUpdateOne) AddTags(t ...*Tag) *MemoUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*MemoUpdateOne) AddVersion

func (muo *MemoUpdateOne) AddVersion(i int) *MemoUpdateOne

AddVersion adds i to the "version" field.

func (*MemoUpdateOne) ClearCollaborations

func (muo *MemoUpdateOne) ClearCollaborations() *MemoUpdateOne

ClearCollaborations clears all "collaborations" edges to the Collaboration entity.

func (*MemoUpdateOne) ClearCollaborators

func (muo *MemoUpdateOne) ClearCollaborators() *MemoUpdateOne

ClearCollaborators clears all "collaborators" edges to the User entity.

func (*MemoUpdateOne) ClearOwner

func (muo *MemoUpdateOne) ClearOwner() *MemoUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*MemoUpdateOne) ClearSubscribers

func (muo *MemoUpdateOne) ClearSubscribers() *MemoUpdateOne

ClearSubscribers clears all "subscribers" edges to the User entity.

func (*MemoUpdateOne) ClearSubscriptions

func (muo *MemoUpdateOne) ClearSubscriptions() *MemoUpdateOne

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

func (*MemoUpdateOne) ClearTags

func (muo *MemoUpdateOne) ClearTags() *MemoUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*MemoUpdateOne) Exec

func (muo *MemoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemoUpdateOne) ExecContext

func (c *MemoUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MemoUpdateOne) ExecX

func (muo *MemoUpdateOne) ExecX(ctx context.Context)

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

func (*MemoUpdateOne) Mutation

func (muo *MemoUpdateOne) Mutation() *MemoMutation

Mutation returns the MemoMutation object of the builder.

func (*MemoUpdateOne) QueryContext

func (c *MemoUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MemoUpdateOne) RemoveCollaborationIDs

func (muo *MemoUpdateOne) RemoveCollaborationIDs(ids ...int) *MemoUpdateOne

RemoveCollaborationIDs removes the "collaborations" edge to Collaboration entities by IDs.

func (*MemoUpdateOne) RemoveCollaborations

func (muo *MemoUpdateOne) RemoveCollaborations(c ...*Collaboration) *MemoUpdateOne

RemoveCollaborations removes "collaborations" edges to Collaboration entities.

func (*MemoUpdateOne) RemoveCollaboratorIDs

func (muo *MemoUpdateOne) RemoveCollaboratorIDs(ids ...uuid.UUID) *MemoUpdateOne

RemoveCollaboratorIDs removes the "collaborators" edge to User entities by IDs.

func (*MemoUpdateOne) RemoveCollaborators

func (muo *MemoUpdateOne) RemoveCollaborators(u ...*User) *MemoUpdateOne

RemoveCollaborators removes "collaborators" edges to User entities.

func (*MemoUpdateOne) RemoveSubscriberIDs

func (muo *MemoUpdateOne) RemoveSubscriberIDs(ids ...uuid.UUID) *MemoUpdateOne

RemoveSubscriberIDs removes the "subscribers" edge to User entities by IDs.

func (*MemoUpdateOne) RemoveSubscribers

func (muo *MemoUpdateOne) RemoveSubscribers(u ...*User) *MemoUpdateOne

RemoveSubscribers removes "subscribers" edges to User entities.

func (*MemoUpdateOne) RemoveSubscriptionIDs

func (muo *MemoUpdateOne) RemoveSubscriptionIDs(ids ...int) *MemoUpdateOne

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

func (*MemoUpdateOne) RemoveSubscriptions

func (muo *MemoUpdateOne) RemoveSubscriptions(s ...*Subscription) *MemoUpdateOne

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*MemoUpdateOne) RemoveTagIDs

func (muo *MemoUpdateOne) RemoveTagIDs(ids ...int) *MemoUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*MemoUpdateOne) RemoveTags

func (muo *MemoUpdateOne) RemoveTags(t ...*Tag) *MemoUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*MemoUpdateOne) Save

func (muo *MemoUpdateOne) Save(ctx context.Context) (*Memo, error)

Save executes the query and returns the updated Memo entity.

func (*MemoUpdateOne) SaveX

func (muo *MemoUpdateOne) SaveX(ctx context.Context) *Memo

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

func (*MemoUpdateOne) Select

func (muo *MemoUpdateOne) Select(field string, fields ...string) *MemoUpdateOne

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

func (*MemoUpdateOne) SetContent

func (muo *MemoUpdateOne) SetContent(s string) *MemoUpdateOne

SetContent sets the "content" field.

func (*MemoUpdateOne) SetIsPublished

func (muo *MemoUpdateOne) SetIsPublished(b bool) *MemoUpdateOne

SetIsPublished sets the "is_published" field.

func (*MemoUpdateOne) SetNillableContent

func (muo *MemoUpdateOne) SetNillableContent(s *string) *MemoUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*MemoUpdateOne) SetNillableIsPublished

func (muo *MemoUpdateOne) SetNillableIsPublished(b *bool) *MemoUpdateOne

SetNillableIsPublished sets the "is_published" field if the given value is not nil.

func (*MemoUpdateOne) SetNillableOwnerID

func (muo *MemoUpdateOne) SetNillableOwnerID(u *uuid.UUID) *MemoUpdateOne

SetNillableOwnerID sets the "owner_id" field if the given value is not nil.

func (*MemoUpdateOne) SetNillableTitle

func (muo *MemoUpdateOne) SetNillableTitle(s *string) *MemoUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*MemoUpdateOne) SetNillableUpdateTime

func (muo *MemoUpdateOne) SetNillableUpdateTime(t *time.Time) *MemoUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MemoUpdateOne) SetNillableVersion

func (muo *MemoUpdateOne) SetNillableVersion(i *int) *MemoUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MemoUpdateOne) SetOwner

func (muo *MemoUpdateOne) SetOwner(u *User) *MemoUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*MemoUpdateOne) SetOwnerID

func (muo *MemoUpdateOne) SetOwnerID(u uuid.UUID) *MemoUpdateOne

SetOwnerID sets the "owner_id" field.

func (*MemoUpdateOne) SetTitle

func (muo *MemoUpdateOne) SetTitle(s string) *MemoUpdateOne

SetTitle sets the "title" field.

func (*MemoUpdateOne) SetUpdateTime

func (muo *MemoUpdateOne) SetUpdateTime(t time.Time) *MemoUpdateOne

SetUpdateTime sets the "update_time" field.

func (*MemoUpdateOne) SetVersion

func (muo *MemoUpdateOne) SetVersion(i int) *MemoUpdateOne

SetVersion sets the "version" field.

func (*MemoUpdateOne) Where

func (muo *MemoUpdateOne) Where(ps ...predicate.Memo) *MemoUpdateOne

Where appends a list predicates to the MemoUpdate builder.

type MemoUpsert

type MemoUpsert struct {
	*sql.UpdateSet
}

MemoUpsert is the "OnConflict" setter.

func (*MemoUpsert) AddVersion

func (u *MemoUpsert) AddVersion(v int) *MemoUpsert

AddVersion adds v to the "version" field.

func (*MemoUpsert) SetContent

func (u *MemoUpsert) SetContent(v string) *MemoUpsert

SetContent sets the "content" field.

func (*MemoUpsert) SetIsPublished

func (u *MemoUpsert) SetIsPublished(v bool) *MemoUpsert

SetIsPublished sets the "is_published" field.

func (*MemoUpsert) SetOwnerID

func (u *MemoUpsert) SetOwnerID(v uuid.UUID) *MemoUpsert

SetOwnerID sets the "owner_id" field.

func (*MemoUpsert) SetTitle

func (u *MemoUpsert) SetTitle(v string) *MemoUpsert

SetTitle sets the "title" field.

func (*MemoUpsert) SetUpdateTime

func (u *MemoUpsert) SetUpdateTime(v time.Time) *MemoUpsert

SetUpdateTime sets the "update_time" field.

func (*MemoUpsert) SetVersion

func (u *MemoUpsert) SetVersion(v int) *MemoUpsert

SetVersion sets the "version" field.

func (*MemoUpsert) UpdateContent

func (u *MemoUpsert) UpdateContent() *MemoUpsert

UpdateContent sets the "content" field to the value that was provided on create.

func (*MemoUpsert) UpdateIsPublished

func (u *MemoUpsert) UpdateIsPublished() *MemoUpsert

UpdateIsPublished sets the "is_published" field to the value that was provided on create.

func (*MemoUpsert) UpdateOwnerID

func (u *MemoUpsert) UpdateOwnerID() *MemoUpsert

UpdateOwnerID sets the "owner_id" field to the value that was provided on create.

func (*MemoUpsert) UpdateTitle

func (u *MemoUpsert) UpdateTitle() *MemoUpsert

UpdateTitle sets the "title" field to the value that was provided on create.

func (*MemoUpsert) UpdateUpdateTime

func (u *MemoUpsert) UpdateUpdateTime() *MemoUpsert

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*MemoUpsert) UpdateVersion

func (u *MemoUpsert) UpdateVersion() *MemoUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type MemoUpsertBulk

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

MemoUpsertBulk is the builder for "upsert"-ing a bulk of Memo nodes.

func (*MemoUpsertBulk) AddVersion

func (u *MemoUpsertBulk) AddVersion(v int) *MemoUpsertBulk

AddVersion adds v to the "version" field.

func (*MemoUpsertBulk) DoNothing

func (u *MemoUpsertBulk) DoNothing() *MemoUpsertBulk

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

func (*MemoUpsertBulk) Exec

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

Exec executes the query.

func (*MemoUpsertBulk) ExecX

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

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

func (*MemoUpsertBulk) Ignore

func (u *MemoUpsertBulk) Ignore() *MemoUpsertBulk

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

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

func (*MemoUpsertBulk) SetContent

func (u *MemoUpsertBulk) SetContent(v string) *MemoUpsertBulk

SetContent sets the "content" field.

func (*MemoUpsertBulk) SetIsPublished

func (u *MemoUpsertBulk) SetIsPublished(v bool) *MemoUpsertBulk

SetIsPublished sets the "is_published" field.

func (*MemoUpsertBulk) SetOwnerID

func (u *MemoUpsertBulk) SetOwnerID(v uuid.UUID) *MemoUpsertBulk

SetOwnerID sets the "owner_id" field.

func (*MemoUpsertBulk) SetTitle

func (u *MemoUpsertBulk) SetTitle(v string) *MemoUpsertBulk

SetTitle sets the "title" field.

func (*MemoUpsertBulk) SetUpdateTime

func (u *MemoUpsertBulk) SetUpdateTime(v time.Time) *MemoUpsertBulk

SetUpdateTime sets the "update_time" field.

func (*MemoUpsertBulk) SetVersion

func (u *MemoUpsertBulk) SetVersion(v int) *MemoUpsertBulk

SetVersion sets the "version" field.

func (*MemoUpsertBulk) Update

func (u *MemoUpsertBulk) Update(set func(*MemoUpsert)) *MemoUpsertBulk

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

func (*MemoUpsertBulk) UpdateContent

func (u *MemoUpsertBulk) UpdateContent() *MemoUpsertBulk

UpdateContent sets the "content" field to the value that was provided on create.

func (*MemoUpsertBulk) UpdateIsPublished

func (u *MemoUpsertBulk) UpdateIsPublished() *MemoUpsertBulk

UpdateIsPublished sets the "is_published" field to the value that was provided on create.

func (*MemoUpsertBulk) UpdateNewValues

func (u *MemoUpsertBulk) UpdateNewValues() *MemoUpsertBulk

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

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

func (*MemoUpsertBulk) UpdateOwnerID

func (u *MemoUpsertBulk) UpdateOwnerID() *MemoUpsertBulk

UpdateOwnerID sets the "owner_id" field to the value that was provided on create.

func (*MemoUpsertBulk) UpdateTitle

func (u *MemoUpsertBulk) UpdateTitle() *MemoUpsertBulk

UpdateTitle sets the "title" field to the value that was provided on create.

func (*MemoUpsertBulk) UpdateUpdateTime

func (u *MemoUpsertBulk) UpdateUpdateTime() *MemoUpsertBulk

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*MemoUpsertBulk) UpdateVersion

func (u *MemoUpsertBulk) UpdateVersion() *MemoUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type MemoUpsertOne

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

MemoUpsertOne is the builder for "upsert"-ing

one Memo node.

func (*MemoUpsertOne) AddVersion

func (u *MemoUpsertOne) AddVersion(v int) *MemoUpsertOne

AddVersion adds v to the "version" field.

func (*MemoUpsertOne) DoNothing

func (u *MemoUpsertOne) DoNothing() *MemoUpsertOne

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

func (*MemoUpsertOne) Exec

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

Exec executes the query.

func (*MemoUpsertOne) ExecX

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

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

func (*MemoUpsertOne) ID

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

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

func (*MemoUpsertOne) IDX

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

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

func (*MemoUpsertOne) Ignore

func (u *MemoUpsertOne) Ignore() *MemoUpsertOne

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

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

func (*MemoUpsertOne) SetContent

func (u *MemoUpsertOne) SetContent(v string) *MemoUpsertOne

SetContent sets the "content" field.

func (*MemoUpsertOne) SetIsPublished

func (u *MemoUpsertOne) SetIsPublished(v bool) *MemoUpsertOne

SetIsPublished sets the "is_published" field.

func (*MemoUpsertOne) SetOwnerID

func (u *MemoUpsertOne) SetOwnerID(v uuid.UUID) *MemoUpsertOne

SetOwnerID sets the "owner_id" field.

func (*MemoUpsertOne) SetTitle

func (u *MemoUpsertOne) SetTitle(v string) *MemoUpsertOne

SetTitle sets the "title" field.

func (*MemoUpsertOne) SetUpdateTime

func (u *MemoUpsertOne) SetUpdateTime(v time.Time) *MemoUpsertOne

SetUpdateTime sets the "update_time" field.

func (*MemoUpsertOne) SetVersion

func (u *MemoUpsertOne) SetVersion(v int) *MemoUpsertOne

SetVersion sets the "version" field.

func (*MemoUpsertOne) Update

func (u *MemoUpsertOne) Update(set func(*MemoUpsert)) *MemoUpsertOne

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

func (*MemoUpsertOne) UpdateContent

func (u *MemoUpsertOne) UpdateContent() *MemoUpsertOne

UpdateContent sets the "content" field to the value that was provided on create.

func (*MemoUpsertOne) UpdateIsPublished

func (u *MemoUpsertOne) UpdateIsPublished() *MemoUpsertOne

UpdateIsPublished sets the "is_published" field to the value that was provided on create.

func (*MemoUpsertOne) UpdateNewValues

func (u *MemoUpsertOne) UpdateNewValues() *MemoUpsertOne

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

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

func (*MemoUpsertOne) UpdateOwnerID

func (u *MemoUpsertOne) UpdateOwnerID() *MemoUpsertOne

UpdateOwnerID sets the "owner_id" field to the value that was provided on create.

func (*MemoUpsertOne) UpdateTitle

func (u *MemoUpsertOne) UpdateTitle() *MemoUpsertOne

UpdateTitle sets the "title" field to the value that was provided on create.

func (*MemoUpsertOne) UpdateUpdateTime

func (u *MemoUpsertOne) UpdateUpdateTime() *MemoUpsertOne

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*MemoUpsertOne) UpdateVersion

func (u *MemoUpsertOne) UpdateVersion() *MemoUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

type Memos

type Memos []*Memo

Memos is a parsable slice of Memo.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Subscription

type Subscription struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// MemoID holds the value of the "memo_id" field.
	MemoID uuid.UUID `json:"memo_id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,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) ExecContext

func (c *Subscription) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Subscription) QueryContext

func (c *Subscription) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Subscription) QueryMemo

func (s *Subscription) QueryMemo() *MemoQuery

QueryMemo queries the "memo" edge of the Subscription entity.

func (*Subscription) QuerySubscriber

func (s *Subscription) QuerySubscriber() *UserQuery

QuerySubscriber queries the "subscriber" edge of the Subscription entity.

func (*Subscription) String

func (s *Subscription) String() string

String implements the fmt.Stringer.

func (*Subscription) Unwrap

func (s *Subscription) Unwrap() *Subscription

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

func (*Subscription) Update

func (s *Subscription) Update() *SubscriptionUpdateOne

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

func (*Subscription) Value

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

func (c *SubscriptionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *SubscriptionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionClient) QueryMemo

func (c *SubscriptionClient) QueryMemo(s *Subscription) *MemoQuery

QueryMemo queries the memo edge of a Subscription.

func (*SubscriptionClient) QuerySubscriber

func (c *SubscriptionClient) QuerySubscriber(s *Subscription) *UserQuery

QuerySubscriber queries the subscriber 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 (sc *SubscriptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionCreate) ExecContext

func (c *SubscriptionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SubscriptionCreate) ExecX

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

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

func (*SubscriptionCreate) Mutation

func (sc *SubscriptionCreate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionCreate) OnConflict

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

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

func (*SubscriptionCreate) OnConflictColumns

func (sc *SubscriptionCreate) OnConflictColumns(columns ...string) *SubscriptionUpsertOne

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

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

func (*SubscriptionCreate) QueryContext

func (c *SubscriptionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (sc *SubscriptionCreate) SetCreateTime(t time.Time) *SubscriptionCreate

SetCreateTime sets the "create_time" field.

func (*SubscriptionCreate) SetMemo

func (sc *SubscriptionCreate) SetMemo(m *Memo) *SubscriptionCreate

SetMemo sets the "memo" edge to the Memo entity.

func (*SubscriptionCreate) SetMemoID

func (sc *SubscriptionCreate) SetMemoID(u uuid.UUID) *SubscriptionCreate

SetMemoID sets the "memo_id" field.

func (*SubscriptionCreate) SetNillableCreateTime

func (sc *SubscriptionCreate) SetNillableCreateTime(t *time.Time) *SubscriptionCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SubscriptionCreate) SetSubscriber

func (sc *SubscriptionCreate) SetSubscriber(u *User) *SubscriptionCreate

SetSubscriber sets the "subscriber" edge to the User entity.

func (*SubscriptionCreate) SetSubscriberID

func (sc *SubscriptionCreate) SetSubscriberID(id uuid.UUID) *SubscriptionCreate

SetSubscriberID sets the "subscriber" edge to the User entity by ID.

func (*SubscriptionCreate) SetUserID

func (sc *SubscriptionCreate) SetUserID(u uuid.UUID) *SubscriptionCreate

SetUserID sets the "user_id" field.

type SubscriptionCreateBulk

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

SubscriptionCreateBulk is the builder for creating many Subscription entities in bulk.

func (*SubscriptionCreateBulk) Exec

Exec executes the query.

func (*SubscriptionCreateBulk) ExecContext

func (c *SubscriptionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SubscriptionCreateBulk) ExecX

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

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

func (*SubscriptionCreateBulk) OnConflict

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

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

func (*SubscriptionCreateBulk) OnConflictColumns

func (scb *SubscriptionCreateBulk) OnConflictColumns(columns ...string) *SubscriptionUpsertBulk

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

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

func (*SubscriptionCreateBulk) QueryContext

func (c *SubscriptionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionCreateBulk) Save

Save creates the Subscription entities in the database.

func (*SubscriptionCreateBulk) SaveX

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

type SubscriptionDelete

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

SubscriptionDelete is the builder for deleting a Subscription entity.

func (*SubscriptionDelete) Exec

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

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

func (*SubscriptionDelete) ExecContext

func (c *SubscriptionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SubscriptionDelete) ExecX

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

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

func (*SubscriptionDelete) QueryContext

func (c *SubscriptionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionDelete) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionDeleteOne

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

SubscriptionDeleteOne is the builder for deleting a single Subscription entity.

func (*SubscriptionDeleteOne) Exec

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

Exec executes the deletion query.

func (*SubscriptionDeleteOne) ExecX

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

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

func (*SubscriptionDeleteOne) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionEdges

type SubscriptionEdges struct {
	// Subscriber holds the value of the subscriber edge.
	Subscriber *User `json:"subscriber,omitempty"`
	// Memo holds the value of the memo edge.
	Memo *Memo `json:"memo,omitempty"`
	// contains filtered or unexported fields
}

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

func (SubscriptionEdges) MemoOrErr

func (e SubscriptionEdges) MemoOrErr() (*Memo, error)

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

func (SubscriptionEdges) SubscriberOrErr

func (e SubscriptionEdges) SubscriberOrErr() (*User, error)

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

type SubscriptionGroupBy

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

SubscriptionGroupBy is the group-by builder for Subscription entities.

func (*SubscriptionGroupBy) Aggregate

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

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

func (*SubscriptionGroupBy) Bool

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

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

func (*SubscriptionGroupBy) BoolX

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

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

func (*SubscriptionGroupBy) Bools

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

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

func (*SubscriptionGroupBy) BoolsX

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

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

func (*SubscriptionGroupBy) Float64

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

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

func (*SubscriptionGroupBy) Float64X

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

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

func (*SubscriptionGroupBy) Float64s

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

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

func (*SubscriptionGroupBy) Float64sX

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

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

func (*SubscriptionGroupBy) Int

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

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

func (*SubscriptionGroupBy) IntX

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

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

func (*SubscriptionGroupBy) Ints

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

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

func (*SubscriptionGroupBy) IntsX

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

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

func (*SubscriptionGroupBy) Scan

func (sgb *SubscriptionGroupBy) Scan(ctx context.Context, v 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) ClearMemo

func (m *SubscriptionMutation) ClearMemo()

ClearMemo clears the "memo" edge to the Memo entity.

func (*SubscriptionMutation) ClearSubscriber

func (m *SubscriptionMutation) ClearSubscriber()

ClearSubscriber clears the "subscriber" 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) CreateTime

func (m *SubscriptionMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" 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) ExecContext

func (c *SubscriptionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (m *SubscriptionMutation) MemoCleared() bool

MemoCleared reports if the "memo" edge to the Memo entity was cleared.

func (*SubscriptionMutation) MemoID

func (m *SubscriptionMutation) MemoID() (r uuid.UUID, exists bool)

MemoID returns the value of the "memo_id" field in the mutation.

func (*SubscriptionMutation) MemoIDs

func (m *SubscriptionMutation) MemoIDs() (ids []uuid.UUID)

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

func (*SubscriptionMutation) OldCreateTime

func (m *SubscriptionMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" 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) OldMemoID

func (m *SubscriptionMutation) OldMemoID(ctx context.Context) (v uuid.UUID, err error)

OldMemoID returns the old "memo_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) OldUserID

func (m *SubscriptionMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) Op

func (m *SubscriptionMutation) Op() Op

Op returns the operation name.

func (*SubscriptionMutation) QueryContext

func (c *SubscriptionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (m *SubscriptionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" 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) ResetMemo

func (m *SubscriptionMutation) ResetMemo()

ResetMemo resets all changes to the "memo" edge.

func (*SubscriptionMutation) ResetMemoID

func (m *SubscriptionMutation) ResetMemoID()

ResetMemoID resets all changes to the "memo_id" field.

func (*SubscriptionMutation) ResetSubscriber

func (m *SubscriptionMutation) ResetSubscriber()

ResetSubscriber resets all changes to the "subscriber" edge.

func (*SubscriptionMutation) ResetUserID

func (m *SubscriptionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SubscriptionMutation) SetCreateTime

func (m *SubscriptionMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" 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) SetMemoID

func (m *SubscriptionMutation) SetMemoID(u uuid.UUID)

SetMemoID sets the "memo_id" field.

func (*SubscriptionMutation) SetOp

func (m *SubscriptionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscriptionMutation) SetSubscriberID

func (m *SubscriptionMutation) SetSubscriberID(id uuid.UUID)

SetSubscriberID sets the "subscriber" edge to the User entity by id.

func (*SubscriptionMutation) SetUserID

func (m *SubscriptionMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (*SubscriptionMutation) SubscriberCleared

func (m *SubscriptionMutation) SubscriberCleared() bool

SubscriberCleared reports if the "subscriber" edge to the User entity was cleared.

func (*SubscriptionMutation) SubscriberID

func (m *SubscriptionMutation) SubscriberID() (id uuid.UUID, exists bool)

SubscriberID returns the "subscriber" edge ID in the mutation.

func (*SubscriptionMutation) SubscriberIDs

func (m *SubscriptionMutation) SubscriberIDs() (ids []uuid.UUID)

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

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

func (m *SubscriptionMutation) UserID() (r uuid.UUID, exists bool)

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

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 SubscriptionQuery

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

SubscriptionQuery is the builder for querying Subscription entities.

func (*SubscriptionQuery) Aggregate

func (sq *SubscriptionQuery) Aggregate(fns ...AggregateFunc) *SubscriptionSelect

Aggregate returns a SubscriptionSelect configured with the given aggregations.

func (*SubscriptionQuery) All

func (sq *SubscriptionQuery) All(ctx context.Context) ([]*Subscription, error)

All executes the query and returns a list of Subscriptions.

func (*SubscriptionQuery) AllX

func (sq *SubscriptionQuery) AllX(ctx context.Context) []*Subscription

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

func (*SubscriptionQuery) Clone

func (sq *SubscriptionQuery) Clone() *SubscriptionQuery

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

func (*SubscriptionQuery) Count

func (sq *SubscriptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionQuery) CountX

func (sq *SubscriptionQuery) CountX(ctx context.Context) int

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

func (*SubscriptionQuery) ExecContext

func (c *SubscriptionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SubscriptionQuery) Exist

func (sq *SubscriptionQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubscriptionQuery) ExistX

func (sq *SubscriptionQuery) ExistX(ctx context.Context) bool

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

func (*SubscriptionQuery) First

func (sq *SubscriptionQuery) First(ctx context.Context) (*Subscription, error)

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

func (*SubscriptionQuery) FirstID

func (sq *SubscriptionQuery) FirstID(ctx context.Context) (id 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 (sq *SubscriptionQuery) FirstIDX(ctx context.Context) int

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

func (*SubscriptionQuery) FirstX

func (sq *SubscriptionQuery) FirstX(ctx context.Context) *Subscription

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

func (*SubscriptionQuery) GroupBy

func (sq *SubscriptionQuery) GroupBy(field string, fields ...string) *SubscriptionGroupBy

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Subscription.Query().
	GroupBy(subscription.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionQuery) IDs

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

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

func (*SubscriptionQuery) IDsX

func (sq *SubscriptionQuery) IDsX(ctx context.Context) []int

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

func (*SubscriptionQuery) Limit

func (sq *SubscriptionQuery) Limit(limit int) *SubscriptionQuery

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

func (*SubscriptionQuery) Offset

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

func (c *SubscriptionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionQuery) QueryMemo

func (sq *SubscriptionQuery) QueryMemo() *MemoQuery

QueryMemo chains the current query on the "memo" edge.

func (*SubscriptionQuery) QuerySubscriber

func (sq *SubscriptionQuery) QuerySubscriber() *UserQuery

QuerySubscriber chains the current query on the "subscriber" edge.

func (*SubscriptionQuery) Select

func (sq *SubscriptionQuery) Select(fields ...string) *SubscriptionSelect

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

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
}

client.Subscription.Query().
	Select(subscription.FieldUserID).
	Scan(ctx, &v)

func (*SubscriptionQuery) Unique

func (sq *SubscriptionQuery) Unique(unique bool) *SubscriptionQuery

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

func (*SubscriptionQuery) Where

Where adds a new predicate for the SubscriptionQuery builder.

func (*SubscriptionQuery) WithMemo

func (sq *SubscriptionQuery) WithMemo(opts ...func(*MemoQuery)) *SubscriptionQuery

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

func (*SubscriptionQuery) WithSubscriber

func (sq *SubscriptionQuery) WithSubscriber(opts ...func(*UserQuery)) *SubscriptionQuery

WithSubscriber tells the query-builder to eager-load the nodes that are connected to the "subscriber" 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 (ss *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) ExecContext

func (c SubscriptionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c SubscriptionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionSelect) Scan

func (ss *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 SubscriptionUpdate

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

SubscriptionUpdate is the builder for updating Subscription entities.

func (*SubscriptionUpdate) ClearMemo

func (su *SubscriptionUpdate) ClearMemo() *SubscriptionUpdate

ClearMemo clears the "memo" edge to the Memo entity.

func (*SubscriptionUpdate) ClearSubscriber

func (su *SubscriptionUpdate) ClearSubscriber() *SubscriptionUpdate

ClearSubscriber clears the "subscriber" edge to the User entity.

func (*SubscriptionUpdate) Exec

func (su *SubscriptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionUpdate) ExecContext

func (c *SubscriptionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SubscriptionUpdate) ExecX

func (su *SubscriptionUpdate) ExecX(ctx context.Context)

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

func (*SubscriptionUpdate) Mutation

func (su *SubscriptionUpdate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdate) QueryContext

func (c *SubscriptionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionUpdate) Save

func (su *SubscriptionUpdate) Save(ctx context.Context) (int, error)

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

func (*SubscriptionUpdate) SaveX

func (su *SubscriptionUpdate) SaveX(ctx context.Context) int

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

func (*SubscriptionUpdate) SetMemo

func (su *SubscriptionUpdate) SetMemo(m *Memo) *SubscriptionUpdate

SetMemo sets the "memo" edge to the Memo entity.

func (*SubscriptionUpdate) SetMemoID

func (su *SubscriptionUpdate) SetMemoID(u uuid.UUID) *SubscriptionUpdate

SetMemoID sets the "memo_id" field.

func (*SubscriptionUpdate) SetNillableMemoID

func (su *SubscriptionUpdate) SetNillableMemoID(u *uuid.UUID) *SubscriptionUpdate

SetNillableMemoID sets the "memo_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableUserID

func (su *SubscriptionUpdate) SetNillableUserID(u *uuid.UUID) *SubscriptionUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetSubscriber

func (su *SubscriptionUpdate) SetSubscriber(u *User) *SubscriptionUpdate

SetSubscriber sets the "subscriber" edge to the User entity.

func (*SubscriptionUpdate) SetSubscriberID

func (su *SubscriptionUpdate) SetSubscriberID(id uuid.UUID) *SubscriptionUpdate

SetSubscriberID sets the "subscriber" edge to the User entity by ID.

func (*SubscriptionUpdate) SetUserID

func (su *SubscriptionUpdate) SetUserID(u uuid.UUID) *SubscriptionUpdate

SetUserID sets the "user_id" field.

func (*SubscriptionUpdate) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUpdateOne

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

SubscriptionUpdateOne is the builder for updating a single Subscription entity.

func (*SubscriptionUpdateOne) ClearMemo

func (suo *SubscriptionUpdateOne) ClearMemo() *SubscriptionUpdateOne

ClearMemo clears the "memo" edge to the Memo entity.

func (*SubscriptionUpdateOne) ClearSubscriber

func (suo *SubscriptionUpdateOne) ClearSubscriber() *SubscriptionUpdateOne

ClearSubscriber clears the "subscriber" edge to the User entity.

func (*SubscriptionUpdateOne) Exec

func (suo *SubscriptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SubscriptionUpdateOne) ExecContext

func (c *SubscriptionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SubscriptionUpdateOne) ExecX

func (suo *SubscriptionUpdateOne) ExecX(ctx context.Context)

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

func (*SubscriptionUpdateOne) Mutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdateOne) QueryContext

func (c *SubscriptionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SubscriptionUpdateOne) Save

Save executes the query and returns the updated Subscription entity.

func (*SubscriptionUpdateOne) SaveX

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

func (*SubscriptionUpdateOne) Select

func (suo *SubscriptionUpdateOne) Select(field string, fields ...string) *SubscriptionUpdateOne

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

func (*SubscriptionUpdateOne) SetMemo

SetMemo sets the "memo" edge to the Memo entity.

func (*SubscriptionUpdateOne) SetMemoID

SetMemoID sets the "memo_id" field.

func (*SubscriptionUpdateOne) SetNillableMemoID

func (suo *SubscriptionUpdateOne) SetNillableMemoID(u *uuid.UUID) *SubscriptionUpdateOne

SetNillableMemoID sets the "memo_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableUserID

func (suo *SubscriptionUpdateOne) SetNillableUserID(u *uuid.UUID) *SubscriptionUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetSubscriber

func (suo *SubscriptionUpdateOne) SetSubscriber(u *User) *SubscriptionUpdateOne

SetSubscriber sets the "subscriber" edge to the User entity.

func (*SubscriptionUpdateOne) SetSubscriberID

func (suo *SubscriptionUpdateOne) SetSubscriberID(id uuid.UUID) *SubscriptionUpdateOne

SetSubscriberID sets the "subscriber" edge to the User entity by ID.

func (*SubscriptionUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpdateOne) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUpsert

type SubscriptionUpsert struct {
	*sql.UpdateSet
}

SubscriptionUpsert is the "OnConflict" setter.

func (*SubscriptionUpsert) SetMemoID

SetMemoID sets the "memo_id" field.

func (*SubscriptionUpsert) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpsert) UpdateMemoID

func (u *SubscriptionUpsert) UpdateMemoID() *SubscriptionUpsert

UpdateMemoID sets the "memo_id" field to the value that was provided on create.

func (*SubscriptionUpsert) UpdateUserID

func (u *SubscriptionUpsert) UpdateUserID() *SubscriptionUpsert

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

type SubscriptionUpsertBulk

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

SubscriptionUpsertBulk is the builder for "upsert"-ing a bulk of Subscription nodes.

func (*SubscriptionUpsertBulk) DoNothing

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

func (*SubscriptionUpsertBulk) Exec

Exec executes the query.

func (*SubscriptionUpsertBulk) ExecX

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

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

func (*SubscriptionUpsertBulk) Ignore

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

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

func (*SubscriptionUpsertBulk) SetMemoID

SetMemoID sets the "memo_id" field.

func (*SubscriptionUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpsertBulk) Update

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

func (*SubscriptionUpsertBulk) UpdateMemoID

UpdateMemoID sets the "memo_id" field to the value that was provided on create.

func (*SubscriptionUpsertBulk) UpdateNewValues

func (u *SubscriptionUpsertBulk) UpdateNewValues() *SubscriptionUpsertBulk

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

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

func (*SubscriptionUpsertBulk) UpdateUserID

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

type SubscriptionUpsertOne

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

SubscriptionUpsertOne is the builder for "upsert"-ing

one Subscription node.

func (*SubscriptionUpsertOne) DoNothing

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

func (*SubscriptionUpsertOne) Exec

Exec executes the query.

func (*SubscriptionUpsertOne) ExecX

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

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

func (*SubscriptionUpsertOne) ID

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

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

func (*SubscriptionUpsertOne) IDX

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

func (*SubscriptionUpsertOne) Ignore

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

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

func (*SubscriptionUpsertOne) SetMemoID

SetMemoID sets the "memo_id" field.

func (*SubscriptionUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*SubscriptionUpsertOne) Update

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

func (*SubscriptionUpsertOne) UpdateMemoID

func (u *SubscriptionUpsertOne) UpdateMemoID() *SubscriptionUpsertOne

UpdateMemoID sets the "memo_id" field to the value that was provided on create.

func (*SubscriptionUpsertOne) UpdateNewValues

func (u *SubscriptionUpsertOne) UpdateNewValues() *SubscriptionUpsertOne

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

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

func (*SubscriptionUpsertOne) UpdateUserID

func (u *SubscriptionUpsertOne) UpdateUserID() *SubscriptionUpsertOne

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

type Subscriptions

type Subscriptions []*Subscription

Subscriptions is a parsable slice of Subscription.

type Tag

type Tag struct {

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

Tag is the model entity for the Tag schema.

func (*Tag) ExecContext

func (c *Tag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tag) QueryContext

func (c *Tag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tag) QueryMemos

func (t *Tag) QueryMemos() *MemoQuery

QueryMemos queries the "memos" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

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

func (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

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

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

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

type TagClient

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

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

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

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int) *TagDeleteOne

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

func (*TagClient) ExecContext

func (c *TagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

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

func (*TagClient) Hooks

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

Hooks returns the client hooks.

func (*TagClient) Intercept

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

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

func (*TagClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

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

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryContext

func (c *TagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagClient) QueryMemos

func (c *TagClient) QueryMemos(t *Tag) *MemoQuery

QueryMemos queries the memos edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

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

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

type TagCreate

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

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddMemoIDs

func (tc *TagCreate) AddMemoIDs(ids ...uuid.UUID) *TagCreate

AddMemoIDs adds the "memos" edge to the Memo entity by IDs.

func (*TagCreate) AddMemos

func (tc *TagCreate) AddMemos(m ...*Memo) *TagCreate

AddMemos adds the "memos" edges to the Memo entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecContext

func (c *TagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

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

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) OnConflict

func (tc *TagCreate) OnConflict(opts ...sql.ConflictOption) *TagUpsertOne

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

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

func (*TagCreate) OnConflictColumns

func (tc *TagCreate) OnConflictColumns(columns ...string) *TagUpsertOne

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

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

func (*TagCreate) QueryContext

func (c *TagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetCreateTime

func (tc *TagCreate) SetCreateTime(t time.Time) *TagCreate

SetCreateTime sets the "create_time" field.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the "name" field.

func (*TagCreate) SetNillableCreateTime

func (tc *TagCreate) SetNillableCreateTime(t *time.Time) *TagCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TagCreate) SetNillableUpdateTime

func (tc *TagCreate) SetNillableUpdateTime(t *time.Time) *TagCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TagCreate) SetUpdateTime

func (tc *TagCreate) SetUpdateTime(t time.Time) *TagCreate

SetUpdateTime sets the "update_time" field.

type TagCreateBulk

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

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecContext

func (c *TagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

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

func (*TagCreateBulk) OnConflict

func (tcb *TagCreateBulk) OnConflict(opts ...sql.ConflictOption) *TagUpsertBulk

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

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

func (*TagCreateBulk) OnConflictColumns

func (tcb *TagCreateBulk) OnConflictColumns(columns ...string) *TagUpsertBulk

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

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

func (*TagCreateBulk) QueryContext

func (c *TagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

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

type TagDelete

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

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

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

func (*TagDelete) ExecContext

func (c *TagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

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

func (*TagDelete) QueryContext

func (c *TagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

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

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

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

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Memos holds the value of the memos edge.
	Memos []*Memo `json:"memos,omitempty"`
	// contains filtered or unexported fields
}

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

func (TagEdges) MemosOrErr

func (e TagEdges) MemosOrErr() ([]*Memo, error)

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

type TagGroupBy

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

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

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

func (*TagGroupBy) Bool

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

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

func (*TagGroupBy) BoolX

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

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

func (*TagGroupBy) Bools

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

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

func (*TagGroupBy) BoolsX

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

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

func (*TagGroupBy) Float64

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

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

func (*TagGroupBy) Float64X

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

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

func (*TagGroupBy) Float64s

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

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

func (*TagGroupBy) Float64sX

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

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

func (*TagGroupBy) Int

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

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

func (*TagGroupBy) IntX

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

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

func (*TagGroupBy) Ints

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

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

func (*TagGroupBy) IntsX

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

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

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

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

func (*TagGroupBy) ScanX

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

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

func (*TagGroupBy) String

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

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

func (*TagGroupBy) StringX

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

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

func (*TagGroupBy) Strings

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

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

func (*TagGroupBy) StringsX

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

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

type TagMutation

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

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

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

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

func (*TagMutation) AddMemoIDs

func (m *TagMutation) AddMemoIDs(ids ...uuid.UUID)

AddMemoIDs adds the "memos" edge to the Memo entity by ids.

func (*TagMutation) AddedEdges

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

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

func (*TagMutation) AddedField

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

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

func (*TagMutation) AddedFields

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

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

func (*TagMutation) AddedIDs

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

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

func (*TagMutation) ClearEdge

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

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

func (*TagMutation) ClearField

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

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

func (*TagMutation) ClearMemos

func (m *TagMutation) ClearMemos()

ClearMemos clears the "memos" edge to the Memo entity.

func (*TagMutation) ClearedEdges

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

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

func (*TagMutation) ClearedFields

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

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

func (TagMutation) Client

func (m TagMutation) Client() *Client

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

func (*TagMutation) CreateTime

func (m *TagMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TagMutation) EdgeCleared

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

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

func (*TagMutation) ExecContext

func (c *TagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagMutation) Field

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

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

func (*TagMutation) FieldCleared

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

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

func (*TagMutation) Fields

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

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

func (*TagMutation) ID

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

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

func (*TagMutation) IDs

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

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

func (*TagMutation) MemosCleared

func (m *TagMutation) MemosCleared() bool

MemosCleared reports if the "memos" edge to the Memo entity was cleared.

func (*TagMutation) MemosIDs

func (m *TagMutation) MemosIDs() (ids []uuid.UUID)

MemosIDs returns the "memos" edge IDs in the mutation.

func (*TagMutation) Name

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

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

func (*TagMutation) OldCreateTime

func (m *TagMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) OldField

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

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

func (*TagMutation) OldName

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

OldName returns the old "name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) OldUpdateTime

func (m *TagMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) QueryContext

func (c *TagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagMutation) RemoveMemoIDs

func (m *TagMutation) RemoveMemoIDs(ids ...uuid.UUID)

RemoveMemoIDs removes the "memos" edge to the Memo entity by IDs.

func (*TagMutation) RemovedEdges

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

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

func (*TagMutation) RemovedIDs

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

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

func (*TagMutation) RemovedMemosIDs

func (m *TagMutation) RemovedMemosIDs() (ids []uuid.UUID)

RemovedMemos returns the removed IDs of the "memos" edge to the Memo entity.

func (*TagMutation) ResetCreateTime

func (m *TagMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TagMutation) ResetEdge

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

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

func (*TagMutation) ResetField

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

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

func (*TagMutation) ResetMemos

func (m *TagMutation) ResetMemos()

ResetMemos resets all changes to the "memos" edge.

func (*TagMutation) ResetName

func (m *TagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TagMutation) ResetUpdateTime

func (m *TagMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TagMutation) SetCreateTime

func (m *TagMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TagMutation) SetField

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

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

func (*TagMutation) SetName

func (m *TagMutation) SetName(s string)

SetName sets the "name" field.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetUpdateTime

func (m *TagMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (TagMutation) Tx

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

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

func (*TagMutation) Type

func (m *TagMutation) Type() string

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

func (*TagMutation) UpdateTime

func (m *TagMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

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

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

type TagQuery

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

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

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

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

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

func (*TagQuery) ExecContext

func (c *TagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

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

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

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

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

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

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) int

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

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

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

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

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

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

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int

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

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

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

func (*TagQuery) Offset

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

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

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

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int

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

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

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

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryContext

func (c *TagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagQuery) QueryMemos

func (tq *TagQuery) QueryMemos() *MemoQuery

QueryMemos chains the current query on the "memos" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldCreateTime).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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

func (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithMemos

func (tq *TagQuery) WithMemos(opts ...func(*MemoQuery)) *TagQuery

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

type TagSelect

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

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

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

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

func (*TagSelect) BoolX

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

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

func (*TagSelect) Bools

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

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

func (*TagSelect) BoolsX

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

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

func (TagSelect) ExecContext

func (c TagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagSelect) Float64

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

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

func (*TagSelect) Float64X

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

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

func (*TagSelect) Float64s

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

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

func (*TagSelect) Float64sX

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

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

func (*TagSelect) Int

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

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

func (*TagSelect) IntX

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

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

func (*TagSelect) Ints

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

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

func (*TagSelect) IntsX

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

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

func (TagSelect) QueryContext

func (c TagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

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

func (*TagSelect) ScanX

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

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

func (*TagSelect) String

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

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

func (*TagSelect) StringX

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

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

func (*TagSelect) Strings

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

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

func (*TagSelect) StringsX

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

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

type TagUpdate

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

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddMemoIDs

func (tu *TagUpdate) AddMemoIDs(ids ...uuid.UUID) *TagUpdate

AddMemoIDs adds the "memos" edge to the Memo entity by IDs.

func (*TagUpdate) AddMemos

func (tu *TagUpdate) AddMemos(m ...*Memo) *TagUpdate

AddMemos adds the "memos" edges to the Memo entity.

func (*TagUpdate) ClearMemos

func (tu *TagUpdate) ClearMemos() *TagUpdate

ClearMemos clears all "memos" edges to the Memo entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecContext

func (c *TagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

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

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) QueryContext

func (c *TagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagUpdate) RemoveMemoIDs

func (tu *TagUpdate) RemoveMemoIDs(ids ...uuid.UUID) *TagUpdate

RemoveMemoIDs removes the "memos" edge to Memo entities by IDs.

func (*TagUpdate) RemoveMemos

func (tu *TagUpdate) RemoveMemos(m ...*Memo) *TagUpdate

RemoveMemos removes "memos" edges to Memo entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

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

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

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

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the "name" field.

func (*TagUpdate) SetNillableName

func (tu *TagUpdate) SetNillableName(s *string) *TagUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdate) SetUpdateTime

func (tu *TagUpdate) SetUpdateTime(t time.Time) *TagUpdate

SetUpdateTime sets the "update_time" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

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

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddMemoIDs

func (tuo *TagUpdateOne) AddMemoIDs(ids ...uuid.UUID) *TagUpdateOne

AddMemoIDs adds the "memos" edge to the Memo entity by IDs.

func (*TagUpdateOne) AddMemos

func (tuo *TagUpdateOne) AddMemos(m ...*Memo) *TagUpdateOne

AddMemos adds the "memos" edges to the Memo entity.

func (*TagUpdateOne) ClearMemos

func (tuo *TagUpdateOne) ClearMemos() *TagUpdateOne

ClearMemos clears all "memos" edges to the Memo entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecContext

func (c *TagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

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

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) QueryContext

func (c *TagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagUpdateOne) RemoveMemoIDs

func (tuo *TagUpdateOne) RemoveMemoIDs(ids ...uuid.UUID) *TagUpdateOne

RemoveMemoIDs removes the "memos" edge to Memo entities by IDs.

func (*TagUpdateOne) RemoveMemos

func (tuo *TagUpdateOne) RemoveMemos(m ...*Memo) *TagUpdateOne

RemoveMemos removes "memos" edges to Memo entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

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

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

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

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the "name" field.

func (*TagUpdateOne) SetNillableName

func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdateOne) SetUpdateTime

func (tuo *TagUpdateOne) SetUpdateTime(t time.Time) *TagUpdateOne

SetUpdateTime sets the "update_time" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type TagUpsert

type TagUpsert struct {
	*sql.UpdateSet
}

TagUpsert is the "OnConflict" setter.

func (*TagUpsert) SetName

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

SetName sets the "name" field.

func (*TagUpsert) SetUpdateTime

func (u *TagUpsert) SetUpdateTime(v time.Time) *TagUpsert

SetUpdateTime sets the "update_time" field.

func (*TagUpsert) UpdateName

func (u *TagUpsert) UpdateName() *TagUpsert

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

func (*TagUpsert) UpdateUpdateTime

func (u *TagUpsert) UpdateUpdateTime() *TagUpsert

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

type TagUpsertBulk

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

TagUpsertBulk is the builder for "upsert"-ing a bulk of Tag nodes.

func (*TagUpsertBulk) DoNothing

func (u *TagUpsertBulk) DoNothing() *TagUpsertBulk

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

func (*TagUpsertBulk) Exec

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

Exec executes the query.

func (*TagUpsertBulk) ExecX

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

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

func (*TagUpsertBulk) Ignore

func (u *TagUpsertBulk) Ignore() *TagUpsertBulk

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

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

func (*TagUpsertBulk) SetName

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

SetName sets the "name" field.

func (*TagUpsertBulk) SetUpdateTime

func (u *TagUpsertBulk) SetUpdateTime(v time.Time) *TagUpsertBulk

SetUpdateTime sets the "update_time" field.

func (*TagUpsertBulk) Update

func (u *TagUpsertBulk) Update(set func(*TagUpsert)) *TagUpsertBulk

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

func (*TagUpsertBulk) UpdateName

func (u *TagUpsertBulk) UpdateName() *TagUpsertBulk

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

func (*TagUpsertBulk) UpdateNewValues

func (u *TagUpsertBulk) UpdateNewValues() *TagUpsertBulk

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

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

func (*TagUpsertBulk) UpdateUpdateTime

func (u *TagUpsertBulk) UpdateUpdateTime() *TagUpsertBulk

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

type TagUpsertOne

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

TagUpsertOne is the builder for "upsert"-ing

one Tag node.

func (*TagUpsertOne) DoNothing

func (u *TagUpsertOne) DoNothing() *TagUpsertOne

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

func (*TagUpsertOne) Exec

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

Exec executes the query.

func (*TagUpsertOne) ExecX

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

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

func (*TagUpsertOne) ID

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

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

func (*TagUpsertOne) IDX

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

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

func (*TagUpsertOne) Ignore

func (u *TagUpsertOne) Ignore() *TagUpsertOne

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

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

func (*TagUpsertOne) SetName

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

SetName sets the "name" field.

func (*TagUpsertOne) SetUpdateTime

func (u *TagUpsertOne) SetUpdateTime(v time.Time) *TagUpsertOne

SetUpdateTime sets the "update_time" field.

func (*TagUpsertOne) Update

func (u *TagUpsertOne) Update(set func(*TagUpsert)) *TagUpsertOne

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

func (*TagUpsertOne) UpdateName

func (u *TagUpsertOne) UpdateName() *TagUpsertOne

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

func (*TagUpsertOne) UpdateNewValues

func (u *TagUpsertOne) UpdateNewValues() *TagUpsertOne

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

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

func (*TagUpsertOne) UpdateUpdateTime

func (u *TagUpsertOne) UpdateUpdateTime() *TagUpsertOne

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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 {

	// Collaboration is the client for interacting with the Collaboration builders.
	Collaboration *CollaborationClient
	// Memo is the client for interacting with the Memo builders.
	Memo *MemoClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// UserName holds the value of the "user_name" field.
	UserName string `json:"user_name,omitempty"`
	// GivenName holds the value of the "given_name" field.
	GivenName string `json:"given_name,omitempty"`
	// FamilyName holds the value of the "family_name" field.
	FamilyName string `json:"family_name,omitempty"`
	// PhotoURL holds the value of the "photo_url" field.
	PhotoURL string `json:"photo_url,omitempty"`
	// Type holds the value of the "type" field.
	Type enum.UserType `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) ExecContext

func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*User) QueryCollaboratingMemos

func (u *User) QueryCollaboratingMemos() *MemoQuery

QueryCollaboratingMemos queries the "collaborating_memos" edge of the User entity.

func (*User) QueryCollaborations

func (u *User) QueryCollaborations() *CollaborationQuery

QueryCollaborations queries the "collaborations" edge of the User entity.

func (*User) QueryContext

func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*User) QueryMemos

func (u *User) QueryMemos() *MemoQuery

QueryMemos queries the "memos" edge of the User entity.

func (*User) QuerySubscribingMemos

func (u *User) QuerySubscribingMemos() *MemoQuery

QuerySubscribingMemos queries the "subscribing_memos" edge of the User entity.

func (*User) QuerySubscriptions

func (u *User) QuerySubscriptions() *SubscriptionQuery

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

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

func (*User) Value

func (u *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(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

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

func (*UserClient) ExecContext

func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) 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) QueryCollaboratingMemos

func (c *UserClient) QueryCollaboratingMemos(u *User) *MemoQuery

QueryCollaboratingMemos queries the collaborating_memos edge of a User.

func (*UserClient) QueryCollaborations

func (c *UserClient) QueryCollaborations(u *User) *CollaborationQuery

QueryCollaborations queries the collaborations edge of a User.

func (*UserClient) QueryContext

func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserClient) QueryMemos

func (c *UserClient) QueryMemos(u *User) *MemoQuery

QueryMemos queries the memos edge of a User.

func (*UserClient) QuerySubscribingMemos

func (c *UserClient) QuerySubscribingMemos(u *User) *MemoQuery

QuerySubscribingMemos queries the subscribing_memos edge of a User.

func (*UserClient) QuerySubscriptions

func (c *UserClient) QuerySubscriptions(u *User) *SubscriptionQuery

QuerySubscriptions queries the subscriptions edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddCollaboratingMemoIDs

func (uc *UserCreate) AddCollaboratingMemoIDs(ids ...uuid.UUID) *UserCreate

AddCollaboratingMemoIDs adds the "collaborating_memos" edge to the Memo entity by IDs.

func (*UserCreate) AddCollaboratingMemos

func (uc *UserCreate) AddCollaboratingMemos(m ...*Memo) *UserCreate

AddCollaboratingMemos adds the "collaborating_memos" edges to the Memo entity.

func (*UserCreate) AddCollaborationIDs

func (uc *UserCreate) AddCollaborationIDs(ids ...int) *UserCreate

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by IDs.

func (*UserCreate) AddCollaborations

func (uc *UserCreate) AddCollaborations(c ...*Collaboration) *UserCreate

AddCollaborations adds the "collaborations" edges to the Collaboration entity.

func (*UserCreate) AddMemoIDs

func (uc *UserCreate) AddMemoIDs(ids ...uuid.UUID) *UserCreate

AddMemoIDs adds the "memos" edge to the Memo entity by IDs.

func (*UserCreate) AddMemos

func (uc *UserCreate) AddMemos(m ...*Memo) *UserCreate

AddMemos adds the "memos" edges to the Memo entity.

func (*UserCreate) AddSubscribingMemoIDs

func (uc *UserCreate) AddSubscribingMemoIDs(ids ...uuid.UUID) *UserCreate

AddSubscribingMemoIDs adds the "subscribing_memos" edge to the Memo entity by IDs.

func (*UserCreate) AddSubscribingMemos

func (uc *UserCreate) AddSubscribingMemos(m ...*Memo) *UserCreate

AddSubscribingMemos adds the "subscribing_memos" edges to the Memo entity.

func (*UserCreate) AddSubscriptionIDs

func (uc *UserCreate) AddSubscriptionIDs(ids ...int) *UserCreate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*UserCreate) AddSubscriptions

func (uc *UserCreate) AddSubscriptions(s ...*Subscription) *UserCreate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecContext

func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetCreateTime(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetCreateTime(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) QueryContext

func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreateTime

func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetFamilyName

func (uc *UserCreate) SetFamilyName(s string) *UserCreate

SetFamilyName sets the "family_name" field.

func (*UserCreate) SetGivenName

func (uc *UserCreate) SetGivenName(s string) *UserCreate

SetGivenName sets the "given_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetNillableCreateTime

func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserCreate) SetNillableFamilyName

func (uc *UserCreate) SetNillableFamilyName(s *string) *UserCreate

SetNillableFamilyName sets the "family_name" field if the given value is not nil.

func (*UserCreate) SetNillableGivenName

func (uc *UserCreate) SetNillableGivenName(s *string) *UserCreate

SetNillableGivenName sets the "given_name" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillablePhotoURL

func (uc *UserCreate) SetNillablePhotoURL(s *string) *UserCreate

SetNillablePhotoURL sets the "photo_url" field if the given value is not nil.

func (*UserCreate) SetNillableType

func (uc *UserCreate) SetNillableType(et *enum.UserType) *UserCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime

func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserCreate) SetPhotoURL

func (uc *UserCreate) SetPhotoURL(s string) *UserCreate

SetPhotoURL sets the "photo_url" field.

func (*UserCreate) SetType

func (uc *UserCreate) SetType(et enum.UserType) *UserCreate

SetType sets the "type" field.

func (*UserCreate) SetUpdateTime

func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate

SetUpdateTime sets the "update_time" field.

func (*UserCreate) SetUserName

func (uc *UserCreate) SetUserName(s string) *UserCreate

SetUserName sets the "user_name" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecContext

func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetCreateTime(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) QueryContext

func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecContext

func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) QueryContext

func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Memos holds the value of the memos edge.
	Memos []*Memo `json:"memos,omitempty"`
	// SubscribingMemos holds the value of the subscribing_memos edge.
	SubscribingMemos []*Memo `json:"subscribing_memos,omitempty"`
	// CollaboratingMemos holds the value of the collaborating_memos edge.
	CollaboratingMemos []*Memo `json:"collaborating_memos,omitempty"`
	// Subscriptions holds the value of the subscriptions edge.
	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
	// Collaborations holds the value of the collaborations edge.
	Collaborations []*Collaboration `json:"collaborations,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) CollaboratingMemosOrErr

func (e UserEdges) CollaboratingMemosOrErr() ([]*Memo, error)

CollaboratingMemosOrErr returns the CollaboratingMemos value or an error if the edge was not loaded in eager-loading.

func (UserEdges) CollaborationsOrErr

func (e UserEdges) CollaborationsOrErr() ([]*Collaboration, error)

CollaborationsOrErr returns the Collaborations value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MemosOrErr

func (e UserEdges) MemosOrErr() ([]*Memo, error)

MemosOrErr returns the Memos value or an error if the edge was not loaded in eager-loading.

func (UserEdges) SubscribingMemosOrErr

func (e UserEdges) SubscribingMemosOrErr() ([]*Memo, error)

SubscribingMemosOrErr returns the SubscribingMemos value or an error if the edge was not loaded in eager-loading.

func (UserEdges) SubscriptionsOrErr

func (e UserEdges) SubscriptionsOrErr() ([]*Subscription, error)

SubscriptionsOrErr returns the Subscriptions value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddCollaboratingMemoIDs

func (m *UserMutation) AddCollaboratingMemoIDs(ids ...uuid.UUID)

AddCollaboratingMemoIDs adds the "collaborating_memos" edge to the Memo entity by ids.

func (*UserMutation) AddCollaborationIDs

func (m *UserMutation) AddCollaborationIDs(ids ...int)

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by ids.

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) AddMemoIDs

func (m *UserMutation) AddMemoIDs(ids ...uuid.UUID)

AddMemoIDs adds the "memos" edge to the Memo entity by ids.

func (*UserMutation) AddSubscribingMemoIDs

func (m *UserMutation) AddSubscribingMemoIDs(ids ...uuid.UUID)

AddSubscribingMemoIDs adds the "subscribing_memos" edge to the Memo entity by ids.

func (*UserMutation) AddSubscriptionIDs

func (m *UserMutation) AddSubscriptionIDs(ids ...int)

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearCollaboratingMemos

func (m *UserMutation) ClearCollaboratingMemos()

ClearCollaboratingMemos clears the "collaborating_memos" edge to the Memo entity.

func (*UserMutation) ClearCollaborations

func (m *UserMutation) ClearCollaborations()

ClearCollaborations clears the "collaborations" edge to the Collaboration entity.

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) ClearFamilyName

func (m *UserMutation) ClearFamilyName()

ClearFamilyName clears the value of the "family_name" field.

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) ClearGivenName

func (m *UserMutation) ClearGivenName()

ClearGivenName clears the value of the "given_name" field.

func (*UserMutation) ClearMemos

func (m *UserMutation) ClearMemos()

ClearMemos clears the "memos" edge to the Memo entity.

func (*UserMutation) ClearPhotoURL

func (m *UserMutation) ClearPhotoURL()

ClearPhotoURL clears the value of the "photo_url" field.

func (*UserMutation) ClearSubscribingMemos

func (m *UserMutation) ClearSubscribingMemos()

ClearSubscribingMemos clears the "subscribing_memos" edge to the Memo entity.

func (*UserMutation) ClearSubscriptions

func (m *UserMutation) ClearSubscriptions()

ClearSubscriptions clears the "subscriptions" edge to the Subscription entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CollaboratingMemosCleared

func (m *UserMutation) CollaboratingMemosCleared() bool

CollaboratingMemosCleared reports if the "collaborating_memos" edge to the Memo entity was cleared.

func (*UserMutation) CollaboratingMemosIDs

func (m *UserMutation) CollaboratingMemosIDs() (ids []uuid.UUID)

CollaboratingMemosIDs returns the "collaborating_memos" edge IDs in the mutation.

func (*UserMutation) CollaborationsCleared

func (m *UserMutation) CollaborationsCleared() bool

CollaborationsCleared reports if the "collaborations" edge to the Collaboration entity was cleared.

func (*UserMutation) CollaborationsIDs

func (m *UserMutation) CollaborationsIDs() (ids []int)

CollaborationsIDs returns the "collaborations" edge IDs in the mutation.

func (*UserMutation) CreateTime

func (m *UserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) ExecContext

func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserMutation) FamilyName

func (m *UserMutation) FamilyName() (r string, exists bool)

FamilyName returns the value of the "family_name" field in the mutation.

func (*UserMutation) FamilyNameCleared

func (m *UserMutation) FamilyNameCleared() bool

FamilyNameCleared returns if the "family_name" field 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) GetType

func (m *UserMutation) GetType() (r enum.UserType, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*UserMutation) GivenName

func (m *UserMutation) GivenName() (r string, exists bool)

GivenName returns the value of the "given_name" field in the mutation.

func (*UserMutation) GivenNameCleared

func (m *UserMutation) GivenNameCleared() bool

GivenNameCleared returns if the "given_name" field was cleared in this mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) MemosCleared

func (m *UserMutation) MemosCleared() bool

MemosCleared reports if the "memos" edge to the Memo entity was cleared.

func (*UserMutation) MemosIDs

func (m *UserMutation) MemosIDs() (ids []uuid.UUID)

MemosIDs returns the "memos" edge IDs in the mutation.

func (*UserMutation) OldCreateTime

func (m *UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldFamilyName

func (m *UserMutation) OldFamilyName(ctx context.Context) (v string, err error)

OldFamilyName returns the old "family_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) 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) OldGivenName

func (m *UserMutation) OldGivenName(ctx context.Context) (v string, err error)

OldGivenName returns the old "given_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPhotoURL

func (m *UserMutation) OldPhotoURL(ctx context.Context) (v string, err error)

OldPhotoURL returns the old "photo_url" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldType

func (m *UserMutation) OldType(ctx context.Context) (v enum.UserType, err error)

OldType returns the old "type" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdateTime

func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUserName

func (m *UserMutation) OldUserName(ctx context.Context) (v string, err error)

OldUserName returns the old "user_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) PhotoURL

func (m *UserMutation) PhotoURL() (r string, exists bool)

PhotoURL returns the value of the "photo_url" field in the mutation.

func (*UserMutation) PhotoURLCleared

func (m *UserMutation) PhotoURLCleared() bool

PhotoURLCleared returns if the "photo_url" field was cleared in this mutation.

func (*UserMutation) QueryContext

func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserMutation) RemoveCollaboratingMemoIDs

func (m *UserMutation) RemoveCollaboratingMemoIDs(ids ...uuid.UUID)

RemoveCollaboratingMemoIDs removes the "collaborating_memos" edge to the Memo entity by IDs.

func (*UserMutation) RemoveCollaborationIDs

func (m *UserMutation) RemoveCollaborationIDs(ids ...int)

RemoveCollaborationIDs removes the "collaborations" edge to the Collaboration entity by IDs.

func (*UserMutation) RemoveMemoIDs

func (m *UserMutation) RemoveMemoIDs(ids ...uuid.UUID)

RemoveMemoIDs removes the "memos" edge to the Memo entity by IDs.

func (*UserMutation) RemoveSubscribingMemoIDs

func (m *UserMutation) RemoveSubscribingMemoIDs(ids ...uuid.UUID)

RemoveSubscribingMemoIDs removes the "subscribing_memos" edge to the Memo entity by IDs.

func (*UserMutation) RemoveSubscriptionIDs

func (m *UserMutation) RemoveSubscriptionIDs(ids ...int)

RemoveSubscriptionIDs removes the "subscriptions" edge to the Subscription entity by IDs.

func (*UserMutation) RemovedCollaboratingMemosIDs

func (m *UserMutation) RemovedCollaboratingMemosIDs() (ids []uuid.UUID)

RemovedCollaboratingMemos returns the removed IDs of the "collaborating_memos" edge to the Memo entity.

func (*UserMutation) RemovedCollaborationsIDs

func (m *UserMutation) RemovedCollaborationsIDs() (ids []int)

RemovedCollaborations returns the removed IDs of the "collaborations" edge to the Collaboration entity.

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) RemovedMemosIDs

func (m *UserMutation) RemovedMemosIDs() (ids []uuid.UUID)

RemovedMemos returns the removed IDs of the "memos" edge to the Memo entity.

func (*UserMutation) RemovedSubscribingMemosIDs

func (m *UserMutation) RemovedSubscribingMemosIDs() (ids []uuid.UUID)

RemovedSubscribingMemos returns the removed IDs of the "subscribing_memos" edge to the Memo entity.

func (*UserMutation) RemovedSubscriptionsIDs

func (m *UserMutation) RemovedSubscriptionsIDs() (ids []int)

RemovedSubscriptions returns the removed IDs of the "subscriptions" edge to the Subscription entity.

func (*UserMutation) ResetCollaboratingMemos

func (m *UserMutation) ResetCollaboratingMemos()

ResetCollaboratingMemos resets all changes to the "collaborating_memos" edge.

func (*UserMutation) ResetCollaborations

func (m *UserMutation) ResetCollaborations()

ResetCollaborations resets all changes to the "collaborations" edge.

func (*UserMutation) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetFamilyName

func (m *UserMutation) ResetFamilyName()

ResetFamilyName resets all changes to the "family_name" field.

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) ResetGivenName

func (m *UserMutation) ResetGivenName()

ResetGivenName resets all changes to the "given_name" field.

func (*UserMutation) ResetMemos

func (m *UserMutation) ResetMemos()

ResetMemos resets all changes to the "memos" edge.

func (*UserMutation) ResetPhotoURL

func (m *UserMutation) ResetPhotoURL()

ResetPhotoURL resets all changes to the "photo_url" field.

func (*UserMutation) ResetSubscribingMemos

func (m *UserMutation) ResetSubscribingMemos()

ResetSubscribingMemos resets all changes to the "subscribing_memos" edge.

func (*UserMutation) ResetSubscriptions

func (m *UserMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*UserMutation) ResetType

func (m *UserMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*UserMutation) ResetUpdateTime

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserMutation) ResetUserName

func (m *UserMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*UserMutation) SetCreateTime

func (m *UserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetFamilyName

func (m *UserMutation) SetFamilyName(s string)

SetFamilyName sets the "family_name" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetGivenName

func (m *UserMutation) SetGivenName(s string)

SetGivenName sets the "given_name" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPhotoURL

func (m *UserMutation) SetPhotoURL(s string)

SetPhotoURL sets the "photo_url" field.

func (*UserMutation) SetType

func (m *UserMutation) SetType(et enum.UserType)

SetType sets the "type" field.

func (*UserMutation) SetUpdateTime

func (m *UserMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*UserMutation) SetUserName

func (m *UserMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (*UserMutation) SubscribingMemosCleared

func (m *UserMutation) SubscribingMemosCleared() bool

SubscribingMemosCleared reports if the "subscribing_memos" edge to the Memo entity was cleared.

func (*UserMutation) SubscribingMemosIDs

func (m *UserMutation) SubscribingMemosIDs() (ids []uuid.UUID)

SubscribingMemosIDs returns the "subscribing_memos" edge IDs in the mutation.

func (*UserMutation) SubscriptionsCleared

func (m *UserMutation) SubscriptionsCleared() bool

SubscriptionsCleared reports if the "subscriptions" edge to the Subscription entity was cleared.

func (*UserMutation) SubscriptionsIDs

func (m *UserMutation) SubscriptionsIDs() (ids []int)

SubscriptionsIDs returns the "subscriptions" edge IDs in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdateTime

func (m *UserMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserMutation) UserName

func (m *UserMutation) UserName() (r string, exists bool)

UserName returns the value of the "user_name" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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 (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) ExecContext

func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryCollaboratingMemos

func (uq *UserQuery) QueryCollaboratingMemos() *MemoQuery

QueryCollaboratingMemos chains the current query on the "collaborating_memos" edge.

func (*UserQuery) QueryCollaborations

func (uq *UserQuery) QueryCollaborations() *CollaborationQuery

QueryCollaborations chains the current query on the "collaborations" edge.

func (*UserQuery) QueryContext

func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserQuery) QueryMemos

func (uq *UserQuery) QueryMemos() *MemoQuery

QueryMemos chains the current query on the "memos" edge.

func (*UserQuery) QuerySubscribingMemos

func (uq *UserQuery) QuerySubscribingMemos() *MemoQuery

QuerySubscribingMemos chains the current query on the "subscribing_memos" edge.

func (*UserQuery) QuerySubscriptions

func (uq *UserQuery) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions chains the current query on the "subscriptions" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.User.Query().
	Select(user.FieldCreateTime).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithCollaboratingMemos

func (uq *UserQuery) WithCollaboratingMemos(opts ...func(*MemoQuery)) *UserQuery

WithCollaboratingMemos tells the query-builder to eager-load the nodes that are connected to the "collaborating_memos" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithCollaborations

func (uq *UserQuery) WithCollaborations(opts ...func(*CollaborationQuery)) *UserQuery

WithCollaborations tells the query-builder to eager-load the nodes that are connected to the "collaborations" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMemos

func (uq *UserQuery) WithMemos(opts ...func(*MemoQuery)) *UserQuery

WithMemos tells the query-builder to eager-load the nodes that are connected to the "memos" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSubscribingMemos

func (uq *UserQuery) WithSubscribingMemos(opts ...func(*MemoQuery)) *UserQuery

WithSubscribingMemos tells the query-builder to eager-load the nodes that are connected to the "subscribing_memos" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSubscriptions

func (uq *UserQuery) WithSubscriptions(opts ...func(*SubscriptionQuery)) *UserQuery

WithSubscriptions tells the query-builder to eager-load the nodes that are connected to the "subscriptions" edge. The optional arguments are used to configure the query builder of the edge.

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 (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (UserSelect) ExecContext

func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddCollaboratingMemoIDs

func (uu *UserUpdate) AddCollaboratingMemoIDs(ids ...uuid.UUID) *UserUpdate

AddCollaboratingMemoIDs adds the "collaborating_memos" edge to the Memo entity by IDs.

func (*UserUpdate) AddCollaboratingMemos

func (uu *UserUpdate) AddCollaboratingMemos(m ...*Memo) *UserUpdate

AddCollaboratingMemos adds the "collaborating_memos" edges to the Memo entity.

func (*UserUpdate) AddCollaborationIDs

func (uu *UserUpdate) AddCollaborationIDs(ids ...int) *UserUpdate

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by IDs.

func (*UserUpdate) AddCollaborations

func (uu *UserUpdate) AddCollaborations(c ...*Collaboration) *UserUpdate

AddCollaborations adds the "collaborations" edges to the Collaboration entity.

func (*UserUpdate) AddMemoIDs

func (uu *UserUpdate) AddMemoIDs(ids ...uuid.UUID) *UserUpdate

AddMemoIDs adds the "memos" edge to the Memo entity by IDs.

func (*UserUpdate) AddMemos

func (uu *UserUpdate) AddMemos(m ...*Memo) *UserUpdate

AddMemos adds the "memos" edges to the Memo entity.

func (*UserUpdate) AddSubscribingMemoIDs

func (uu *UserUpdate) AddSubscribingMemoIDs(ids ...uuid.UUID) *UserUpdate

AddSubscribingMemoIDs adds the "subscribing_memos" edge to the Memo entity by IDs.

func (*UserUpdate) AddSubscribingMemos

func (uu *UserUpdate) AddSubscribingMemos(m ...*Memo) *UserUpdate

AddSubscribingMemos adds the "subscribing_memos" edges to the Memo entity.

func (*UserUpdate) AddSubscriptionIDs

func (uu *UserUpdate) AddSubscriptionIDs(ids ...int) *UserUpdate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*UserUpdate) AddSubscriptions

func (uu *UserUpdate) AddSubscriptions(s ...*Subscription) *UserUpdate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*UserUpdate) ClearCollaboratingMemos

func (uu *UserUpdate) ClearCollaboratingMemos() *UserUpdate

ClearCollaboratingMemos clears all "collaborating_memos" edges to the Memo entity.

func (*UserUpdate) ClearCollaborations

func (uu *UserUpdate) ClearCollaborations() *UserUpdate

ClearCollaborations clears all "collaborations" edges to the Collaboration entity.

func (*UserUpdate) ClearFamilyName

func (uu *UserUpdate) ClearFamilyName() *UserUpdate

ClearFamilyName clears the value of the "family_name" field.

func (*UserUpdate) ClearGivenName

func (uu *UserUpdate) ClearGivenName() *UserUpdate

ClearGivenName clears the value of the "given_name" field.

func (*UserUpdate) ClearMemos

func (uu *UserUpdate) ClearMemos() *UserUpdate

ClearMemos clears all "memos" edges to the Memo entity.

func (*UserUpdate) ClearPhotoURL

func (uu *UserUpdate) ClearPhotoURL() *UserUpdate

ClearPhotoURL clears the value of the "photo_url" field.

func (*UserUpdate) ClearSubscribingMemos

func (uu *UserUpdate) ClearSubscribingMemos() *UserUpdate

ClearSubscribingMemos clears all "subscribing_memos" edges to the Memo entity.

func (*UserUpdate) ClearSubscriptions

func (uu *UserUpdate) ClearSubscriptions() *UserUpdate

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecContext

func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) QueryContext

func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdate) RemoveCollaboratingMemoIDs

func (uu *UserUpdate) RemoveCollaboratingMemoIDs(ids ...uuid.UUID) *UserUpdate

RemoveCollaboratingMemoIDs removes the "collaborating_memos" edge to Memo entities by IDs.

func (*UserUpdate) RemoveCollaboratingMemos

func (uu *UserUpdate) RemoveCollaboratingMemos(m ...*Memo) *UserUpdate

RemoveCollaboratingMemos removes "collaborating_memos" edges to Memo entities.

func (*UserUpdate) RemoveCollaborationIDs

func (uu *UserUpdate) RemoveCollaborationIDs(ids ...int) *UserUpdate

RemoveCollaborationIDs removes the "collaborations" edge to Collaboration entities by IDs.

func (*UserUpdate) RemoveCollaborations

func (uu *UserUpdate) RemoveCollaborations(c ...*Collaboration) *UserUpdate

RemoveCollaborations removes "collaborations" edges to Collaboration entities.

func (*UserUpdate) RemoveMemoIDs

func (uu *UserUpdate) RemoveMemoIDs(ids ...uuid.UUID) *UserUpdate

RemoveMemoIDs removes the "memos" edge to Memo entities by IDs.

func (*UserUpdate) RemoveMemos

func (uu *UserUpdate) RemoveMemos(m ...*Memo) *UserUpdate

RemoveMemos removes "memos" edges to Memo entities.

func (*UserUpdate) RemoveSubscribingMemoIDs

func (uu *UserUpdate) RemoveSubscribingMemoIDs(ids ...uuid.UUID) *UserUpdate

RemoveSubscribingMemoIDs removes the "subscribing_memos" edge to Memo entities by IDs.

func (*UserUpdate) RemoveSubscribingMemos

func (uu *UserUpdate) RemoveSubscribingMemos(m ...*Memo) *UserUpdate

RemoveSubscribingMemos removes "subscribing_memos" edges to Memo entities.

func (*UserUpdate) RemoveSubscriptionIDs

func (uu *UserUpdate) RemoveSubscriptionIDs(ids ...int) *UserUpdate

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*UserUpdate) RemoveSubscriptions

func (uu *UserUpdate) RemoveSubscriptions(s ...*Subscription) *UserUpdate

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetFamilyName

func (uu *UserUpdate) SetFamilyName(s string) *UserUpdate

SetFamilyName sets the "family_name" field.

func (*UserUpdate) SetGivenName

func (uu *UserUpdate) SetGivenName(s string) *UserUpdate

SetGivenName sets the "given_name" field.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableFamilyName

func (uu *UserUpdate) SetNillableFamilyName(s *string) *UserUpdate

SetNillableFamilyName sets the "family_name" field if the given value is not nil.

func (*UserUpdate) SetNillableGivenName

func (uu *UserUpdate) SetNillableGivenName(s *string) *UserUpdate

SetNillableGivenName sets the "given_name" field if the given value is not nil.

func (*UserUpdate) SetNillablePhotoURL

func (uu *UserUpdate) SetNillablePhotoURL(s *string) *UserUpdate

SetNillablePhotoURL sets the "photo_url" field if the given value is not nil.

func (*UserUpdate) SetNillableType

func (uu *UserUpdate) SetNillableType(et *enum.UserType) *UserUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*UserUpdate) SetNillableUserName

func (uu *UserUpdate) SetNillableUserName(s *string) *UserUpdate

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*UserUpdate) SetPhotoURL

func (uu *UserUpdate) SetPhotoURL(s string) *UserUpdate

SetPhotoURL sets the "photo_url" field.

func (*UserUpdate) SetType

func (uu *UserUpdate) SetType(et enum.UserType) *UserUpdate

SetType sets the "type" field.

func (*UserUpdate) SetUpdateTime

func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate

SetUpdateTime sets the "update_time" field.

func (*UserUpdate) SetUserName

func (uu *UserUpdate) SetUserName(s string) *UserUpdate

SetUserName sets the "user_name" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddCollaboratingMemoIDs

func (uuo *UserUpdateOne) AddCollaboratingMemoIDs(ids ...uuid.UUID) *UserUpdateOne

AddCollaboratingMemoIDs adds the "collaborating_memos" edge to the Memo entity by IDs.

func (*UserUpdateOne) AddCollaboratingMemos

func (uuo *UserUpdateOne) AddCollaboratingMemos(m ...*Memo) *UserUpdateOne

AddCollaboratingMemos adds the "collaborating_memos" edges to the Memo entity.

func (*UserUpdateOne) AddCollaborationIDs

func (uuo *UserUpdateOne) AddCollaborationIDs(ids ...int) *UserUpdateOne

AddCollaborationIDs adds the "collaborations" edge to the Collaboration entity by IDs.

func (*UserUpdateOne) AddCollaborations

func (uuo *UserUpdateOne) AddCollaborations(c ...*Collaboration) *UserUpdateOne

AddCollaborations adds the "collaborations" edges to the Collaboration entity.

func (*UserUpdateOne) AddMemoIDs

func (uuo *UserUpdateOne) AddMemoIDs(ids ...uuid.UUID) *UserUpdateOne

AddMemoIDs adds the "memos" edge to the Memo entity by IDs.

func (*UserUpdateOne) AddMemos

func (uuo *UserUpdateOne) AddMemos(m ...*Memo) *UserUpdateOne

AddMemos adds the "memos" edges to the Memo entity.

func (*UserUpdateOne) AddSubscribingMemoIDs

func (uuo *UserUpdateOne) AddSubscribingMemoIDs(ids ...uuid.UUID) *UserUpdateOne

AddSubscribingMemoIDs adds the "subscribing_memos" edge to the Memo entity by IDs.

func (*UserUpdateOne) AddSubscribingMemos

func (uuo *UserUpdateOne) AddSubscribingMemos(m ...*Memo) *UserUpdateOne

AddSubscribingMemos adds the "subscribing_memos" edges to the Memo entity.

func (*UserUpdateOne) AddSubscriptionIDs

func (uuo *UserUpdateOne) AddSubscriptionIDs(ids ...int) *UserUpdateOne

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*UserUpdateOne) AddSubscriptions

func (uuo *UserUpdateOne) AddSubscriptions(s ...*Subscription) *UserUpdateOne

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*UserUpdateOne) ClearCollaboratingMemos

func (uuo *UserUpdateOne) ClearCollaboratingMemos() *UserUpdateOne

ClearCollaboratingMemos clears all "collaborating_memos" edges to the Memo entity.

func (*UserUpdateOne) ClearCollaborations

func (uuo *UserUpdateOne) ClearCollaborations() *UserUpdateOne

ClearCollaborations clears all "collaborations" edges to the Collaboration entity.

func (*UserUpdateOne) ClearFamilyName

func (uuo *UserUpdateOne) ClearFamilyName() *UserUpdateOne

ClearFamilyName clears the value of the "family_name" field.

func (*UserUpdateOne) ClearGivenName

func (uuo *UserUpdateOne) ClearGivenName() *UserUpdateOne

ClearGivenName clears the value of the "given_name" field.

func (*UserUpdateOne) ClearMemos

func (uuo *UserUpdateOne) ClearMemos() *UserUpdateOne

ClearMemos clears all "memos" edges to the Memo entity.

func (*UserUpdateOne) ClearPhotoURL

func (uuo *UserUpdateOne) ClearPhotoURL() *UserUpdateOne

ClearPhotoURL clears the value of the "photo_url" field.

func (*UserUpdateOne) ClearSubscribingMemos

func (uuo *UserUpdateOne) ClearSubscribingMemos() *UserUpdateOne

ClearSubscribingMemos clears all "subscribing_memos" edges to the Memo entity.

func (*UserUpdateOne) ClearSubscriptions

func (uuo *UserUpdateOne) ClearSubscriptions() *UserUpdateOne

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecContext

func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) QueryContext

func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdateOne) RemoveCollaboratingMemoIDs

func (uuo *UserUpdateOne) RemoveCollaboratingMemoIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveCollaboratingMemoIDs removes the "collaborating_memos" edge to Memo entities by IDs.

func (*UserUpdateOne) RemoveCollaboratingMemos

func (uuo *UserUpdateOne) RemoveCollaboratingMemos(m ...*Memo) *UserUpdateOne

RemoveCollaboratingMemos removes "collaborating_memos" edges to Memo entities.

func (*UserUpdateOne) RemoveCollaborationIDs

func (uuo *UserUpdateOne) RemoveCollaborationIDs(ids ...int) *UserUpdateOne

RemoveCollaborationIDs removes the "collaborations" edge to Collaboration entities by IDs.

func (*UserUpdateOne) RemoveCollaborations

func (uuo *UserUpdateOne) RemoveCollaborations(c ...*Collaboration) *UserUpdateOne

RemoveCollaborations removes "collaborations" edges to Collaboration entities.

func (*UserUpdateOne) RemoveMemoIDs

func (uuo *UserUpdateOne) RemoveMemoIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveMemoIDs removes the "memos" edge to Memo entities by IDs.

func (*UserUpdateOne) RemoveMemos

func (uuo *UserUpdateOne) RemoveMemos(m ...*Memo) *UserUpdateOne

RemoveMemos removes "memos" edges to Memo entities.

func (*UserUpdateOne) RemoveSubscribingMemoIDs

func (uuo *UserUpdateOne) RemoveSubscribingMemoIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveSubscribingMemoIDs removes the "subscribing_memos" edge to Memo entities by IDs.

func (*UserUpdateOne) RemoveSubscribingMemos

func (uuo *UserUpdateOne) RemoveSubscribingMemos(m ...*Memo) *UserUpdateOne

RemoveSubscribingMemos removes "subscribing_memos" edges to Memo entities.

func (*UserUpdateOne) RemoveSubscriptionIDs

func (uuo *UserUpdateOne) RemoveSubscriptionIDs(ids ...int) *UserUpdateOne

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*UserUpdateOne) RemoveSubscriptions

func (uuo *UserUpdateOne) RemoveSubscriptions(s ...*Subscription) *UserUpdateOne

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetFamilyName

func (uuo *UserUpdateOne) SetFamilyName(s string) *UserUpdateOne

SetFamilyName sets the "family_name" field.

func (*UserUpdateOne) SetGivenName

func (uuo *UserUpdateOne) SetGivenName(s string) *UserUpdateOne

SetGivenName sets the "given_name" field.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFamilyName

func (uuo *UserUpdateOne) SetNillableFamilyName(s *string) *UserUpdateOne

SetNillableFamilyName sets the "family_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGivenName

func (uuo *UserUpdateOne) SetNillableGivenName(s *string) *UserUpdateOne

SetNillableGivenName sets the "given_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePhotoURL

func (uuo *UserUpdateOne) SetNillablePhotoURL(s *string) *UserUpdateOne

SetNillablePhotoURL sets the "photo_url" field if the given value is not nil.

func (*UserUpdateOne) SetNillableType

func (uuo *UserUpdateOne) SetNillableType(et *enum.UserType) *UserUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUserName

func (uuo *UserUpdateOne) SetNillableUserName(s *string) *UserUpdateOne

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*UserUpdateOne) SetPhotoURL

func (uuo *UserUpdateOne) SetPhotoURL(s string) *UserUpdateOne

SetPhotoURL sets the "photo_url" field.

func (*UserUpdateOne) SetType

func (uuo *UserUpdateOne) SetType(et enum.UserType) *UserUpdateOne

SetType sets the "type" field.

func (*UserUpdateOne) SetUpdateTime

func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserUpdateOne) SetUserName

func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne

SetUserName sets the "user_name" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) ClearFamilyName

func (u *UserUpsert) ClearFamilyName() *UserUpsert

ClearFamilyName clears the value of the "family_name" field.

func (*UserUpsert) ClearGivenName

func (u *UserUpsert) ClearGivenName() *UserUpsert

ClearGivenName clears the value of the "given_name" field.

func (*UserUpsert) ClearPhotoURL

func (u *UserUpsert) ClearPhotoURL() *UserUpsert

ClearPhotoURL clears the value of the "photo_url" field.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetFamilyName

func (u *UserUpsert) SetFamilyName(v string) *UserUpsert

SetFamilyName sets the "family_name" field.

func (*UserUpsert) SetGivenName

func (u *UserUpsert) SetGivenName(v string) *UserUpsert

SetGivenName sets the "given_name" field.

func (*UserUpsert) SetPhotoURL

func (u *UserUpsert) SetPhotoURL(v string) *UserUpsert

SetPhotoURL sets the "photo_url" field.

func (*UserUpsert) SetType

func (u *UserUpsert) SetType(v enum.UserType) *UserUpsert

SetType sets the "type" field.

func (*UserUpsert) SetUpdateTime

func (u *UserUpsert) SetUpdateTime(v time.Time) *UserUpsert

SetUpdateTime sets the "update_time" field.

func (*UserUpsert) SetUserName

func (u *UserUpsert) SetUserName(v string) *UserUpsert

SetUserName sets the "user_name" field.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdateFamilyName

func (u *UserUpsert) UpdateFamilyName() *UserUpsert

UpdateFamilyName sets the "family_name" field to the value that was provided on create.

func (*UserUpsert) UpdateGivenName

func (u *UserUpsert) UpdateGivenName() *UserUpsert

UpdateGivenName sets the "given_name" field to the value that was provided on create.

func (*UserUpsert) UpdatePhotoURL

func (u *UserUpsert) UpdatePhotoURL() *UserUpsert

UpdatePhotoURL sets the "photo_url" field to the value that was provided on create.

func (*UserUpsert) UpdateType

func (u *UserUpsert) UpdateType() *UserUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdateTime

func (u *UserUpsert) UpdateUpdateTime() *UserUpsert

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*UserUpsert) UpdateUserName

func (u *UserUpsert) UpdateUserName() *UserUpsert

UpdateUserName sets the "user_name" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) ClearFamilyName

func (u *UserUpsertBulk) ClearFamilyName() *UserUpsertBulk

ClearFamilyName clears the value of the "family_name" field.

func (*UserUpsertBulk) ClearGivenName

func (u *UserUpsertBulk) ClearGivenName() *UserUpsertBulk

ClearGivenName clears the value of the "given_name" field.

func (*UserUpsertBulk) ClearPhotoURL

func (u *UserUpsertBulk) ClearPhotoURL() *UserUpsertBulk

ClearPhotoURL clears the value of the "photo_url" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetEmail

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetFamilyName

func (u *UserUpsertBulk) SetFamilyName(v string) *UserUpsertBulk

SetFamilyName sets the "family_name" field.

func (*UserUpsertBulk) SetGivenName

func (u *UserUpsertBulk) SetGivenName(v string) *UserUpsertBulk

SetGivenName sets the "given_name" field.

func (*UserUpsertBulk) SetPhotoURL

func (u *UserUpsertBulk) SetPhotoURL(v string) *UserUpsertBulk

SetPhotoURL sets the "photo_url" field.

func (*UserUpsertBulk) SetType

func (u *UserUpsertBulk) SetType(v enum.UserType) *UserUpsertBulk

SetType sets the "type" field.

func (*UserUpsertBulk) SetUpdateTime

func (u *UserUpsertBulk) SetUpdateTime(v time.Time) *UserUpsertBulk

SetUpdateTime sets the "update_time" field.

func (*UserUpsertBulk) SetUserName

func (u *UserUpsertBulk) SetUserName(v string) *UserUpsertBulk

SetUserName sets the "user_name" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFamilyName

func (u *UserUpsertBulk) UpdateFamilyName() *UserUpsertBulk

UpdateFamilyName sets the "family_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateGivenName

func (u *UserUpsertBulk) UpdateGivenName() *UserUpsertBulk

UpdateGivenName sets the "given_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdatePhotoURL

func (u *UserUpsertBulk) UpdatePhotoURL() *UserUpsertBulk

UpdatePhotoURL sets the "photo_url" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateType

func (u *UserUpsertBulk) UpdateType() *UserUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdateTime

func (u *UserUpsertBulk) UpdateUpdateTime() *UserUpsertBulk

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUserName

func (u *UserUpsertBulk) UpdateUserName() *UserUpsertBulk

UpdateUserName sets the "user_name" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) ClearFamilyName

func (u *UserUpsertOne) ClearFamilyName() *UserUpsertOne

ClearFamilyName clears the value of the "family_name" field.

func (*UserUpsertOne) ClearGivenName

func (u *UserUpsertOne) ClearGivenName() *UserUpsertOne

ClearGivenName clears the value of the "given_name" field.

func (*UserUpsertOne) ClearPhotoURL

func (u *UserUpsertOne) ClearPhotoURL() *UserUpsertOne

ClearPhotoURL clears the value of the "photo_url" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetEmail

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetFamilyName

func (u *UserUpsertOne) SetFamilyName(v string) *UserUpsertOne

SetFamilyName sets the "family_name" field.

func (*UserUpsertOne) SetGivenName

func (u *UserUpsertOne) SetGivenName(v string) *UserUpsertOne

SetGivenName sets the "given_name" field.

func (*UserUpsertOne) SetPhotoURL

func (u *UserUpsertOne) SetPhotoURL(v string) *UserUpsertOne

SetPhotoURL sets the "photo_url" field.

func (*UserUpsertOne) SetType

func (u *UserUpsertOne) SetType(v enum.UserType) *UserUpsertOne

SetType sets the "type" field.

func (*UserUpsertOne) SetUpdateTime

func (u *UserUpsertOne) SetUpdateTime(v time.Time) *UserUpsertOne

SetUpdateTime sets the "update_time" field.

func (*UserUpsertOne) SetUserName

func (u *UserUpsertOne) SetUserName(v string) *UserUpsertOne

SetUserName sets the "user_name" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFamilyName

func (u *UserUpsertOne) UpdateFamilyName() *UserUpsertOne

UpdateFamilyName sets the "family_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateGivenName

func (u *UserUpsertOne) UpdateGivenName() *UserUpsertOne

UpdateGivenName sets the "given_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdatePhotoURL

func (u *UserUpsertOne) UpdatePhotoURL() *UserUpsertOne

UpdatePhotoURL sets the "photo_url" field to the value that was provided on create.

func (*UserUpsertOne) UpdateType

func (u *UserUpsertOne) UpdateType() *UserUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdateTime

func (u *UserUpsertOne) UpdateUpdateTime() *UserUpsertOne

UpdateUpdateTime sets the "update_time" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUserName

func (u *UserUpsertOne) UpdateUserName() *UserUpsertOne

UpdateUserName sets the "user_name" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL