ent

package
v0.0.0-...-5805e45 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAccount    = "Account"
	TypeContact    = "Contact"
	TypeMessage    = "Message"
	TypeNotifyRule = "NotifyRule"
	TypePendingOp  = "PendingOp"
	TypeSecret     = "Secret"
	TypeThread     = "Thread"
)

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 Account

type Account struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type account.Type `json:"type,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// Config holds the value of the "config" field.
	Config map[string]interface{} `json:"config,omitempty"`
	// SyncCursor holds the value of the "sync_cursor" field.
	SyncCursor string `json:"sync_cursor,omitempty"`
	// Status holds the value of the "status" field.
	Status account.Status `json:"status,omitempty"`
	// NeedsReauth holds the value of the "needs_reauth" field.
	NeedsReauth bool `json:"needs_reauth,omitempty"`
	// AuthError holds the value of the "auth_error" field.
	AuthError string `json:"auth_error,omitempty"`
	// SyncNotice holds the value of the "sync_notice" field.
	SyncNotice string `json:"sync_notice,omitempty"`
	// LastSyncAt holds the value of the "last_sync_at" field.
	LastSyncAt *time.Time `json:"last_sync_at,omitempty"`
	// LastError holds the value of the "last_error" field.
	LastError string `json:"last_error,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AccountQuery when eager-loading is set.
	Edges AccountEdges `json:"edges"`
	// contains filtered or unexported fields
}

Account is the model entity for the Account schema.

func (*Account) ExecContext

func (c *Account) 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 (*Account) QueryContacts

func (_m *Account) QueryContacts() *ContactQuery

QueryContacts queries the "contacts" edge of the Account entity.

func (*Account) QueryContext

func (c *Account) 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 (*Account) QueryNotifyRules

func (_m *Account) QueryNotifyRules() *NotifyRuleQuery

QueryNotifyRules queries the "notify_rules" edge of the Account entity.

func (*Account) QueryPendingOps

func (_m *Account) QueryPendingOps() *PendingOpQuery

QueryPendingOps queries the "pending_ops" edge of the Account entity.

func (*Account) QuerySecrets

func (_m *Account) QuerySecrets() *SecretQuery

QuerySecrets queries the "secrets" edge of the Account entity.

func (*Account) QueryThreads

func (_m *Account) QueryThreads() *ThreadQuery

QueryThreads queries the "threads" edge of the Account entity.

func (*Account) String

func (_m *Account) String() string

String implements the fmt.Stringer.

func (*Account) Unwrap

func (_m *Account) Unwrap() *Account

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

func (_m *Account) Update() *AccountUpdateOne

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

func (*Account) Value

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

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

type AccountClient

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

AccountClient is a client for the Account schema.

func NewAccountClient

func NewAccountClient(c config) *AccountClient

NewAccountClient returns a client for the Account from the given config.

func (*AccountClient) Create

func (c *AccountClient) Create() *AccountCreate

Create returns a builder for creating a Account entity.

func (*AccountClient) CreateBulk

func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk

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

func (*AccountClient) Delete

func (c *AccountClient) Delete() *AccountDelete

Delete returns a delete builder for Account.

func (*AccountClient) DeleteOne

func (c *AccountClient) DeleteOne(_m *Account) *AccountDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AccountClient) DeleteOneID

func (c *AccountClient) DeleteOneID(id uuid.UUID) *AccountDeleteOne

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

func (*AccountClient) ExecContext

func (c *AccountClient) 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 (*AccountClient) Get

func (c *AccountClient) Get(ctx context.Context, id uuid.UUID) (*Account, error)

Get returns a Account entity by its id.

func (*AccountClient) GetX

func (c *AccountClient) GetX(ctx context.Context, id uuid.UUID) *Account

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

func (*AccountClient) Hooks

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

Hooks returns the client hooks.

func (*AccountClient) Intercept

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

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

func (*AccountClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AccountClient) MapCreateBulk

func (c *AccountClient) MapCreateBulk(slice any, setFunc func(*AccountCreate, int)) *AccountCreateBulk

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

func (c *AccountClient) Query() *AccountQuery

Query returns a query builder for Account.

func (*AccountClient) QueryContacts

func (c *AccountClient) QueryContacts(_m *Account) *ContactQuery

QueryContacts queries the contacts edge of a Account.

func (*AccountClient) QueryContext

func (c *AccountClient) 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 (*AccountClient) QueryNotifyRules

func (c *AccountClient) QueryNotifyRules(_m *Account) *NotifyRuleQuery

QueryNotifyRules queries the notify_rules edge of a Account.

func (*AccountClient) QueryPendingOps

func (c *AccountClient) QueryPendingOps(_m *Account) *PendingOpQuery

QueryPendingOps queries the pending_ops edge of a Account.

func (*AccountClient) QuerySecrets

func (c *AccountClient) QuerySecrets(_m *Account) *SecretQuery

QuerySecrets queries the secrets edge of a Account.

func (*AccountClient) QueryThreads

func (c *AccountClient) QueryThreads(_m *Account) *ThreadQuery

QueryThreads queries the threads edge of a Account.

func (*AccountClient) Update

func (c *AccountClient) Update() *AccountUpdate

Update returns an update builder for Account.

func (*AccountClient) UpdateOne

func (c *AccountClient) UpdateOne(_m *Account) *AccountUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AccountClient) UpdateOneID

func (c *AccountClient) UpdateOneID(id uuid.UUID) *AccountUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AccountClient) Use

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

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

type AccountCreate

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

AccountCreate is the builder for creating a Account entity.

func (*AccountCreate) AddContactIDs

func (_c *AccountCreate) AddContactIDs(ids ...int) *AccountCreate

AddContactIDs adds the "contacts" edge to the Contact entity by IDs.

func (*AccountCreate) AddContacts

func (_c *AccountCreate) AddContacts(v ...*Contact) *AccountCreate

AddContacts adds the "contacts" edges to the Contact entity.

func (*AccountCreate) AddNotifyRuleIDs

func (_c *AccountCreate) AddNotifyRuleIDs(ids ...int) *AccountCreate

AddNotifyRuleIDs adds the "notify_rules" edge to the NotifyRule entity by IDs.

func (*AccountCreate) AddNotifyRules

func (_c *AccountCreate) AddNotifyRules(v ...*NotifyRule) *AccountCreate

AddNotifyRules adds the "notify_rules" edges to the NotifyRule entity.

func (*AccountCreate) AddPendingOpIDs

func (_c *AccountCreate) AddPendingOpIDs(ids ...int) *AccountCreate

AddPendingOpIDs adds the "pending_ops" edge to the PendingOp entity by IDs.

func (*AccountCreate) AddPendingOps

func (_c *AccountCreate) AddPendingOps(v ...*PendingOp) *AccountCreate

AddPendingOps adds the "pending_ops" edges to the PendingOp entity.

func (*AccountCreate) AddSecretIDs

func (_c *AccountCreate) AddSecretIDs(ids ...uuid.UUID) *AccountCreate

AddSecretIDs adds the "secrets" edge to the Secret entity by IDs.

func (*AccountCreate) AddSecrets

func (_c *AccountCreate) AddSecrets(v ...*Secret) *AccountCreate

AddSecrets adds the "secrets" edges to the Secret entity.

func (*AccountCreate) AddThreadIDs

func (_c *AccountCreate) AddThreadIDs(ids ...int) *AccountCreate

AddThreadIDs adds the "threads" edge to the Thread entity by IDs.

func (*AccountCreate) AddThreads

func (_c *AccountCreate) AddThreads(v ...*Thread) *AccountCreate

AddThreads adds the "threads" edges to the Thread entity.

func (*AccountCreate) Exec

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

Exec executes the query.

func (*AccountCreate) ExecContext

func (c *AccountCreate) 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 (*AccountCreate) ExecX

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

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

func (*AccountCreate) Mutation

func (_c *AccountCreate) Mutation() *AccountMutation

Mutation returns the AccountMutation object of the builder.

func (*AccountCreate) OnConflict

func (_c *AccountCreate) OnConflict(opts ...sql.ConflictOption) *AccountUpsertOne

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

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

func (*AccountCreate) OnConflictColumns

func (_c *AccountCreate) OnConflictColumns(columns ...string) *AccountUpsertOne

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

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

func (*AccountCreate) QueryContext

func (c *AccountCreate) 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 (*AccountCreate) Save

func (_c *AccountCreate) Save(ctx context.Context) (*Account, error)

Save creates the Account in the database.

func (*AccountCreate) SaveX

func (_c *AccountCreate) SaveX(ctx context.Context) *Account

SaveX calls Save and panics if Save returns an error.

func (*AccountCreate) SetAuthError

func (_c *AccountCreate) SetAuthError(v string) *AccountCreate

SetAuthError sets the "auth_error" field.

func (*AccountCreate) SetConfig

func (_c *AccountCreate) SetConfig(v map[string]interface{}) *AccountCreate

SetConfig sets the "config" field.

func (*AccountCreate) SetCreatedAt

func (_c *AccountCreate) SetCreatedAt(v time.Time) *AccountCreate

SetCreatedAt sets the "created_at" field.

func (*AccountCreate) SetDisplayName

func (_c *AccountCreate) SetDisplayName(v string) *AccountCreate

SetDisplayName sets the "display_name" field.

func (*AccountCreate) SetEmail

func (_c *AccountCreate) SetEmail(v string) *AccountCreate

SetEmail sets the "email" field.

func (*AccountCreate) SetID

func (_c *AccountCreate) SetID(v uuid.UUID) *AccountCreate

SetID sets the "id" field.

func (*AccountCreate) SetLastError

func (_c *AccountCreate) SetLastError(v string) *AccountCreate

SetLastError sets the "last_error" field.

func (*AccountCreate) SetLastSyncAt

func (_c *AccountCreate) SetLastSyncAt(v time.Time) *AccountCreate

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountCreate) SetNeedsReauth

func (_c *AccountCreate) SetNeedsReauth(v bool) *AccountCreate

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountCreate) SetNillableAuthError

func (_c *AccountCreate) SetNillableAuthError(v *string) *AccountCreate

SetNillableAuthError sets the "auth_error" field if the given value is not nil.

func (*AccountCreate) SetNillableCreatedAt

func (_c *AccountCreate) SetNillableCreatedAt(v *time.Time) *AccountCreate

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

func (*AccountCreate) SetNillableDisplayName

func (_c *AccountCreate) SetNillableDisplayName(v *string) *AccountCreate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*AccountCreate) SetNillableID

func (_c *AccountCreate) SetNillableID(v *uuid.UUID) *AccountCreate

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

func (*AccountCreate) SetNillableLastError

func (_c *AccountCreate) SetNillableLastError(v *string) *AccountCreate

SetNillableLastError sets the "last_error" field if the given value is not nil.

func (*AccountCreate) SetNillableLastSyncAt

func (_c *AccountCreate) SetNillableLastSyncAt(v *time.Time) *AccountCreate

SetNillableLastSyncAt sets the "last_sync_at" field if the given value is not nil.

func (*AccountCreate) SetNillableNeedsReauth

func (_c *AccountCreate) SetNillableNeedsReauth(v *bool) *AccountCreate

SetNillableNeedsReauth sets the "needs_reauth" field if the given value is not nil.

func (*AccountCreate) SetNillableStatus

func (_c *AccountCreate) SetNillableStatus(v *account.Status) *AccountCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*AccountCreate) SetNillableSyncCursor

func (_c *AccountCreate) SetNillableSyncCursor(v *string) *AccountCreate

SetNillableSyncCursor sets the "sync_cursor" field if the given value is not nil.

func (*AccountCreate) SetNillableSyncNotice

func (_c *AccountCreate) SetNillableSyncNotice(v *string) *AccountCreate

SetNillableSyncNotice sets the "sync_notice" field if the given value is not nil.

func (*AccountCreate) SetStatus

func (_c *AccountCreate) SetStatus(v account.Status) *AccountCreate

SetStatus sets the "status" field.

func (*AccountCreate) SetSyncCursor

func (_c *AccountCreate) SetSyncCursor(v string) *AccountCreate

SetSyncCursor sets the "sync_cursor" field.

func (*AccountCreate) SetSyncNotice

func (_c *AccountCreate) SetSyncNotice(v string) *AccountCreate

SetSyncNotice sets the "sync_notice" field.

func (*AccountCreate) SetType

func (_c *AccountCreate) SetType(v account.Type) *AccountCreate

SetType sets the "type" field.

type AccountCreateBulk

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

AccountCreateBulk is the builder for creating many Account entities in bulk.

func (*AccountCreateBulk) Exec

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

Exec executes the query.

func (*AccountCreateBulk) ExecContext

func (c *AccountCreateBulk) 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 (*AccountCreateBulk) ExecX

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

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

func (*AccountCreateBulk) OnConflict

func (_c *AccountCreateBulk) OnConflict(opts ...sql.ConflictOption) *AccountUpsertBulk

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

client.Account.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.AccountUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*AccountCreateBulk) OnConflictColumns

func (_c *AccountCreateBulk) OnConflictColumns(columns ...string) *AccountUpsertBulk

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

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

func (*AccountCreateBulk) QueryContext

func (c *AccountCreateBulk) 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 (*AccountCreateBulk) Save

func (_c *AccountCreateBulk) Save(ctx context.Context) ([]*Account, error)

Save creates the Account entities in the database.

func (*AccountCreateBulk) SaveX

func (_c *AccountCreateBulk) SaveX(ctx context.Context) []*Account

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

type AccountDelete

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

AccountDelete is the builder for deleting a Account entity.

func (*AccountDelete) Exec

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

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

func (*AccountDelete) ExecContext

func (c *AccountDelete) 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 (*AccountDelete) ExecX

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

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

func (*AccountDelete) QueryContext

func (c *AccountDelete) 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 (*AccountDelete) Where

func (_d *AccountDelete) Where(ps ...predicate.Account) *AccountDelete

Where appends a list predicates to the AccountDelete builder.

type AccountDeleteOne

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

AccountDeleteOne is the builder for deleting a single Account entity.

func (*AccountDeleteOne) Exec

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

Exec executes the deletion query.

func (*AccountDeleteOne) ExecX

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

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

func (*AccountDeleteOne) Where

Where appends a list predicates to the AccountDelete builder.

type AccountEdges

type AccountEdges struct {
	// Threads holds the value of the threads edge.
	Threads []*Thread `json:"threads,omitempty"`
	// PendingOps holds the value of the pending_ops edge.
	PendingOps []*PendingOp `json:"pending_ops,omitempty"`
	// NotifyRules holds the value of the notify_rules edge.
	NotifyRules []*NotifyRule `json:"notify_rules,omitempty"`
	// Contacts holds the value of the contacts edge.
	Contacts []*Contact `json:"contacts,omitempty"`
	// Secrets holds the value of the secrets edge.
	Secrets []*Secret `json:"secrets,omitempty"`
	// contains filtered or unexported fields
}

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

func (AccountEdges) ContactsOrErr

func (e AccountEdges) ContactsOrErr() ([]*Contact, error)

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

func (AccountEdges) NotifyRulesOrErr

func (e AccountEdges) NotifyRulesOrErr() ([]*NotifyRule, error)

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

func (AccountEdges) PendingOpsOrErr

func (e AccountEdges) PendingOpsOrErr() ([]*PendingOp, error)

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

func (AccountEdges) SecretsOrErr

func (e AccountEdges) SecretsOrErr() ([]*Secret, error)

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

func (AccountEdges) ThreadsOrErr

func (e AccountEdges) ThreadsOrErr() ([]*Thread, error)

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

type AccountGroupBy

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

AccountGroupBy is the group-by builder for Account entities.

func (*AccountGroupBy) Aggregate

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

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

func (*AccountGroupBy) Bool

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

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

func (*AccountGroupBy) BoolX

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

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

func (*AccountGroupBy) Bools

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

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

func (*AccountGroupBy) BoolsX

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

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

func (*AccountGroupBy) Float64

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

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

func (*AccountGroupBy) Float64X

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

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

func (*AccountGroupBy) Float64s

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

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

func (*AccountGroupBy) Float64sX

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

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

func (*AccountGroupBy) Int

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

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

func (*AccountGroupBy) IntX

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

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

func (*AccountGroupBy) Ints

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

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

func (*AccountGroupBy) IntsX

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

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

func (*AccountGroupBy) Scan

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

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

func (*AccountGroupBy) ScanX

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

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

func (*AccountGroupBy) String

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

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

func (*AccountGroupBy) StringX

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

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

func (*AccountGroupBy) Strings

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

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

func (*AccountGroupBy) StringsX

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

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

type AccountMutation

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

AccountMutation represents an operation that mutates the Account nodes in the graph.

func (*AccountMutation) AddContactIDs

func (m *AccountMutation) AddContactIDs(ids ...int)

AddContactIDs adds the "contacts" edge to the Contact entity by ids.

func (*AccountMutation) AddField

func (m *AccountMutation) 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 (*AccountMutation) AddNotifyRuleIDs

func (m *AccountMutation) AddNotifyRuleIDs(ids ...int)

AddNotifyRuleIDs adds the "notify_rules" edge to the NotifyRule entity by ids.

func (*AccountMutation) AddPendingOpIDs

func (m *AccountMutation) AddPendingOpIDs(ids ...int)

AddPendingOpIDs adds the "pending_ops" edge to the PendingOp entity by ids.

func (*AccountMutation) AddSecretIDs

func (m *AccountMutation) AddSecretIDs(ids ...uuid.UUID)

AddSecretIDs adds the "secrets" edge to the Secret entity by ids.

func (*AccountMutation) AddThreadIDs

func (m *AccountMutation) AddThreadIDs(ids ...int)

AddThreadIDs adds the "threads" edge to the Thread entity by ids.

func (*AccountMutation) AddedEdges

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

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

func (*AccountMutation) AddedField

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

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

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

func (*AccountMutation) AddedIDs

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

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

func (*AccountMutation) AuthError

func (m *AccountMutation) AuthError() (r string, exists bool)

AuthError returns the value of the "auth_error" field in the mutation.

func (*AccountMutation) AuthErrorCleared

func (m *AccountMutation) AuthErrorCleared() bool

AuthErrorCleared returns if the "auth_error" field was cleared in this mutation.

func (*AccountMutation) ClearAuthError

func (m *AccountMutation) ClearAuthError()

ClearAuthError clears the value of the "auth_error" field.

func (*AccountMutation) ClearContacts

func (m *AccountMutation) ClearContacts()

ClearContacts clears the "contacts" edge to the Contact entity.

func (*AccountMutation) ClearEdge

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

func (m *AccountMutation) 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 (*AccountMutation) ClearLastSyncAt

func (m *AccountMutation) ClearLastSyncAt()

ClearLastSyncAt clears the value of the "last_sync_at" field.

func (*AccountMutation) ClearNotifyRules

func (m *AccountMutation) ClearNotifyRules()

ClearNotifyRules clears the "notify_rules" edge to the NotifyRule entity.

func (*AccountMutation) ClearPendingOps

func (m *AccountMutation) ClearPendingOps()

ClearPendingOps clears the "pending_ops" edge to the PendingOp entity.

func (*AccountMutation) ClearSecrets

func (m *AccountMutation) ClearSecrets()

ClearSecrets clears the "secrets" edge to the Secret entity.

func (*AccountMutation) ClearSyncNotice

func (m *AccountMutation) ClearSyncNotice()

ClearSyncNotice clears the value of the "sync_notice" field.

func (*AccountMutation) ClearThreads

func (m *AccountMutation) ClearThreads()

ClearThreads clears the "threads" edge to the Thread entity.

func (*AccountMutation) ClearedEdges

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

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

func (*AccountMutation) ClearedFields

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

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

func (AccountMutation) Client

func (m AccountMutation) 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 (*AccountMutation) Config

func (m *AccountMutation) Config() (r map[string]interface{}, exists bool)

Config returns the value of the "config" field in the mutation.

func (*AccountMutation) ContactsCleared

func (m *AccountMutation) ContactsCleared() bool

ContactsCleared reports if the "contacts" edge to the Contact entity was cleared.

func (*AccountMutation) ContactsIDs

func (m *AccountMutation) ContactsIDs() (ids []int)

ContactsIDs returns the "contacts" edge IDs in the mutation.

func (*AccountMutation) CreatedAt

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

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

func (*AccountMutation) DisplayName

func (m *AccountMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*AccountMutation) EdgeCleared

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

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

func (*AccountMutation) Email

func (m *AccountMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*AccountMutation) ExecContext

func (c *AccountMutation) 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 (*AccountMutation) Field

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

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

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

func (*AccountMutation) Fields

func (m *AccountMutation) 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 (*AccountMutation) GetType

func (m *AccountMutation) GetType() (r account.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*AccountMutation) ID

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

func (m *AccountMutation) 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 (*AccountMutation) LastError

func (m *AccountMutation) LastError() (r string, exists bool)

LastError returns the value of the "last_error" field in the mutation.

func (*AccountMutation) LastSyncAt

func (m *AccountMutation) LastSyncAt() (r time.Time, exists bool)

LastSyncAt returns the value of the "last_sync_at" field in the mutation.

func (*AccountMutation) LastSyncAtCleared

func (m *AccountMutation) LastSyncAtCleared() bool

LastSyncAtCleared returns if the "last_sync_at" field was cleared in this mutation.

func (*AccountMutation) NeedsReauth

func (m *AccountMutation) NeedsReauth() (r bool, exists bool)

NeedsReauth returns the value of the "needs_reauth" field in the mutation.

func (*AccountMutation) NotifyRulesCleared

func (m *AccountMutation) NotifyRulesCleared() bool

NotifyRulesCleared reports if the "notify_rules" edge to the NotifyRule entity was cleared.

func (*AccountMutation) NotifyRulesIDs

func (m *AccountMutation) NotifyRulesIDs() (ids []int)

NotifyRulesIDs returns the "notify_rules" edge IDs in the mutation.

func (*AccountMutation) OldAuthError

func (m *AccountMutation) OldAuthError(ctx context.Context) (v string, err error)

OldAuthError returns the old "auth_error" field's value of the Account entity. If the Account 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 (*AccountMutation) OldConfig

func (m *AccountMutation) OldConfig(ctx context.Context) (v map[string]interface{}, err error)

OldConfig returns the old "config" field's value of the Account entity. If the Account 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 (*AccountMutation) OldCreatedAt

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

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

func (m *AccountMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the Account entity. If the Account 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 (*AccountMutation) OldEmail

func (m *AccountMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Account entity. If the Account 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 (*AccountMutation) OldField

func (m *AccountMutation) 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 (*AccountMutation) OldLastError

func (m *AccountMutation) OldLastError(ctx context.Context) (v string, err error)

OldLastError returns the old "last_error" field's value of the Account entity. If the Account 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 (*AccountMutation) OldLastSyncAt

func (m *AccountMutation) OldLastSyncAt(ctx context.Context) (v *time.Time, err error)

OldLastSyncAt returns the old "last_sync_at" field's value of the Account entity. If the Account 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 (*AccountMutation) OldNeedsReauth

func (m *AccountMutation) OldNeedsReauth(ctx context.Context) (v bool, err error)

OldNeedsReauth returns the old "needs_reauth" field's value of the Account entity. If the Account 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 (*AccountMutation) OldStatus

func (m *AccountMutation) OldStatus(ctx context.Context) (v account.Status, err error)

OldStatus returns the old "status" field's value of the Account entity. If the Account 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 (*AccountMutation) OldSyncCursor

func (m *AccountMutation) OldSyncCursor(ctx context.Context) (v string, err error)

OldSyncCursor returns the old "sync_cursor" field's value of the Account entity. If the Account 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 (*AccountMutation) OldSyncNotice

func (m *AccountMutation) OldSyncNotice(ctx context.Context) (v string, err error)

OldSyncNotice returns the old "sync_notice" field's value of the Account entity. If the Account 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 (*AccountMutation) OldType

func (m *AccountMutation) OldType(ctx context.Context) (v account.Type, err error)

OldType returns the old "type" field's value of the Account entity. If the Account 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 (*AccountMutation) Op

func (m *AccountMutation) Op() Op

Op returns the operation name.

func (*AccountMutation) PendingOpsCleared

func (m *AccountMutation) PendingOpsCleared() bool

PendingOpsCleared reports if the "pending_ops" edge to the PendingOp entity was cleared.

func (*AccountMutation) PendingOpsIDs

func (m *AccountMutation) PendingOpsIDs() (ids []int)

PendingOpsIDs returns the "pending_ops" edge IDs in the mutation.

func (*AccountMutation) QueryContext

func (c *AccountMutation) 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 (*AccountMutation) RemoveContactIDs

func (m *AccountMutation) RemoveContactIDs(ids ...int)

RemoveContactIDs removes the "contacts" edge to the Contact entity by IDs.

func (*AccountMutation) RemoveNotifyRuleIDs

func (m *AccountMutation) RemoveNotifyRuleIDs(ids ...int)

RemoveNotifyRuleIDs removes the "notify_rules" edge to the NotifyRule entity by IDs.

func (*AccountMutation) RemovePendingOpIDs

func (m *AccountMutation) RemovePendingOpIDs(ids ...int)

RemovePendingOpIDs removes the "pending_ops" edge to the PendingOp entity by IDs.

func (*AccountMutation) RemoveSecretIDs

func (m *AccountMutation) RemoveSecretIDs(ids ...uuid.UUID)

RemoveSecretIDs removes the "secrets" edge to the Secret entity by IDs.

func (*AccountMutation) RemoveThreadIDs

func (m *AccountMutation) RemoveThreadIDs(ids ...int)

RemoveThreadIDs removes the "threads" edge to the Thread entity by IDs.

func (*AccountMutation) RemovedContactsIDs

func (m *AccountMutation) RemovedContactsIDs() (ids []int)

RemovedContacts returns the removed IDs of the "contacts" edge to the Contact entity.

func (*AccountMutation) RemovedEdges

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

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

func (*AccountMutation) RemovedIDs

func (m *AccountMutation) 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 (*AccountMutation) RemovedNotifyRulesIDs

func (m *AccountMutation) RemovedNotifyRulesIDs() (ids []int)

RemovedNotifyRules returns the removed IDs of the "notify_rules" edge to the NotifyRule entity.

func (*AccountMutation) RemovedPendingOpsIDs

func (m *AccountMutation) RemovedPendingOpsIDs() (ids []int)

RemovedPendingOps returns the removed IDs of the "pending_ops" edge to the PendingOp entity.

func (*AccountMutation) RemovedSecretsIDs

func (m *AccountMutation) RemovedSecretsIDs() (ids []uuid.UUID)

RemovedSecrets returns the removed IDs of the "secrets" edge to the Secret entity.

func (*AccountMutation) RemovedThreadsIDs

func (m *AccountMutation) RemovedThreadsIDs() (ids []int)

RemovedThreads returns the removed IDs of the "threads" edge to the Thread entity.

func (*AccountMutation) ResetAuthError

func (m *AccountMutation) ResetAuthError()

ResetAuthError resets all changes to the "auth_error" field.

func (*AccountMutation) ResetConfig

func (m *AccountMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*AccountMutation) ResetContacts

func (m *AccountMutation) ResetContacts()

ResetContacts resets all changes to the "contacts" edge.

func (*AccountMutation) ResetCreatedAt

func (m *AccountMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AccountMutation) ResetDisplayName

func (m *AccountMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*AccountMutation) ResetEdge

func (m *AccountMutation) 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 (*AccountMutation) ResetEmail

func (m *AccountMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*AccountMutation) ResetField

func (m *AccountMutation) 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 (*AccountMutation) ResetLastError

func (m *AccountMutation) ResetLastError()

ResetLastError resets all changes to the "last_error" field.

func (*AccountMutation) ResetLastSyncAt

func (m *AccountMutation) ResetLastSyncAt()

ResetLastSyncAt resets all changes to the "last_sync_at" field.

func (*AccountMutation) ResetNeedsReauth

func (m *AccountMutation) ResetNeedsReauth()

ResetNeedsReauth resets all changes to the "needs_reauth" field.

func (*AccountMutation) ResetNotifyRules

func (m *AccountMutation) ResetNotifyRules()

ResetNotifyRules resets all changes to the "notify_rules" edge.

func (*AccountMutation) ResetPendingOps

func (m *AccountMutation) ResetPendingOps()

ResetPendingOps resets all changes to the "pending_ops" edge.

func (*AccountMutation) ResetSecrets

func (m *AccountMutation) ResetSecrets()

ResetSecrets resets all changes to the "secrets" edge.

func (*AccountMutation) ResetStatus

func (m *AccountMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*AccountMutation) ResetSyncCursor

func (m *AccountMutation) ResetSyncCursor()

ResetSyncCursor resets all changes to the "sync_cursor" field.

func (*AccountMutation) ResetSyncNotice

func (m *AccountMutation) ResetSyncNotice()

ResetSyncNotice resets all changes to the "sync_notice" field.

func (*AccountMutation) ResetThreads

func (m *AccountMutation) ResetThreads()

ResetThreads resets all changes to the "threads" edge.

func (*AccountMutation) ResetType

func (m *AccountMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*AccountMutation) SecretsCleared

func (m *AccountMutation) SecretsCleared() bool

SecretsCleared reports if the "secrets" edge to the Secret entity was cleared.

func (*AccountMutation) SecretsIDs

func (m *AccountMutation) SecretsIDs() (ids []uuid.UUID)

SecretsIDs returns the "secrets" edge IDs in the mutation.

func (*AccountMutation) SetAuthError

func (m *AccountMutation) SetAuthError(s string)

SetAuthError sets the "auth_error" field.

func (*AccountMutation) SetConfig

func (m *AccountMutation) SetConfig(value map[string]interface{})

SetConfig sets the "config" field.

func (*AccountMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AccountMutation) SetDisplayName

func (m *AccountMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*AccountMutation) SetEmail

func (m *AccountMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*AccountMutation) SetField

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

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

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

func (*AccountMutation) SetLastError

func (m *AccountMutation) SetLastError(s string)

SetLastError sets the "last_error" field.

func (*AccountMutation) SetLastSyncAt

func (m *AccountMutation) SetLastSyncAt(t time.Time)

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountMutation) SetNeedsReauth

func (m *AccountMutation) SetNeedsReauth(b bool)

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountMutation) SetOp

func (m *AccountMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AccountMutation) SetStatus

func (m *AccountMutation) SetStatus(a account.Status)

SetStatus sets the "status" field.

func (*AccountMutation) SetSyncCursor

func (m *AccountMutation) SetSyncCursor(s string)

SetSyncCursor sets the "sync_cursor" field.

func (*AccountMutation) SetSyncNotice

func (m *AccountMutation) SetSyncNotice(s string)

SetSyncNotice sets the "sync_notice" field.

func (*AccountMutation) SetType

func (m *AccountMutation) SetType(a account.Type)

SetType sets the "type" field.

func (*AccountMutation) Status

func (m *AccountMutation) Status() (r account.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*AccountMutation) SyncCursor

func (m *AccountMutation) SyncCursor() (r string, exists bool)

SyncCursor returns the value of the "sync_cursor" field in the mutation.

func (*AccountMutation) SyncNotice

func (m *AccountMutation) SyncNotice() (r string, exists bool)

SyncNotice returns the value of the "sync_notice" field in the mutation.

func (*AccountMutation) SyncNoticeCleared

func (m *AccountMutation) SyncNoticeCleared() bool

SyncNoticeCleared returns if the "sync_notice" field was cleared in this mutation.

func (*AccountMutation) ThreadsCleared

func (m *AccountMutation) ThreadsCleared() bool

ThreadsCleared reports if the "threads" edge to the Thread entity was cleared.

func (*AccountMutation) ThreadsIDs

func (m *AccountMutation) ThreadsIDs() (ids []int)

ThreadsIDs returns the "threads" edge IDs in the mutation.

func (AccountMutation) Tx

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

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

func (*AccountMutation) Type

func (m *AccountMutation) Type() string

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

func (*AccountMutation) Where

func (m *AccountMutation) Where(ps ...predicate.Account)

Where appends a list predicates to the AccountMutation builder.

func (*AccountMutation) WhereP

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

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

type AccountQuery

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

AccountQuery is the builder for querying Account entities.

func (*AccountQuery) Aggregate

func (_q *AccountQuery) Aggregate(fns ...AggregateFunc) *AccountSelect

Aggregate returns a AccountSelect configured with the given aggregations.

func (*AccountQuery) All

func (_q *AccountQuery) All(ctx context.Context) ([]*Account, error)

All executes the query and returns a list of Accounts.

func (*AccountQuery) AllX

func (_q *AccountQuery) AllX(ctx context.Context) []*Account

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

func (*AccountQuery) Clone

func (_q *AccountQuery) Clone() *AccountQuery

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

func (*AccountQuery) Count

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

Count returns the count of the given query.

func (*AccountQuery) CountX

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

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

func (*AccountQuery) ExecContext

func (c *AccountQuery) 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 (*AccountQuery) Exist

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

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

func (*AccountQuery) ExistX

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

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

func (*AccountQuery) First

func (_q *AccountQuery) First(ctx context.Context) (*Account, error)

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

func (*AccountQuery) FirstID

func (_q *AccountQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AccountQuery) FirstIDX

func (_q *AccountQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AccountQuery) FirstX

func (_q *AccountQuery) FirstX(ctx context.Context) *Account

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

func (*AccountQuery) GroupBy

func (_q *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy

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

Example:

var v []struct {
	Type account.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Account.Query().
	GroupBy(account.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AccountQuery) IDs

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

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

func (*AccountQuery) IDsX

func (_q *AccountQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AccountQuery) Limit

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

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

func (*AccountQuery) Modify

func (_q *AccountQuery) Modify(modifiers ...func(s *sql.Selector)) *AccountSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*AccountQuery) Offset

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

Offset to start from.

func (*AccountQuery) Only

func (_q *AccountQuery) Only(ctx context.Context) (*Account, error)

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

func (*AccountQuery) OnlyID

func (_q *AccountQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AccountQuery) OnlyIDX

func (_q *AccountQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AccountQuery) OnlyX

func (_q *AccountQuery) OnlyX(ctx context.Context) *Account

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

func (*AccountQuery) Order

func (_q *AccountQuery) Order(o ...account.OrderOption) *AccountQuery

Order specifies how the records should be ordered.

func (*AccountQuery) QueryContacts

func (_q *AccountQuery) QueryContacts() *ContactQuery

QueryContacts chains the current query on the "contacts" edge.

func (*AccountQuery) QueryContext

func (c *AccountQuery) 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 (*AccountQuery) QueryNotifyRules

func (_q *AccountQuery) QueryNotifyRules() *NotifyRuleQuery

QueryNotifyRules chains the current query on the "notify_rules" edge.

func (*AccountQuery) QueryPendingOps

func (_q *AccountQuery) QueryPendingOps() *PendingOpQuery

QueryPendingOps chains the current query on the "pending_ops" edge.

func (*AccountQuery) QuerySecrets

func (_q *AccountQuery) QuerySecrets() *SecretQuery

QuerySecrets chains the current query on the "secrets" edge.

func (*AccountQuery) QueryThreads

func (_q *AccountQuery) QueryThreads() *ThreadQuery

QueryThreads chains the current query on the "threads" edge.

func (*AccountQuery) Select

func (_q *AccountQuery) Select(fields ...string) *AccountSelect

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

Example:

var v []struct {
	Type account.Type `json:"type,omitempty"`
}

client.Account.Query().
	Select(account.FieldType).
	Scan(ctx, &v)

func (*AccountQuery) Unique

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

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

func (_q *AccountQuery) Where(ps ...predicate.Account) *AccountQuery

Where adds a new predicate for the AccountQuery builder.

func (*AccountQuery) WithContacts

func (_q *AccountQuery) WithContacts(opts ...func(*ContactQuery)) *AccountQuery

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

func (*AccountQuery) WithNotifyRules

func (_q *AccountQuery) WithNotifyRules(opts ...func(*NotifyRuleQuery)) *AccountQuery

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

func (*AccountQuery) WithPendingOps

func (_q *AccountQuery) WithPendingOps(opts ...func(*PendingOpQuery)) *AccountQuery

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

func (*AccountQuery) WithSecrets

func (_q *AccountQuery) WithSecrets(opts ...func(*SecretQuery)) *AccountQuery

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

func (*AccountQuery) WithThreads

func (_q *AccountQuery) WithThreads(opts ...func(*ThreadQuery)) *AccountQuery

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

type AccountSelect

type AccountSelect struct {
	*AccountQuery
	// contains filtered or unexported fields
}

AccountSelect is the builder for selecting fields of Account entities.

func (*AccountSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AccountSelect) Bool

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

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

func (*AccountSelect) BoolX

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

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

func (*AccountSelect) Bools

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

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

func (*AccountSelect) BoolsX

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

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

func (AccountSelect) ExecContext

func (c AccountSelect) 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 (*AccountSelect) Float64

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

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

func (*AccountSelect) Float64X

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

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

func (*AccountSelect) Float64s

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

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

func (*AccountSelect) Float64sX

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

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

func (*AccountSelect) Int

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

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

func (*AccountSelect) IntX

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

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

func (*AccountSelect) Ints

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

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

func (*AccountSelect) IntsX

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

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

func (*AccountSelect) Modify

func (_s *AccountSelect) Modify(modifiers ...func(s *sql.Selector)) *AccountSelect

Modify adds a query modifier for attaching custom logic to queries.

func (AccountSelect) QueryContext

func (c AccountSelect) 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 (*AccountSelect) Scan

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

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

func (*AccountSelect) ScanX

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

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

func (*AccountSelect) String

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

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

func (*AccountSelect) StringX

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

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

func (*AccountSelect) Strings

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

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

func (*AccountSelect) StringsX

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

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

type AccountUpdate

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

AccountUpdate is the builder for updating Account entities.

func (*AccountUpdate) AddContactIDs

func (_u *AccountUpdate) AddContactIDs(ids ...int) *AccountUpdate

AddContactIDs adds the "contacts" edge to the Contact entity by IDs.

func (*AccountUpdate) AddContacts

func (_u *AccountUpdate) AddContacts(v ...*Contact) *AccountUpdate

AddContacts adds the "contacts" edges to the Contact entity.

func (*AccountUpdate) AddNotifyRuleIDs

func (_u *AccountUpdate) AddNotifyRuleIDs(ids ...int) *AccountUpdate

AddNotifyRuleIDs adds the "notify_rules" edge to the NotifyRule entity by IDs.

func (*AccountUpdate) AddNotifyRules

func (_u *AccountUpdate) AddNotifyRules(v ...*NotifyRule) *AccountUpdate

AddNotifyRules adds the "notify_rules" edges to the NotifyRule entity.

func (*AccountUpdate) AddPendingOpIDs

func (_u *AccountUpdate) AddPendingOpIDs(ids ...int) *AccountUpdate

AddPendingOpIDs adds the "pending_ops" edge to the PendingOp entity by IDs.

func (*AccountUpdate) AddPendingOps

func (_u *AccountUpdate) AddPendingOps(v ...*PendingOp) *AccountUpdate

AddPendingOps adds the "pending_ops" edges to the PendingOp entity.

func (*AccountUpdate) AddSecretIDs

func (_u *AccountUpdate) AddSecretIDs(ids ...uuid.UUID) *AccountUpdate

AddSecretIDs adds the "secrets" edge to the Secret entity by IDs.

func (*AccountUpdate) AddSecrets

func (_u *AccountUpdate) AddSecrets(v ...*Secret) *AccountUpdate

AddSecrets adds the "secrets" edges to the Secret entity.

func (*AccountUpdate) AddThreadIDs

func (_u *AccountUpdate) AddThreadIDs(ids ...int) *AccountUpdate

AddThreadIDs adds the "threads" edge to the Thread entity by IDs.

func (*AccountUpdate) AddThreads

func (_u *AccountUpdate) AddThreads(v ...*Thread) *AccountUpdate

AddThreads adds the "threads" edges to the Thread entity.

func (*AccountUpdate) ClearAuthError

func (_u *AccountUpdate) ClearAuthError() *AccountUpdate

ClearAuthError clears the value of the "auth_error" field.

func (*AccountUpdate) ClearContacts

func (_u *AccountUpdate) ClearContacts() *AccountUpdate

ClearContacts clears all "contacts" edges to the Contact entity.

func (*AccountUpdate) ClearLastSyncAt

func (_u *AccountUpdate) ClearLastSyncAt() *AccountUpdate

ClearLastSyncAt clears the value of the "last_sync_at" field.

func (*AccountUpdate) ClearNotifyRules

func (_u *AccountUpdate) ClearNotifyRules() *AccountUpdate

ClearNotifyRules clears all "notify_rules" edges to the NotifyRule entity.

func (*AccountUpdate) ClearPendingOps

func (_u *AccountUpdate) ClearPendingOps() *AccountUpdate

ClearPendingOps clears all "pending_ops" edges to the PendingOp entity.

func (*AccountUpdate) ClearSecrets

func (_u *AccountUpdate) ClearSecrets() *AccountUpdate

ClearSecrets clears all "secrets" edges to the Secret entity.

func (*AccountUpdate) ClearSyncNotice

func (_u *AccountUpdate) ClearSyncNotice() *AccountUpdate

ClearSyncNotice clears the value of the "sync_notice" field.

func (*AccountUpdate) ClearThreads

func (_u *AccountUpdate) ClearThreads() *AccountUpdate

ClearThreads clears all "threads" edges to the Thread entity.

func (*AccountUpdate) Exec

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

Exec executes the query.

func (*AccountUpdate) ExecContext

func (c *AccountUpdate) 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 (*AccountUpdate) ExecX

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

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

func (*AccountUpdate) Modify

func (_u *AccountUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AccountUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*AccountUpdate) Mutation

func (_u *AccountUpdate) Mutation() *AccountMutation

Mutation returns the AccountMutation object of the builder.

func (*AccountUpdate) QueryContext

func (c *AccountUpdate) 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 (*AccountUpdate) RemoveContactIDs

func (_u *AccountUpdate) RemoveContactIDs(ids ...int) *AccountUpdate

RemoveContactIDs removes the "contacts" edge to Contact entities by IDs.

func (*AccountUpdate) RemoveContacts

func (_u *AccountUpdate) RemoveContacts(v ...*Contact) *AccountUpdate

RemoveContacts removes "contacts" edges to Contact entities.

func (*AccountUpdate) RemoveNotifyRuleIDs

func (_u *AccountUpdate) RemoveNotifyRuleIDs(ids ...int) *AccountUpdate

RemoveNotifyRuleIDs removes the "notify_rules" edge to NotifyRule entities by IDs.

func (*AccountUpdate) RemoveNotifyRules

func (_u *AccountUpdate) RemoveNotifyRules(v ...*NotifyRule) *AccountUpdate

RemoveNotifyRules removes "notify_rules" edges to NotifyRule entities.

func (*AccountUpdate) RemovePendingOpIDs

func (_u *AccountUpdate) RemovePendingOpIDs(ids ...int) *AccountUpdate

RemovePendingOpIDs removes the "pending_ops" edge to PendingOp entities by IDs.

func (*AccountUpdate) RemovePendingOps

func (_u *AccountUpdate) RemovePendingOps(v ...*PendingOp) *AccountUpdate

RemovePendingOps removes "pending_ops" edges to PendingOp entities.

func (*AccountUpdate) RemoveSecretIDs

func (_u *AccountUpdate) RemoveSecretIDs(ids ...uuid.UUID) *AccountUpdate

RemoveSecretIDs removes the "secrets" edge to Secret entities by IDs.

func (*AccountUpdate) RemoveSecrets

func (_u *AccountUpdate) RemoveSecrets(v ...*Secret) *AccountUpdate

RemoveSecrets removes "secrets" edges to Secret entities.

func (*AccountUpdate) RemoveThreadIDs

func (_u *AccountUpdate) RemoveThreadIDs(ids ...int) *AccountUpdate

RemoveThreadIDs removes the "threads" edge to Thread entities by IDs.

func (*AccountUpdate) RemoveThreads

func (_u *AccountUpdate) RemoveThreads(v ...*Thread) *AccountUpdate

RemoveThreads removes "threads" edges to Thread entities.

func (*AccountUpdate) Save

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

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

func (*AccountUpdate) SaveX

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

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

func (*AccountUpdate) SetAuthError

func (_u *AccountUpdate) SetAuthError(v string) *AccountUpdate

SetAuthError sets the "auth_error" field.

func (*AccountUpdate) SetConfig

func (_u *AccountUpdate) SetConfig(v map[string]interface{}) *AccountUpdate

SetConfig sets the "config" field.

func (*AccountUpdate) SetDisplayName

func (_u *AccountUpdate) SetDisplayName(v string) *AccountUpdate

SetDisplayName sets the "display_name" field.

func (*AccountUpdate) SetEmail

func (_u *AccountUpdate) SetEmail(v string) *AccountUpdate

SetEmail sets the "email" field.

func (*AccountUpdate) SetLastError

func (_u *AccountUpdate) SetLastError(v string) *AccountUpdate

SetLastError sets the "last_error" field.

func (*AccountUpdate) SetLastSyncAt

func (_u *AccountUpdate) SetLastSyncAt(v time.Time) *AccountUpdate

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountUpdate) SetNeedsReauth

func (_u *AccountUpdate) SetNeedsReauth(v bool) *AccountUpdate

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountUpdate) SetNillableAuthError

func (_u *AccountUpdate) SetNillableAuthError(v *string) *AccountUpdate

SetNillableAuthError sets the "auth_error" field if the given value is not nil.

func (*AccountUpdate) SetNillableDisplayName

func (_u *AccountUpdate) SetNillableDisplayName(v *string) *AccountUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*AccountUpdate) SetNillableEmail

func (_u *AccountUpdate) SetNillableEmail(v *string) *AccountUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*AccountUpdate) SetNillableLastError

func (_u *AccountUpdate) SetNillableLastError(v *string) *AccountUpdate

SetNillableLastError sets the "last_error" field if the given value is not nil.

func (*AccountUpdate) SetNillableLastSyncAt

func (_u *AccountUpdate) SetNillableLastSyncAt(v *time.Time) *AccountUpdate

SetNillableLastSyncAt sets the "last_sync_at" field if the given value is not nil.

func (*AccountUpdate) SetNillableNeedsReauth

func (_u *AccountUpdate) SetNillableNeedsReauth(v *bool) *AccountUpdate

SetNillableNeedsReauth sets the "needs_reauth" field if the given value is not nil.

func (*AccountUpdate) SetNillableStatus

func (_u *AccountUpdate) SetNillableStatus(v *account.Status) *AccountUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*AccountUpdate) SetNillableSyncCursor

func (_u *AccountUpdate) SetNillableSyncCursor(v *string) *AccountUpdate

SetNillableSyncCursor sets the "sync_cursor" field if the given value is not nil.

func (*AccountUpdate) SetNillableSyncNotice

func (_u *AccountUpdate) SetNillableSyncNotice(v *string) *AccountUpdate

SetNillableSyncNotice sets the "sync_notice" field if the given value is not nil.

func (*AccountUpdate) SetNillableType

func (_u *AccountUpdate) SetNillableType(v *account.Type) *AccountUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*AccountUpdate) SetStatus

func (_u *AccountUpdate) SetStatus(v account.Status) *AccountUpdate

SetStatus sets the "status" field.

func (*AccountUpdate) SetSyncCursor

func (_u *AccountUpdate) SetSyncCursor(v string) *AccountUpdate

SetSyncCursor sets the "sync_cursor" field.

func (*AccountUpdate) SetSyncNotice

func (_u *AccountUpdate) SetSyncNotice(v string) *AccountUpdate

SetSyncNotice sets the "sync_notice" field.

func (*AccountUpdate) SetType

func (_u *AccountUpdate) SetType(v account.Type) *AccountUpdate

SetType sets the "type" field.

func (*AccountUpdate) Where

func (_u *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate

Where appends a list predicates to the AccountUpdate builder.

type AccountUpdateOne

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

AccountUpdateOne is the builder for updating a single Account entity.

func (*AccountUpdateOne) AddContactIDs

func (_u *AccountUpdateOne) AddContactIDs(ids ...int) *AccountUpdateOne

AddContactIDs adds the "contacts" edge to the Contact entity by IDs.

func (*AccountUpdateOne) AddContacts

func (_u *AccountUpdateOne) AddContacts(v ...*Contact) *AccountUpdateOne

AddContacts adds the "contacts" edges to the Contact entity.

func (*AccountUpdateOne) AddNotifyRuleIDs

func (_u *AccountUpdateOne) AddNotifyRuleIDs(ids ...int) *AccountUpdateOne

AddNotifyRuleIDs adds the "notify_rules" edge to the NotifyRule entity by IDs.

func (*AccountUpdateOne) AddNotifyRules

func (_u *AccountUpdateOne) AddNotifyRules(v ...*NotifyRule) *AccountUpdateOne

AddNotifyRules adds the "notify_rules" edges to the NotifyRule entity.

func (*AccountUpdateOne) AddPendingOpIDs

func (_u *AccountUpdateOne) AddPendingOpIDs(ids ...int) *AccountUpdateOne

AddPendingOpIDs adds the "pending_ops" edge to the PendingOp entity by IDs.

func (*AccountUpdateOne) AddPendingOps

func (_u *AccountUpdateOne) AddPendingOps(v ...*PendingOp) *AccountUpdateOne

AddPendingOps adds the "pending_ops" edges to the PendingOp entity.

func (*AccountUpdateOne) AddSecretIDs

func (_u *AccountUpdateOne) AddSecretIDs(ids ...uuid.UUID) *AccountUpdateOne

AddSecretIDs adds the "secrets" edge to the Secret entity by IDs.

func (*AccountUpdateOne) AddSecrets

func (_u *AccountUpdateOne) AddSecrets(v ...*Secret) *AccountUpdateOne

AddSecrets adds the "secrets" edges to the Secret entity.

func (*AccountUpdateOne) AddThreadIDs

func (_u *AccountUpdateOne) AddThreadIDs(ids ...int) *AccountUpdateOne

AddThreadIDs adds the "threads" edge to the Thread entity by IDs.

func (*AccountUpdateOne) AddThreads

func (_u *AccountUpdateOne) AddThreads(v ...*Thread) *AccountUpdateOne

AddThreads adds the "threads" edges to the Thread entity.

func (*AccountUpdateOne) ClearAuthError

func (_u *AccountUpdateOne) ClearAuthError() *AccountUpdateOne

ClearAuthError clears the value of the "auth_error" field.

func (*AccountUpdateOne) ClearContacts

func (_u *AccountUpdateOne) ClearContacts() *AccountUpdateOne

ClearContacts clears all "contacts" edges to the Contact entity.

func (*AccountUpdateOne) ClearLastSyncAt

func (_u *AccountUpdateOne) ClearLastSyncAt() *AccountUpdateOne

ClearLastSyncAt clears the value of the "last_sync_at" field.

func (*AccountUpdateOne) ClearNotifyRules

func (_u *AccountUpdateOne) ClearNotifyRules() *AccountUpdateOne

ClearNotifyRules clears all "notify_rules" edges to the NotifyRule entity.

func (*AccountUpdateOne) ClearPendingOps

func (_u *AccountUpdateOne) ClearPendingOps() *AccountUpdateOne

ClearPendingOps clears all "pending_ops" edges to the PendingOp entity.

func (*AccountUpdateOne) ClearSecrets

func (_u *AccountUpdateOne) ClearSecrets() *AccountUpdateOne

ClearSecrets clears all "secrets" edges to the Secret entity.

func (*AccountUpdateOne) ClearSyncNotice

func (_u *AccountUpdateOne) ClearSyncNotice() *AccountUpdateOne

ClearSyncNotice clears the value of the "sync_notice" field.

func (*AccountUpdateOne) ClearThreads

func (_u *AccountUpdateOne) ClearThreads() *AccountUpdateOne

ClearThreads clears all "threads" edges to the Thread entity.

func (*AccountUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AccountUpdateOne) ExecContext

func (c *AccountUpdateOne) 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 (*AccountUpdateOne) ExecX

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

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

func (*AccountUpdateOne) Modify

func (_u *AccountUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AccountUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*AccountUpdateOne) Mutation

func (_u *AccountUpdateOne) Mutation() *AccountMutation

Mutation returns the AccountMutation object of the builder.

func (*AccountUpdateOne) QueryContext

func (c *AccountUpdateOne) 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 (*AccountUpdateOne) RemoveContactIDs

func (_u *AccountUpdateOne) RemoveContactIDs(ids ...int) *AccountUpdateOne

RemoveContactIDs removes the "contacts" edge to Contact entities by IDs.

func (*AccountUpdateOne) RemoveContacts

func (_u *AccountUpdateOne) RemoveContacts(v ...*Contact) *AccountUpdateOne

RemoveContacts removes "contacts" edges to Contact entities.

func (*AccountUpdateOne) RemoveNotifyRuleIDs

func (_u *AccountUpdateOne) RemoveNotifyRuleIDs(ids ...int) *AccountUpdateOne

RemoveNotifyRuleIDs removes the "notify_rules" edge to NotifyRule entities by IDs.

func (*AccountUpdateOne) RemoveNotifyRules

func (_u *AccountUpdateOne) RemoveNotifyRules(v ...*NotifyRule) *AccountUpdateOne

RemoveNotifyRules removes "notify_rules" edges to NotifyRule entities.

func (*AccountUpdateOne) RemovePendingOpIDs

func (_u *AccountUpdateOne) RemovePendingOpIDs(ids ...int) *AccountUpdateOne

RemovePendingOpIDs removes the "pending_ops" edge to PendingOp entities by IDs.

func (*AccountUpdateOne) RemovePendingOps

func (_u *AccountUpdateOne) RemovePendingOps(v ...*PendingOp) *AccountUpdateOne

RemovePendingOps removes "pending_ops" edges to PendingOp entities.

func (*AccountUpdateOne) RemoveSecretIDs

func (_u *AccountUpdateOne) RemoveSecretIDs(ids ...uuid.UUID) *AccountUpdateOne

RemoveSecretIDs removes the "secrets" edge to Secret entities by IDs.

func (*AccountUpdateOne) RemoveSecrets

func (_u *AccountUpdateOne) RemoveSecrets(v ...*Secret) *AccountUpdateOne

RemoveSecrets removes "secrets" edges to Secret entities.

func (*AccountUpdateOne) RemoveThreadIDs

func (_u *AccountUpdateOne) RemoveThreadIDs(ids ...int) *AccountUpdateOne

RemoveThreadIDs removes the "threads" edge to Thread entities by IDs.

func (*AccountUpdateOne) RemoveThreads

func (_u *AccountUpdateOne) RemoveThreads(v ...*Thread) *AccountUpdateOne

RemoveThreads removes "threads" edges to Thread entities.

func (*AccountUpdateOne) Save

func (_u *AccountUpdateOne) Save(ctx context.Context) (*Account, error)

Save executes the query and returns the updated Account entity.

func (*AccountUpdateOne) SaveX

func (_u *AccountUpdateOne) SaveX(ctx context.Context) *Account

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

func (*AccountUpdateOne) Select

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

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

func (*AccountUpdateOne) SetAuthError

func (_u *AccountUpdateOne) SetAuthError(v string) *AccountUpdateOne

SetAuthError sets the "auth_error" field.

func (*AccountUpdateOne) SetConfig

func (_u *AccountUpdateOne) SetConfig(v map[string]interface{}) *AccountUpdateOne

SetConfig sets the "config" field.

func (*AccountUpdateOne) SetDisplayName

func (_u *AccountUpdateOne) SetDisplayName(v string) *AccountUpdateOne

SetDisplayName sets the "display_name" field.

func (*AccountUpdateOne) SetEmail

func (_u *AccountUpdateOne) SetEmail(v string) *AccountUpdateOne

SetEmail sets the "email" field.

func (*AccountUpdateOne) SetLastError

func (_u *AccountUpdateOne) SetLastError(v string) *AccountUpdateOne

SetLastError sets the "last_error" field.

func (*AccountUpdateOne) SetLastSyncAt

func (_u *AccountUpdateOne) SetLastSyncAt(v time.Time) *AccountUpdateOne

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountUpdateOne) SetNeedsReauth

func (_u *AccountUpdateOne) SetNeedsReauth(v bool) *AccountUpdateOne

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountUpdateOne) SetNillableAuthError

func (_u *AccountUpdateOne) SetNillableAuthError(v *string) *AccountUpdateOne

SetNillableAuthError sets the "auth_error" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableDisplayName

func (_u *AccountUpdateOne) SetNillableDisplayName(v *string) *AccountUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableEmail

func (_u *AccountUpdateOne) SetNillableEmail(v *string) *AccountUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableLastError

func (_u *AccountUpdateOne) SetNillableLastError(v *string) *AccountUpdateOne

SetNillableLastError sets the "last_error" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableLastSyncAt

func (_u *AccountUpdateOne) SetNillableLastSyncAt(v *time.Time) *AccountUpdateOne

SetNillableLastSyncAt sets the "last_sync_at" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableNeedsReauth

func (_u *AccountUpdateOne) SetNillableNeedsReauth(v *bool) *AccountUpdateOne

SetNillableNeedsReauth sets the "needs_reauth" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableStatus

func (_u *AccountUpdateOne) SetNillableStatus(v *account.Status) *AccountUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableSyncCursor

func (_u *AccountUpdateOne) SetNillableSyncCursor(v *string) *AccountUpdateOne

SetNillableSyncCursor sets the "sync_cursor" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableSyncNotice

func (_u *AccountUpdateOne) SetNillableSyncNotice(v *string) *AccountUpdateOne

SetNillableSyncNotice sets the "sync_notice" field if the given value is not nil.

func (*AccountUpdateOne) SetNillableType

func (_u *AccountUpdateOne) SetNillableType(v *account.Type) *AccountUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*AccountUpdateOne) SetStatus

func (_u *AccountUpdateOne) SetStatus(v account.Status) *AccountUpdateOne

SetStatus sets the "status" field.

func (*AccountUpdateOne) SetSyncCursor

func (_u *AccountUpdateOne) SetSyncCursor(v string) *AccountUpdateOne

SetSyncCursor sets the "sync_cursor" field.

func (*AccountUpdateOne) SetSyncNotice

func (_u *AccountUpdateOne) SetSyncNotice(v string) *AccountUpdateOne

SetSyncNotice sets the "sync_notice" field.

func (*AccountUpdateOne) SetType

SetType sets the "type" field.

func (*AccountUpdateOne) Where

Where appends a list predicates to the AccountUpdate builder.

type AccountUpsert

type AccountUpsert struct {
	*sql.UpdateSet
}

AccountUpsert is the "OnConflict" setter.

func (*AccountUpsert) ClearAuthError

func (u *AccountUpsert) ClearAuthError() *AccountUpsert

ClearAuthError clears the value of the "auth_error" field.

func (*AccountUpsert) ClearLastSyncAt

func (u *AccountUpsert) ClearLastSyncAt() *AccountUpsert

ClearLastSyncAt clears the value of the "last_sync_at" field.

func (*AccountUpsert) ClearSyncNotice

func (u *AccountUpsert) ClearSyncNotice() *AccountUpsert

ClearSyncNotice clears the value of the "sync_notice" field.

func (*AccountUpsert) SetAuthError

func (u *AccountUpsert) SetAuthError(v string) *AccountUpsert

SetAuthError sets the "auth_error" field.

func (*AccountUpsert) SetConfig

func (u *AccountUpsert) SetConfig(v map[string]interface{}) *AccountUpsert

SetConfig sets the "config" field.

func (*AccountUpsert) SetDisplayName

func (u *AccountUpsert) SetDisplayName(v string) *AccountUpsert

SetDisplayName sets the "display_name" field.

func (*AccountUpsert) SetEmail

func (u *AccountUpsert) SetEmail(v string) *AccountUpsert

SetEmail sets the "email" field.

func (*AccountUpsert) SetLastError

func (u *AccountUpsert) SetLastError(v string) *AccountUpsert

SetLastError sets the "last_error" field.

func (*AccountUpsert) SetLastSyncAt

func (u *AccountUpsert) SetLastSyncAt(v time.Time) *AccountUpsert

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountUpsert) SetNeedsReauth

func (u *AccountUpsert) SetNeedsReauth(v bool) *AccountUpsert

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountUpsert) SetStatus

func (u *AccountUpsert) SetStatus(v account.Status) *AccountUpsert

SetStatus sets the "status" field.

func (*AccountUpsert) SetSyncCursor

func (u *AccountUpsert) SetSyncCursor(v string) *AccountUpsert

SetSyncCursor sets the "sync_cursor" field.

func (*AccountUpsert) SetSyncNotice

func (u *AccountUpsert) SetSyncNotice(v string) *AccountUpsert

SetSyncNotice sets the "sync_notice" field.

func (*AccountUpsert) SetType

func (u *AccountUpsert) SetType(v account.Type) *AccountUpsert

SetType sets the "type" field.

func (*AccountUpsert) UpdateAuthError

func (u *AccountUpsert) UpdateAuthError() *AccountUpsert

UpdateAuthError sets the "auth_error" field to the value that was provided on create.

func (*AccountUpsert) UpdateConfig

func (u *AccountUpsert) UpdateConfig() *AccountUpsert

UpdateConfig sets the "config" field to the value that was provided on create.

func (*AccountUpsert) UpdateDisplayName

func (u *AccountUpsert) UpdateDisplayName() *AccountUpsert

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*AccountUpsert) UpdateEmail

func (u *AccountUpsert) UpdateEmail() *AccountUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AccountUpsert) UpdateLastError

func (u *AccountUpsert) UpdateLastError() *AccountUpsert

UpdateLastError sets the "last_error" field to the value that was provided on create.

func (*AccountUpsert) UpdateLastSyncAt

func (u *AccountUpsert) UpdateLastSyncAt() *AccountUpsert

UpdateLastSyncAt sets the "last_sync_at" field to the value that was provided on create.

func (*AccountUpsert) UpdateNeedsReauth

func (u *AccountUpsert) UpdateNeedsReauth() *AccountUpsert

UpdateNeedsReauth sets the "needs_reauth" field to the value that was provided on create.

func (*AccountUpsert) UpdateStatus

func (u *AccountUpsert) UpdateStatus() *AccountUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

func (*AccountUpsert) UpdateSyncCursor

func (u *AccountUpsert) UpdateSyncCursor() *AccountUpsert

UpdateSyncCursor sets the "sync_cursor" field to the value that was provided on create.

func (*AccountUpsert) UpdateSyncNotice

func (u *AccountUpsert) UpdateSyncNotice() *AccountUpsert

UpdateSyncNotice sets the "sync_notice" field to the value that was provided on create.

func (*AccountUpsert) UpdateType

func (u *AccountUpsert) UpdateType() *AccountUpsert

UpdateType sets the "type" field to the value that was provided on create.

type AccountUpsertBulk

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

AccountUpsertBulk is the builder for "upsert"-ing a bulk of Account nodes.

func (*AccountUpsertBulk) ClearAuthError

func (u *AccountUpsertBulk) ClearAuthError() *AccountUpsertBulk

ClearAuthError clears the value of the "auth_error" field.

func (*AccountUpsertBulk) ClearLastSyncAt

func (u *AccountUpsertBulk) ClearLastSyncAt() *AccountUpsertBulk

ClearLastSyncAt clears the value of the "last_sync_at" field.

func (*AccountUpsertBulk) ClearSyncNotice

func (u *AccountUpsertBulk) ClearSyncNotice() *AccountUpsertBulk

ClearSyncNotice clears the value of the "sync_notice" field.

func (*AccountUpsertBulk) DoNothing

func (u *AccountUpsertBulk) DoNothing() *AccountUpsertBulk

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

func (*AccountUpsertBulk) Exec

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

Exec executes the query.

func (*AccountUpsertBulk) ExecX

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

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

func (*AccountUpsertBulk) Ignore

func (u *AccountUpsertBulk) Ignore() *AccountUpsertBulk

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

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

func (*AccountUpsertBulk) SetAuthError

func (u *AccountUpsertBulk) SetAuthError(v string) *AccountUpsertBulk

SetAuthError sets the "auth_error" field.

func (*AccountUpsertBulk) SetConfig

func (u *AccountUpsertBulk) SetConfig(v map[string]interface{}) *AccountUpsertBulk

SetConfig sets the "config" field.

func (*AccountUpsertBulk) SetDisplayName

func (u *AccountUpsertBulk) SetDisplayName(v string) *AccountUpsertBulk

SetDisplayName sets the "display_name" field.

func (*AccountUpsertBulk) SetEmail

func (u *AccountUpsertBulk) SetEmail(v string) *AccountUpsertBulk

SetEmail sets the "email" field.

func (*AccountUpsertBulk) SetLastError

func (u *AccountUpsertBulk) SetLastError(v string) *AccountUpsertBulk

SetLastError sets the "last_error" field.

func (*AccountUpsertBulk) SetLastSyncAt

func (u *AccountUpsertBulk) SetLastSyncAt(v time.Time) *AccountUpsertBulk

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountUpsertBulk) SetNeedsReauth

func (u *AccountUpsertBulk) SetNeedsReauth(v bool) *AccountUpsertBulk

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*AccountUpsertBulk) SetSyncCursor

func (u *AccountUpsertBulk) SetSyncCursor(v string) *AccountUpsertBulk

SetSyncCursor sets the "sync_cursor" field.

func (*AccountUpsertBulk) SetSyncNotice

func (u *AccountUpsertBulk) SetSyncNotice(v string) *AccountUpsertBulk

SetSyncNotice sets the "sync_notice" field.

func (*AccountUpsertBulk) SetType

SetType sets the "type" field.

func (*AccountUpsertBulk) Update

func (u *AccountUpsertBulk) Update(set func(*AccountUpsert)) *AccountUpsertBulk

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

func (*AccountUpsertBulk) UpdateAuthError

func (u *AccountUpsertBulk) UpdateAuthError() *AccountUpsertBulk

UpdateAuthError sets the "auth_error" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateConfig

func (u *AccountUpsertBulk) UpdateConfig() *AccountUpsertBulk

UpdateConfig sets the "config" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateDisplayName

func (u *AccountUpsertBulk) UpdateDisplayName() *AccountUpsertBulk

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateEmail

func (u *AccountUpsertBulk) UpdateEmail() *AccountUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateLastError

func (u *AccountUpsertBulk) UpdateLastError() *AccountUpsertBulk

UpdateLastError sets the "last_error" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateLastSyncAt

func (u *AccountUpsertBulk) UpdateLastSyncAt() *AccountUpsertBulk

UpdateLastSyncAt sets the "last_sync_at" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateNeedsReauth

func (u *AccountUpsertBulk) UpdateNeedsReauth() *AccountUpsertBulk

UpdateNeedsReauth sets the "needs_reauth" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateNewValues

func (u *AccountUpsertBulk) UpdateNewValues() *AccountUpsertBulk

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

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

func (*AccountUpsertBulk) UpdateStatus

func (u *AccountUpsertBulk) UpdateStatus() *AccountUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateSyncCursor

func (u *AccountUpsertBulk) UpdateSyncCursor() *AccountUpsertBulk

UpdateSyncCursor sets the "sync_cursor" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateSyncNotice

func (u *AccountUpsertBulk) UpdateSyncNotice() *AccountUpsertBulk

UpdateSyncNotice sets the "sync_notice" field to the value that was provided on create.

func (*AccountUpsertBulk) UpdateType

func (u *AccountUpsertBulk) UpdateType() *AccountUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

type AccountUpsertOne

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

AccountUpsertOne is the builder for "upsert"-ing

one Account node.

func (*AccountUpsertOne) ClearAuthError

func (u *AccountUpsertOne) ClearAuthError() *AccountUpsertOne

ClearAuthError clears the value of the "auth_error" field.

func (*AccountUpsertOne) ClearLastSyncAt

func (u *AccountUpsertOne) ClearLastSyncAt() *AccountUpsertOne

ClearLastSyncAt clears the value of the "last_sync_at" field.

func (*AccountUpsertOne) ClearSyncNotice

func (u *AccountUpsertOne) ClearSyncNotice() *AccountUpsertOne

ClearSyncNotice clears the value of the "sync_notice" field.

func (*AccountUpsertOne) DoNothing

func (u *AccountUpsertOne) DoNothing() *AccountUpsertOne

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

func (*AccountUpsertOne) Exec

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

Exec executes the query.

func (*AccountUpsertOne) ExecX

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

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

func (*AccountUpsertOne) ID

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

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

func (*AccountUpsertOne) IDX

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

func (*AccountUpsertOne) Ignore

func (u *AccountUpsertOne) Ignore() *AccountUpsertOne

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

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

func (*AccountUpsertOne) SetAuthError

func (u *AccountUpsertOne) SetAuthError(v string) *AccountUpsertOne

SetAuthError sets the "auth_error" field.

func (*AccountUpsertOne) SetConfig

func (u *AccountUpsertOne) SetConfig(v map[string]interface{}) *AccountUpsertOne

SetConfig sets the "config" field.

func (*AccountUpsertOne) SetDisplayName

func (u *AccountUpsertOne) SetDisplayName(v string) *AccountUpsertOne

SetDisplayName sets the "display_name" field.

func (*AccountUpsertOne) SetEmail

func (u *AccountUpsertOne) SetEmail(v string) *AccountUpsertOne

SetEmail sets the "email" field.

func (*AccountUpsertOne) SetLastError

func (u *AccountUpsertOne) SetLastError(v string) *AccountUpsertOne

SetLastError sets the "last_error" field.

func (*AccountUpsertOne) SetLastSyncAt

func (u *AccountUpsertOne) SetLastSyncAt(v time.Time) *AccountUpsertOne

SetLastSyncAt sets the "last_sync_at" field.

func (*AccountUpsertOne) SetNeedsReauth

func (u *AccountUpsertOne) SetNeedsReauth(v bool) *AccountUpsertOne

SetNeedsReauth sets the "needs_reauth" field.

func (*AccountUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*AccountUpsertOne) SetSyncCursor

func (u *AccountUpsertOne) SetSyncCursor(v string) *AccountUpsertOne

SetSyncCursor sets the "sync_cursor" field.

func (*AccountUpsertOne) SetSyncNotice

func (u *AccountUpsertOne) SetSyncNotice(v string) *AccountUpsertOne

SetSyncNotice sets the "sync_notice" field.

func (*AccountUpsertOne) SetType

SetType sets the "type" field.

func (*AccountUpsertOne) Update

func (u *AccountUpsertOne) Update(set func(*AccountUpsert)) *AccountUpsertOne

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

func (*AccountUpsertOne) UpdateAuthError

func (u *AccountUpsertOne) UpdateAuthError() *AccountUpsertOne

UpdateAuthError sets the "auth_error" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateConfig

func (u *AccountUpsertOne) UpdateConfig() *AccountUpsertOne

UpdateConfig sets the "config" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateDisplayName

func (u *AccountUpsertOne) UpdateDisplayName() *AccountUpsertOne

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateEmail

func (u *AccountUpsertOne) UpdateEmail() *AccountUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateLastError

func (u *AccountUpsertOne) UpdateLastError() *AccountUpsertOne

UpdateLastError sets the "last_error" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateLastSyncAt

func (u *AccountUpsertOne) UpdateLastSyncAt() *AccountUpsertOne

UpdateLastSyncAt sets the "last_sync_at" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateNeedsReauth

func (u *AccountUpsertOne) UpdateNeedsReauth() *AccountUpsertOne

UpdateNeedsReauth sets the "needs_reauth" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateNewValues

func (u *AccountUpsertOne) UpdateNewValues() *AccountUpsertOne

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

func (*AccountUpsertOne) UpdateStatus

func (u *AccountUpsertOne) UpdateStatus() *AccountUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateSyncCursor

func (u *AccountUpsertOne) UpdateSyncCursor() *AccountUpsertOne

UpdateSyncCursor sets the "sync_cursor" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateSyncNotice

func (u *AccountUpsertOne) UpdateSyncNotice() *AccountUpsertOne

UpdateSyncNotice sets the "sync_notice" field to the value that was provided on create.

func (*AccountUpsertOne) UpdateType

func (u *AccountUpsertOne) UpdateType() *AccountUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

type Accounts

type Accounts []*Account

Accounts is a parsable slice of Account.

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
	// Account is the client for interacting with the Account builders.
	Account *AccountClient
	// Contact is the client for interacting with the Contact builders.
	Contact *ContactClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// NotifyRule is the client for interacting with the NotifyRule builders.
	NotifyRule *NotifyRuleClient
	// PendingOp is the client for interacting with the PendingOp builders.
	PendingOp *PendingOpClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// Thread is the client for interacting with the Thread builders.
	Thread *ThreadClient
	// 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().
	Account.
	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) 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 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 Contact

type Contact struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Source holds the value of the "source" field.
	Source contact.Source `json:"source,omitempty"`
	// Weight holds the value of the "weight" field.
	Weight int `json:"weight,omitempty"`
	// LastSeen holds the value of the "last_seen" field.
	LastSeen time.Time `json:"last_seen,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ContactQuery when eager-loading is set.
	Edges ContactEdges `json:"edges"`
	// contains filtered or unexported fields
}

Contact is the model entity for the Contact schema.

func (*Contact) ExecContext

func (c *Contact) 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 (*Contact) QueryAccount

func (_m *Contact) QueryAccount() *AccountQuery

QueryAccount queries the "account" edge of the Contact entity.

func (*Contact) QueryContext

func (c *Contact) 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 (*Contact) String

func (_m *Contact) String() string

String implements the fmt.Stringer.

func (*Contact) Unwrap

func (_m *Contact) Unwrap() *Contact

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

func (_m *Contact) Update() *ContactUpdateOne

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

func (*Contact) Value

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

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

type ContactClient

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

ContactClient is a client for the Contact schema.

func NewContactClient

func NewContactClient(c config) *ContactClient

NewContactClient returns a client for the Contact from the given config.

func (*ContactClient) Create

func (c *ContactClient) Create() *ContactCreate

Create returns a builder for creating a Contact entity.

func (*ContactClient) CreateBulk

func (c *ContactClient) CreateBulk(builders ...*ContactCreate) *ContactCreateBulk

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

func (*ContactClient) Delete

func (c *ContactClient) Delete() *ContactDelete

Delete returns a delete builder for Contact.

func (*ContactClient) DeleteOne

func (c *ContactClient) DeleteOne(_m *Contact) *ContactDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContactClient) DeleteOneID

func (c *ContactClient) DeleteOneID(id int) *ContactDeleteOne

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

func (*ContactClient) ExecContext

func (c *ContactClient) 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 (*ContactClient) Get

func (c *ContactClient) Get(ctx context.Context, id int) (*Contact, error)

Get returns a Contact entity by its id.

func (*ContactClient) GetX

func (c *ContactClient) GetX(ctx context.Context, id int) *Contact

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

func (*ContactClient) Hooks

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

Hooks returns the client hooks.

func (*ContactClient) Intercept

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

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

func (*ContactClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ContactClient) MapCreateBulk

func (c *ContactClient) MapCreateBulk(slice any, setFunc func(*ContactCreate, int)) *ContactCreateBulk

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

func (c *ContactClient) Query() *ContactQuery

Query returns a query builder for Contact.

func (*ContactClient) QueryAccount

func (c *ContactClient) QueryAccount(_m *Contact) *AccountQuery

QueryAccount queries the account edge of a Contact.

func (*ContactClient) QueryContext

func (c *ContactClient) 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 (*ContactClient) Update

func (c *ContactClient) Update() *ContactUpdate

Update returns an update builder for Contact.

func (*ContactClient) UpdateOne

func (c *ContactClient) UpdateOne(_m *Contact) *ContactUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContactClient) UpdateOneID

func (c *ContactClient) UpdateOneID(id int) *ContactUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ContactClient) Use

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

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

type ContactCreate

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

ContactCreate is the builder for creating a Contact entity.

func (*ContactCreate) Exec

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

Exec executes the query.

func (*ContactCreate) ExecContext

func (c *ContactCreate) 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 (*ContactCreate) ExecX

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

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

func (*ContactCreate) Mutation

func (_c *ContactCreate) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactCreate) OnConflict

func (_c *ContactCreate) OnConflict(opts ...sql.ConflictOption) *ContactUpsertOne

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

client.Contact.Create().
	SetEmail(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.ContactUpsert) {
		SetEmail(v+v).
	}).
	Exec(ctx)

func (*ContactCreate) OnConflictColumns

func (_c *ContactCreate) OnConflictColumns(columns ...string) *ContactUpsertOne

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

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

func (*ContactCreate) QueryContext

func (c *ContactCreate) 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 (*ContactCreate) Save

func (_c *ContactCreate) Save(ctx context.Context) (*Contact, error)

Save creates the Contact in the database.

func (*ContactCreate) SaveX

func (_c *ContactCreate) SaveX(ctx context.Context) *Contact

SaveX calls Save and panics if Save returns an error.

func (*ContactCreate) SetAccount

func (_c *ContactCreate) SetAccount(v *Account) *ContactCreate

SetAccount sets the "account" edge to the Account entity.

func (*ContactCreate) SetAccountID

func (_c *ContactCreate) SetAccountID(id uuid.UUID) *ContactCreate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*ContactCreate) SetEmail

func (_c *ContactCreate) SetEmail(v string) *ContactCreate

SetEmail sets the "email" field.

func (*ContactCreate) SetLastSeen

func (_c *ContactCreate) SetLastSeen(v time.Time) *ContactCreate

SetLastSeen sets the "last_seen" field.

func (*ContactCreate) SetName

func (_c *ContactCreate) SetName(v string) *ContactCreate

SetName sets the "name" field.

func (*ContactCreate) SetNillableLastSeen

func (_c *ContactCreate) SetNillableLastSeen(v *time.Time) *ContactCreate

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*ContactCreate) SetNillableName

func (_c *ContactCreate) SetNillableName(v *string) *ContactCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*ContactCreate) SetNillableWeight

func (_c *ContactCreate) SetNillableWeight(v *int) *ContactCreate

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

func (*ContactCreate) SetSource

func (_c *ContactCreate) SetSource(v contact.Source) *ContactCreate

SetSource sets the "source" field.

func (*ContactCreate) SetWeight

func (_c *ContactCreate) SetWeight(v int) *ContactCreate

SetWeight sets the "weight" field.

type ContactCreateBulk

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

ContactCreateBulk is the builder for creating many Contact entities in bulk.

func (*ContactCreateBulk) Exec

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

Exec executes the query.

func (*ContactCreateBulk) ExecContext

func (c *ContactCreateBulk) 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 (*ContactCreateBulk) ExecX

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

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

func (*ContactCreateBulk) OnConflict

func (_c *ContactCreateBulk) OnConflict(opts ...sql.ConflictOption) *ContactUpsertBulk

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

client.Contact.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.ContactUpsert) {
		SetEmail(v+v).
	}).
	Exec(ctx)

func (*ContactCreateBulk) OnConflictColumns

func (_c *ContactCreateBulk) OnConflictColumns(columns ...string) *ContactUpsertBulk

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

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

func (*ContactCreateBulk) QueryContext

func (c *ContactCreateBulk) 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 (*ContactCreateBulk) Save

func (_c *ContactCreateBulk) Save(ctx context.Context) ([]*Contact, error)

Save creates the Contact entities in the database.

func (*ContactCreateBulk) SaveX

func (_c *ContactCreateBulk) SaveX(ctx context.Context) []*Contact

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

type ContactDelete

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

ContactDelete is the builder for deleting a Contact entity.

func (*ContactDelete) Exec

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

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

func (*ContactDelete) ExecContext

func (c *ContactDelete) 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 (*ContactDelete) ExecX

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

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

func (*ContactDelete) QueryContext

func (c *ContactDelete) 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 (*ContactDelete) Where

func (_d *ContactDelete) Where(ps ...predicate.Contact) *ContactDelete

Where appends a list predicates to the ContactDelete builder.

type ContactDeleteOne

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

ContactDeleteOne is the builder for deleting a single Contact entity.

func (*ContactDeleteOne) Exec

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

Exec executes the deletion query.

func (*ContactDeleteOne) ExecX

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

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

func (*ContactDeleteOne) Where

Where appends a list predicates to the ContactDelete builder.

type ContactEdges

type ContactEdges struct {
	// Account holds the value of the account edge.
	Account *Account `json:"account,omitempty"`
	// contains filtered or unexported fields
}

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

func (ContactEdges) AccountOrErr

func (e ContactEdges) AccountOrErr() (*Account, error)

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

type ContactGroupBy

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

ContactGroupBy is the group-by builder for Contact entities.

func (*ContactGroupBy) Aggregate

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

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

func (*ContactGroupBy) Bool

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

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

func (*ContactGroupBy) BoolX

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

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

func (*ContactGroupBy) Bools

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

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

func (*ContactGroupBy) BoolsX

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

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

func (*ContactGroupBy) Float64

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

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

func (*ContactGroupBy) Float64X

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

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

func (*ContactGroupBy) Float64s

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

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

func (*ContactGroupBy) Float64sX

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

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

func (*ContactGroupBy) Int

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

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

func (*ContactGroupBy) IntX

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

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

func (*ContactGroupBy) Ints

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

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

func (*ContactGroupBy) IntsX

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

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

func (*ContactGroupBy) Scan

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

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

func (*ContactGroupBy) ScanX

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

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

func (*ContactGroupBy) String

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

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

func (*ContactGroupBy) StringX

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

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

func (*ContactGroupBy) Strings

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

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

func (*ContactGroupBy) StringsX

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

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

type ContactMutation

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

ContactMutation represents an operation that mutates the Contact nodes in the graph.

func (*ContactMutation) AccountCleared

func (m *ContactMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Account entity was cleared.

func (*ContactMutation) AccountID

func (m *ContactMutation) AccountID() (id uuid.UUID, exists bool)

AccountID returns the "account" edge ID in the mutation.

func (*ContactMutation) AccountIDs

func (m *ContactMutation) AccountIDs() (ids []uuid.UUID)

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

func (*ContactMutation) AddField

func (m *ContactMutation) 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 (*ContactMutation) AddWeight

func (m *ContactMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*ContactMutation) AddedEdges

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

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

func (*ContactMutation) AddedField

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

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

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

func (*ContactMutation) AddedIDs

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

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

func (*ContactMutation) AddedWeight

func (m *ContactMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*ContactMutation) ClearAccount

func (m *ContactMutation) ClearAccount()

ClearAccount clears the "account" edge to the Account entity.

func (*ContactMutation) ClearEdge

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

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

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

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

func (*ContactMutation) ClearedFields

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

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

func (ContactMutation) Client

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

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

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

func (*ContactMutation) Email

func (m *ContactMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*ContactMutation) ExecContext

func (c *ContactMutation) 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 (*ContactMutation) Field

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

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

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

func (*ContactMutation) Fields

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

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

func (m *ContactMutation) 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 (*ContactMutation) LastSeen

func (m *ContactMutation) LastSeen() (r time.Time, exists bool)

LastSeen returns the value of the "last_seen" field in the mutation.

func (*ContactMutation) Name

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

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

func (*ContactMutation) OldEmail

func (m *ContactMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldField

func (m *ContactMutation) 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 (*ContactMutation) OldLastSeen

func (m *ContactMutation) OldLastSeen(ctx context.Context) (v time.Time, err error)

OldLastSeen returns the old "last_seen" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldName

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

OldName returns the old "name" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldSource

func (m *ContactMutation) OldSource(ctx context.Context) (v contact.Source, err error)

OldSource returns the old "source" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldWeight

func (m *ContactMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the Contact entity. If the Contact 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 (*ContactMutation) Op

func (m *ContactMutation) Op() Op

Op returns the operation name.

func (*ContactMutation) QueryContext

func (c *ContactMutation) 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 (*ContactMutation) RemovedEdges

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

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

func (*ContactMutation) RemovedIDs

func (m *ContactMutation) 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 (*ContactMutation) ResetAccount

func (m *ContactMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*ContactMutation) ResetEdge

func (m *ContactMutation) 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 (*ContactMutation) ResetEmail

func (m *ContactMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*ContactMutation) ResetField

func (m *ContactMutation) 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 (*ContactMutation) ResetLastSeen

func (m *ContactMutation) ResetLastSeen()

ResetLastSeen resets all changes to the "last_seen" field.

func (*ContactMutation) ResetName

func (m *ContactMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ContactMutation) ResetSource

func (m *ContactMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*ContactMutation) ResetWeight

func (m *ContactMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*ContactMutation) SetAccountID

func (m *ContactMutation) SetAccountID(id uuid.UUID)

SetAccountID sets the "account" edge to the Account entity by id.

func (*ContactMutation) SetEmail

func (m *ContactMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*ContactMutation) SetField

func (m *ContactMutation) 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 (*ContactMutation) SetLastSeen

func (m *ContactMutation) SetLastSeen(t time.Time)

SetLastSeen sets the "last_seen" field.

func (*ContactMutation) SetName

func (m *ContactMutation) SetName(s string)

SetName sets the "name" field.

func (*ContactMutation) SetOp

func (m *ContactMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ContactMutation) SetSource

func (m *ContactMutation) SetSource(c contact.Source)

SetSource sets the "source" field.

func (*ContactMutation) SetWeight

func (m *ContactMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (*ContactMutation) Source

func (m *ContactMutation) Source() (r contact.Source, exists bool)

Source returns the value of the "source" field in the mutation.

func (ContactMutation) Tx

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

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

func (*ContactMutation) Type

func (m *ContactMutation) Type() string

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

func (*ContactMutation) Weight

func (m *ContactMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*ContactMutation) Where

func (m *ContactMutation) Where(ps ...predicate.Contact)

Where appends a list predicates to the ContactMutation builder.

func (*ContactMutation) WhereP

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

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

type ContactQuery

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

ContactQuery is the builder for querying Contact entities.

func (*ContactQuery) Aggregate

func (_q *ContactQuery) Aggregate(fns ...AggregateFunc) *ContactSelect

Aggregate returns a ContactSelect configured with the given aggregations.

func (*ContactQuery) All

func (_q *ContactQuery) All(ctx context.Context) ([]*Contact, error)

All executes the query and returns a list of Contacts.

func (*ContactQuery) AllX

func (_q *ContactQuery) AllX(ctx context.Context) []*Contact

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

func (*ContactQuery) Clone

func (_q *ContactQuery) Clone() *ContactQuery

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

func (*ContactQuery) Count

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

Count returns the count of the given query.

func (*ContactQuery) CountX

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

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

func (*ContactQuery) ExecContext

func (c *ContactQuery) 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 (*ContactQuery) Exist

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

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

func (*ContactQuery) ExistX

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

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

func (*ContactQuery) First

func (_q *ContactQuery) First(ctx context.Context) (*Contact, error)

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

func (*ContactQuery) FirstID

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

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

func (*ContactQuery) FirstIDX

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

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

func (*ContactQuery) FirstX

func (_q *ContactQuery) FirstX(ctx context.Context) *Contact

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

func (*ContactQuery) GroupBy

func (_q *ContactQuery) GroupBy(field string, fields ...string) *ContactGroupBy

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

client.Contact.Query().
	GroupBy(contact.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ContactQuery) IDs

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

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

func (*ContactQuery) IDsX

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

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

func (*ContactQuery) Limit

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

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

func (*ContactQuery) Modify

func (_q *ContactQuery) Modify(modifiers ...func(s *sql.Selector)) *ContactSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ContactQuery) Offset

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

Offset to start from.

func (*ContactQuery) Only

func (_q *ContactQuery) Only(ctx context.Context) (*Contact, error)

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

func (*ContactQuery) OnlyID

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

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

func (*ContactQuery) OnlyIDX

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

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

func (*ContactQuery) OnlyX

func (_q *ContactQuery) OnlyX(ctx context.Context) *Contact

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

func (*ContactQuery) Order

func (_q *ContactQuery) Order(o ...contact.OrderOption) *ContactQuery

Order specifies how the records should be ordered.

func (*ContactQuery) QueryAccount

func (_q *ContactQuery) QueryAccount() *AccountQuery

QueryAccount chains the current query on the "account" edge.

func (*ContactQuery) QueryContext

func (c *ContactQuery) 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 (*ContactQuery) Select

func (_q *ContactQuery) Select(fields ...string) *ContactSelect

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

client.Contact.Query().
	Select(contact.FieldEmail).
	Scan(ctx, &v)

func (*ContactQuery) Unique

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

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

func (_q *ContactQuery) Where(ps ...predicate.Contact) *ContactQuery

Where adds a new predicate for the ContactQuery builder.

func (*ContactQuery) WithAccount

func (_q *ContactQuery) WithAccount(opts ...func(*AccountQuery)) *ContactQuery

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

type ContactSelect

type ContactSelect struct {
	*ContactQuery
	// contains filtered or unexported fields
}

ContactSelect is the builder for selecting fields of Contact entities.

func (*ContactSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ContactSelect) Bool

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

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

func (*ContactSelect) BoolX

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

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

func (*ContactSelect) Bools

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

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

func (*ContactSelect) BoolsX

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

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

func (ContactSelect) ExecContext

func (c ContactSelect) 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 (*ContactSelect) Float64

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

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

func (*ContactSelect) Float64X

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

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

func (*ContactSelect) Float64s

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

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

func (*ContactSelect) Float64sX

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

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

func (*ContactSelect) Int

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

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

func (*ContactSelect) IntX

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

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

func (*ContactSelect) Ints

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

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

func (*ContactSelect) IntsX

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

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

func (*ContactSelect) Modify

func (_s *ContactSelect) Modify(modifiers ...func(s *sql.Selector)) *ContactSelect

Modify adds a query modifier for attaching custom logic to queries.

func (ContactSelect) QueryContext

func (c ContactSelect) 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 (*ContactSelect) Scan

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

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

func (*ContactSelect) ScanX

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

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

func (*ContactSelect) String

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

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

func (*ContactSelect) StringX

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

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

func (*ContactSelect) Strings

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

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

func (*ContactSelect) StringsX

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

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

type ContactUpdate

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

ContactUpdate is the builder for updating Contact entities.

func (*ContactUpdate) AddWeight

func (_u *ContactUpdate) AddWeight(v int) *ContactUpdate

AddWeight adds value to the "weight" field.

func (*ContactUpdate) ClearAccount

func (_u *ContactUpdate) ClearAccount() *ContactUpdate

ClearAccount clears the "account" edge to the Account entity.

func (*ContactUpdate) Exec

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

Exec executes the query.

func (*ContactUpdate) ExecContext

func (c *ContactUpdate) 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 (*ContactUpdate) ExecX

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

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

func (*ContactUpdate) Modify

func (_u *ContactUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ContactUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ContactUpdate) Mutation

func (_u *ContactUpdate) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactUpdate) QueryContext

func (c *ContactUpdate) 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 (*ContactUpdate) Save

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

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

func (*ContactUpdate) SaveX

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

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

func (*ContactUpdate) SetAccount

func (_u *ContactUpdate) SetAccount(v *Account) *ContactUpdate

SetAccount sets the "account" edge to the Account entity.

func (*ContactUpdate) SetAccountID

func (_u *ContactUpdate) SetAccountID(id uuid.UUID) *ContactUpdate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*ContactUpdate) SetEmail

func (_u *ContactUpdate) SetEmail(v string) *ContactUpdate

SetEmail sets the "email" field.

func (*ContactUpdate) SetLastSeen

func (_u *ContactUpdate) SetLastSeen(v time.Time) *ContactUpdate

SetLastSeen sets the "last_seen" field.

func (*ContactUpdate) SetName

func (_u *ContactUpdate) SetName(v string) *ContactUpdate

SetName sets the "name" field.

func (*ContactUpdate) SetNillableEmail

func (_u *ContactUpdate) SetNillableEmail(v *string) *ContactUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ContactUpdate) SetNillableLastSeen

func (_u *ContactUpdate) SetNillableLastSeen(v *time.Time) *ContactUpdate

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*ContactUpdate) SetNillableName

func (_u *ContactUpdate) SetNillableName(v *string) *ContactUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ContactUpdate) SetNillableSource

func (_u *ContactUpdate) SetNillableSource(v *contact.Source) *ContactUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*ContactUpdate) SetNillableWeight

func (_u *ContactUpdate) SetNillableWeight(v *int) *ContactUpdate

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

func (*ContactUpdate) SetSource

func (_u *ContactUpdate) SetSource(v contact.Source) *ContactUpdate

SetSource sets the "source" field.

func (*ContactUpdate) SetWeight

func (_u *ContactUpdate) SetWeight(v int) *ContactUpdate

SetWeight sets the "weight" field.

func (*ContactUpdate) Where

func (_u *ContactUpdate) Where(ps ...predicate.Contact) *ContactUpdate

Where appends a list predicates to the ContactUpdate builder.

type ContactUpdateOne

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

ContactUpdateOne is the builder for updating a single Contact entity.

func (*ContactUpdateOne) AddWeight

func (_u *ContactUpdateOne) AddWeight(v int) *ContactUpdateOne

AddWeight adds value to the "weight" field.

func (*ContactUpdateOne) ClearAccount

func (_u *ContactUpdateOne) ClearAccount() *ContactUpdateOne

ClearAccount clears the "account" edge to the Account entity.

func (*ContactUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ContactUpdateOne) ExecContext

func (c *ContactUpdateOne) 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 (*ContactUpdateOne) ExecX

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

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

func (*ContactUpdateOne) Modify

func (_u *ContactUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ContactUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ContactUpdateOne) Mutation

func (_u *ContactUpdateOne) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactUpdateOne) QueryContext

func (c *ContactUpdateOne) 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 (*ContactUpdateOne) Save

func (_u *ContactUpdateOne) Save(ctx context.Context) (*Contact, error)

Save executes the query and returns the updated Contact entity.

func (*ContactUpdateOne) SaveX

func (_u *ContactUpdateOne) SaveX(ctx context.Context) *Contact

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

func (*ContactUpdateOne) Select

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

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

func (*ContactUpdateOne) SetAccount

func (_u *ContactUpdateOne) SetAccount(v *Account) *ContactUpdateOne

SetAccount sets the "account" edge to the Account entity.

func (*ContactUpdateOne) SetAccountID

func (_u *ContactUpdateOne) SetAccountID(id uuid.UUID) *ContactUpdateOne

SetAccountID sets the "account" edge to the Account entity by ID.

func (*ContactUpdateOne) SetEmail

func (_u *ContactUpdateOne) SetEmail(v string) *ContactUpdateOne

SetEmail sets the "email" field.

func (*ContactUpdateOne) SetLastSeen

func (_u *ContactUpdateOne) SetLastSeen(v time.Time) *ContactUpdateOne

SetLastSeen sets the "last_seen" field.

func (*ContactUpdateOne) SetName

func (_u *ContactUpdateOne) SetName(v string) *ContactUpdateOne

SetName sets the "name" field.

func (*ContactUpdateOne) SetNillableEmail

func (_u *ContactUpdateOne) SetNillableEmail(v *string) *ContactUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableLastSeen

func (_u *ContactUpdateOne) SetNillableLastSeen(v *time.Time) *ContactUpdateOne

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableName

func (_u *ContactUpdateOne) SetNillableName(v *string) *ContactUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableSource

func (_u *ContactUpdateOne) SetNillableSource(v *contact.Source) *ContactUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableWeight

func (_u *ContactUpdateOne) SetNillableWeight(v *int) *ContactUpdateOne

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

func (*ContactUpdateOne) SetSource

func (_u *ContactUpdateOne) SetSource(v contact.Source) *ContactUpdateOne

SetSource sets the "source" field.

func (*ContactUpdateOne) SetWeight

func (_u *ContactUpdateOne) SetWeight(v int) *ContactUpdateOne

SetWeight sets the "weight" field.

func (*ContactUpdateOne) Where

Where appends a list predicates to the ContactUpdate builder.

type ContactUpsert

type ContactUpsert struct {
	*sql.UpdateSet
}

ContactUpsert is the "OnConflict" setter.

func (*ContactUpsert) AddWeight

func (u *ContactUpsert) AddWeight(v int) *ContactUpsert

AddWeight adds v to the "weight" field.

func (*ContactUpsert) SetEmail

func (u *ContactUpsert) SetEmail(v string) *ContactUpsert

SetEmail sets the "email" field.

func (*ContactUpsert) SetLastSeen

func (u *ContactUpsert) SetLastSeen(v time.Time) *ContactUpsert

SetLastSeen sets the "last_seen" field.

func (*ContactUpsert) SetName

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

SetName sets the "name" field.

func (*ContactUpsert) SetSource

func (u *ContactUpsert) SetSource(v contact.Source) *ContactUpsert

SetSource sets the "source" field.

func (*ContactUpsert) SetWeight

func (u *ContactUpsert) SetWeight(v int) *ContactUpsert

SetWeight sets the "weight" field.

func (*ContactUpsert) UpdateEmail

func (u *ContactUpsert) UpdateEmail() *ContactUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*ContactUpsert) UpdateLastSeen

func (u *ContactUpsert) UpdateLastSeen() *ContactUpsert

UpdateLastSeen sets the "last_seen" field to the value that was provided on create.

func (*ContactUpsert) UpdateName

func (u *ContactUpsert) UpdateName() *ContactUpsert

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

func (*ContactUpsert) UpdateSource

func (u *ContactUpsert) UpdateSource() *ContactUpsert

UpdateSource sets the "source" field to the value that was provided on create.

func (*ContactUpsert) UpdateWeight

func (u *ContactUpsert) UpdateWeight() *ContactUpsert

UpdateWeight sets the "weight" field to the value that was provided on create.

type ContactUpsertBulk

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

ContactUpsertBulk is the builder for "upsert"-ing a bulk of Contact nodes.

func (*ContactUpsertBulk) AddWeight

func (u *ContactUpsertBulk) AddWeight(v int) *ContactUpsertBulk

AddWeight adds v to the "weight" field.

func (*ContactUpsertBulk) DoNothing

func (u *ContactUpsertBulk) DoNothing() *ContactUpsertBulk

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

func (*ContactUpsertBulk) Exec

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

Exec executes the query.

func (*ContactUpsertBulk) ExecX

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

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

func (*ContactUpsertBulk) Ignore

func (u *ContactUpsertBulk) Ignore() *ContactUpsertBulk

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

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

func (*ContactUpsertBulk) SetEmail

func (u *ContactUpsertBulk) SetEmail(v string) *ContactUpsertBulk

SetEmail sets the "email" field.

func (*ContactUpsertBulk) SetLastSeen

func (u *ContactUpsertBulk) SetLastSeen(v time.Time) *ContactUpsertBulk

SetLastSeen sets the "last_seen" field.

func (*ContactUpsertBulk) SetName

SetName sets the "name" field.

func (*ContactUpsertBulk) SetSource

SetSource sets the "source" field.

func (*ContactUpsertBulk) SetWeight

func (u *ContactUpsertBulk) SetWeight(v int) *ContactUpsertBulk

SetWeight sets the "weight" field.

func (*ContactUpsertBulk) Update

func (u *ContactUpsertBulk) Update(set func(*ContactUpsert)) *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateEmail

func (u *ContactUpsertBulk) UpdateEmail() *ContactUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*ContactUpsertBulk) UpdateLastSeen

func (u *ContactUpsertBulk) UpdateLastSeen() *ContactUpsertBulk

UpdateLastSeen sets the "last_seen" field to the value that was provided on create.

func (*ContactUpsertBulk) UpdateName

func (u *ContactUpsertBulk) UpdateName() *ContactUpsertBulk

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

func (*ContactUpsertBulk) UpdateNewValues

func (u *ContactUpsertBulk) UpdateNewValues() *ContactUpsertBulk

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

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

func (*ContactUpsertBulk) UpdateSource

func (u *ContactUpsertBulk) UpdateSource() *ContactUpsertBulk

UpdateSource sets the "source" field to the value that was provided on create.

func (*ContactUpsertBulk) UpdateWeight

func (u *ContactUpsertBulk) UpdateWeight() *ContactUpsertBulk

UpdateWeight sets the "weight" field to the value that was provided on create.

type ContactUpsertOne

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

ContactUpsertOne is the builder for "upsert"-ing

one Contact node.

func (*ContactUpsertOne) AddWeight

func (u *ContactUpsertOne) AddWeight(v int) *ContactUpsertOne

AddWeight adds v to the "weight" field.

func (*ContactUpsertOne) DoNothing

func (u *ContactUpsertOne) DoNothing() *ContactUpsertOne

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

func (*ContactUpsertOne) Exec

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

Exec executes the query.

func (*ContactUpsertOne) ExecX

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

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

func (*ContactUpsertOne) ID

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

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

func (*ContactUpsertOne) IDX

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

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

func (*ContactUpsertOne) Ignore

func (u *ContactUpsertOne) Ignore() *ContactUpsertOne

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

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

func (*ContactUpsertOne) SetEmail

func (u *ContactUpsertOne) SetEmail(v string) *ContactUpsertOne

SetEmail sets the "email" field.

func (*ContactUpsertOne) SetLastSeen

func (u *ContactUpsertOne) SetLastSeen(v time.Time) *ContactUpsertOne

SetLastSeen sets the "last_seen" field.

func (*ContactUpsertOne) SetName

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

SetName sets the "name" field.

func (*ContactUpsertOne) SetSource

SetSource sets the "source" field.

func (*ContactUpsertOne) SetWeight

func (u *ContactUpsertOne) SetWeight(v int) *ContactUpsertOne

SetWeight sets the "weight" field.

func (*ContactUpsertOne) Update

func (u *ContactUpsertOne) Update(set func(*ContactUpsert)) *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateEmail

func (u *ContactUpsertOne) UpdateEmail() *ContactUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*ContactUpsertOne) UpdateLastSeen

func (u *ContactUpsertOne) UpdateLastSeen() *ContactUpsertOne

UpdateLastSeen sets the "last_seen" field to the value that was provided on create.

func (*ContactUpsertOne) UpdateName

func (u *ContactUpsertOne) UpdateName() *ContactUpsertOne

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

func (*ContactUpsertOne) UpdateNewValues

func (u *ContactUpsertOne) UpdateNewValues() *ContactUpsertOne

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

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

func (*ContactUpsertOne) UpdateSource

func (u *ContactUpsertOne) UpdateSource() *ContactUpsertOne

UpdateSource sets the "source" field to the value that was provided on create.

func (*ContactUpsertOne) UpdateWeight

func (u *ContactUpsertOne) UpdateWeight() *ContactUpsertOne

UpdateWeight sets the "weight" field to the value that was provided on create.

type Contacts

type Contacts []*Contact

Contacts is a parsable slice of Contact.

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 Message

type Message struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ProviderMessageID holds the value of the "provider_message_id" field.
	ProviderMessageID string `json:"provider_message_id,omitempty"`
	// Rfc822MessageID holds the value of the "rfc822_message_id" field.
	Rfc822MessageID string `json:"rfc822_message_id,omitempty"`
	// From holds the value of the "from" field.
	From string `json:"from,omitempty"`
	// To holds the value of the "to" field.
	To []string `json:"to,omitempty"`
	// Cc holds the value of the "cc" field.
	Cc []string `json:"cc,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// IsSent holds the value of the "is_sent" field.
	IsSent bool `json:"is_sent,omitempty"`
	// Snippet holds the value of the "snippet" field.
	Snippet string `json:"snippet,omitempty"`
	// BodyText holds the value of the "body_text" field.
	BodyText string `json:"body_text,omitempty"`
	// ReplyHeaders holds the value of the "reply_headers" field.
	ReplyHeaders map[string]string `json:"reply_headers,omitempty"`
	// Attachments holds the value of the "attachments" field.
	Attachments []provider.AttachmentMeta `json:"attachments,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) ExecContext

func (c *Message) 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 (*Message) QueryContext

func (c *Message) 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 (*Message) QueryThread

func (_m *Message) QueryThread() *ThreadQuery

QueryThread queries the "thread" edge of the Message entity.

func (*Message) String

func (_m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (_m *Message) Unwrap() *Message

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

func (_m *Message) Update() *MessageUpdateOne

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

func (*Message) Value

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

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

type MessageClient

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

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

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

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(_m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id int) *MessageDeleteOne

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

func (*MessageClient) ExecContext

func (c *MessageClient) 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 (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id int) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id int) *Message

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

func (*MessageClient) Hooks

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

Hooks returns the client hooks.

func (*MessageClient) Intercept

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

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

func (*MessageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

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

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryContext

func (c *MessageClient) 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 (*MessageClient) QueryThread

func (c *MessageClient) QueryThread(_m *Message) *ThreadQuery

QueryThread queries the thread edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(_m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id int) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

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

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

type MessageCreate

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

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

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

Exec executes the query.

func (*MessageCreate) ExecContext

func (c *MessageCreate) 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 (*MessageCreate) ExecX

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

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

func (*MessageCreate) Mutation

func (_c *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) OnConflict

func (_c *MessageCreate) OnConflict(opts ...sql.ConflictOption) *MessageUpsertOne

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

client.Message.Create().
	SetProviderMessageID(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.MessageUpsert) {
		SetProviderMessageID(v+v).
	}).
	Exec(ctx)

func (*MessageCreate) OnConflictColumns

func (_c *MessageCreate) OnConflictColumns(columns ...string) *MessageUpsertOne

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

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

func (*MessageCreate) QueryContext

func (c *MessageCreate) 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 (*MessageCreate) Save

func (_c *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (_c *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetAttachments

func (_c *MessageCreate) SetAttachments(v []provider.AttachmentMeta) *MessageCreate

SetAttachments sets the "attachments" field.

func (*MessageCreate) SetBodyText

func (_c *MessageCreate) SetBodyText(v string) *MessageCreate

SetBodyText sets the "body_text" field.

func (*MessageCreate) SetCc

func (_c *MessageCreate) SetCc(v []string) *MessageCreate

SetCc sets the "cc" field.

func (*MessageCreate) SetDate

func (_c *MessageCreate) SetDate(v time.Time) *MessageCreate

SetDate sets the "date" field.

func (*MessageCreate) SetFrom

func (_c *MessageCreate) SetFrom(v string) *MessageCreate

SetFrom sets the "from" field.

func (*MessageCreate) SetIsSent

func (_c *MessageCreate) SetIsSent(v bool) *MessageCreate

SetIsSent sets the "is_sent" field.

func (*MessageCreate) SetNillableBodyText

func (_c *MessageCreate) SetNillableBodyText(v *string) *MessageCreate

SetNillableBodyText sets the "body_text" field if the given value is not nil.

func (*MessageCreate) SetNillableFrom

func (_c *MessageCreate) SetNillableFrom(v *string) *MessageCreate

SetNillableFrom sets the "from" field if the given value is not nil.

func (*MessageCreate) SetNillableIsSent

func (_c *MessageCreate) SetNillableIsSent(v *bool) *MessageCreate

SetNillableIsSent sets the "is_sent" field if the given value is not nil.

func (*MessageCreate) SetNillableRfc822MessageID

func (_c *MessageCreate) SetNillableRfc822MessageID(v *string) *MessageCreate

SetNillableRfc822MessageID sets the "rfc822_message_id" field if the given value is not nil.

func (*MessageCreate) SetNillableSnippet

func (_c *MessageCreate) SetNillableSnippet(v *string) *MessageCreate

SetNillableSnippet sets the "snippet" field if the given value is not nil.

func (*MessageCreate) SetProviderMessageID

func (_c *MessageCreate) SetProviderMessageID(v string) *MessageCreate

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageCreate) SetReplyHeaders

func (_c *MessageCreate) SetReplyHeaders(v map[string]string) *MessageCreate

SetReplyHeaders sets the "reply_headers" field.

func (*MessageCreate) SetRfc822MessageID

func (_c *MessageCreate) SetRfc822MessageID(v string) *MessageCreate

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageCreate) SetSnippet

func (_c *MessageCreate) SetSnippet(v string) *MessageCreate

SetSnippet sets the "snippet" field.

func (*MessageCreate) SetThread

func (_c *MessageCreate) SetThread(v *Thread) *MessageCreate

SetThread sets the "thread" edge to the Thread entity.

func (*MessageCreate) SetThreadID

func (_c *MessageCreate) SetThreadID(id int) *MessageCreate

SetThreadID sets the "thread" edge to the Thread entity by ID.

func (*MessageCreate) SetTo

func (_c *MessageCreate) SetTo(v []string) *MessageCreate

SetTo sets the "to" field.

type MessageCreateBulk

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

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

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

Exec executes the query.

func (*MessageCreateBulk) ExecContext

func (c *MessageCreateBulk) 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 (*MessageCreateBulk) ExecX

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

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

func (*MessageCreateBulk) OnConflict

func (_c *MessageCreateBulk) OnConflict(opts ...sql.ConflictOption) *MessageUpsertBulk

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

client.Message.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.MessageUpsert) {
		SetProviderMessageID(v+v).
	}).
	Exec(ctx)

func (*MessageCreateBulk) OnConflictColumns

func (_c *MessageCreateBulk) OnConflictColumns(columns ...string) *MessageUpsertBulk

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

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

func (*MessageCreateBulk) QueryContext

func (c *MessageCreateBulk) 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 (*MessageCreateBulk) Save

func (_c *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (_c *MessageCreateBulk) SaveX(ctx context.Context) []*Message

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

type MessageDelete

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

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

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

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

func (*MessageDelete) ExecContext

func (c *MessageDelete) 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 (*MessageDelete) ExecX

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

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

func (*MessageDelete) QueryContext

func (c *MessageDelete) 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 (*MessageDelete) Where

func (_d *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

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

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

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

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

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

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

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Thread holds the value of the thread edge.
	Thread *Thread `json:"thread,omitempty"`
	// contains filtered or unexported fields
}

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

func (MessageEdges) ThreadOrErr

func (e MessageEdges) ThreadOrErr() (*Thread, error)

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

type MessageGroupBy

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

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

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

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

func (*MessageGroupBy) Bool

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

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

func (*MessageGroupBy) BoolX

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

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

func (*MessageGroupBy) Bools

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

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

func (*MessageGroupBy) BoolsX

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

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

func (*MessageGroupBy) Float64

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

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

func (*MessageGroupBy) Float64X

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

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

func (*MessageGroupBy) Float64s

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

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

func (*MessageGroupBy) Float64sX

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

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

func (*MessageGroupBy) Int

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

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

func (*MessageGroupBy) IntX

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

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

func (*MessageGroupBy) Ints

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

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

func (*MessageGroupBy) IntsX

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

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

func (*MessageGroupBy) Scan

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

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

func (*MessageGroupBy) ScanX

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

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

func (*MessageGroupBy) String

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

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

func (*MessageGroupBy) StringX

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

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

func (*MessageGroupBy) Strings

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

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

func (*MessageGroupBy) StringsX

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

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

type MessageMutation

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

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

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

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

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

func (*MessageMutation) AddedField

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

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

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

func (*MessageMutation) AddedIDs

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

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

func (*MessageMutation) AppendAttachments

func (m *MessageMutation) AppendAttachments(pm []provider.AttachmentMeta)

AppendAttachments adds pm to the "attachments" field.

func (*MessageMutation) AppendCc

func (m *MessageMutation) AppendCc(s []string)

AppendCc adds s to the "cc" field.

func (*MessageMutation) AppendTo

func (m *MessageMutation) AppendTo(s []string)

AppendTo adds s to the "to" field.

func (*MessageMutation) AppendedAttachments

func (m *MessageMutation) AppendedAttachments() ([]provider.AttachmentMeta, bool)

AppendedAttachments returns the list of values that were appended to the "attachments" field in this mutation.

func (*MessageMutation) AppendedCc

func (m *MessageMutation) AppendedCc() ([]string, bool)

AppendedCc returns the list of values that were appended to the "cc" field in this mutation.

func (*MessageMutation) AppendedTo

func (m *MessageMutation) AppendedTo() ([]string, bool)

AppendedTo returns the list of values that were appended to the "to" field in this mutation.

func (*MessageMutation) Attachments

func (m *MessageMutation) Attachments() (r []provider.AttachmentMeta, exists bool)

Attachments returns the value of the "attachments" field in the mutation.

func (*MessageMutation) AttachmentsCleared

func (m *MessageMutation) AttachmentsCleared() bool

AttachmentsCleared returns if the "attachments" field was cleared in this mutation.

func (*MessageMutation) BodyText

func (m *MessageMutation) BodyText() (r string, exists bool)

BodyText returns the value of the "body_text" field in the mutation.

func (*MessageMutation) Cc

func (m *MessageMutation) Cc() (r []string, exists bool)

Cc returns the value of the "cc" field in the mutation.

func (*MessageMutation) ClearAttachments

func (m *MessageMutation) ClearAttachments()

ClearAttachments clears the value of the "attachments" field.

func (*MessageMutation) ClearEdge

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

func (m *MessageMutation) 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 (*MessageMutation) ClearThread

func (m *MessageMutation) ClearThread()

ClearThread clears the "thread" edge to the Thread entity.

func (*MessageMutation) ClearedEdges

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

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

func (*MessageMutation) ClearedFields

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

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

func (MessageMutation) Client

func (m MessageMutation) 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 (*MessageMutation) Date

func (m *MessageMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*MessageMutation) EdgeCleared

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

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

func (*MessageMutation) ExecContext

func (c *MessageMutation) 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 (*MessageMutation) Field

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

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

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

func (*MessageMutation) Fields

func (m *MessageMutation) 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 (*MessageMutation) From

func (m *MessageMutation) From() (r string, exists bool)

From returns the value of the "from" field in the mutation.

func (*MessageMutation) ID

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

func (m *MessageMutation) 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 (*MessageMutation) IsSent

func (m *MessageMutation) IsSent() (r bool, exists bool)

IsSent returns the value of the "is_sent" field in the mutation.

func (*MessageMutation) OldAttachments

func (m *MessageMutation) OldAttachments(ctx context.Context) (v []provider.AttachmentMeta, err error)

OldAttachments returns the old "attachments" field's value of the Message entity. If the Message 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 (*MessageMutation) OldBodyText

func (m *MessageMutation) OldBodyText(ctx context.Context) (v string, err error)

OldBodyText returns the old "body_text" field's value of the Message entity. If the Message 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 (*MessageMutation) OldCc

func (m *MessageMutation) OldCc(ctx context.Context) (v []string, err error)

OldCc returns the old "cc" field's value of the Message entity. If the Message 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 (*MessageMutation) OldDate

func (m *MessageMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the Message entity. If the Message 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 (*MessageMutation) OldField

func (m *MessageMutation) 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 (*MessageMutation) OldFrom

func (m *MessageMutation) OldFrom(ctx context.Context) (v string, err error)

OldFrom returns the old "from" field's value of the Message entity. If the Message 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 (*MessageMutation) OldIsSent

func (m *MessageMutation) OldIsSent(ctx context.Context) (v bool, err error)

OldIsSent returns the old "is_sent" field's value of the Message entity. If the Message 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 (*MessageMutation) OldProviderMessageID

func (m *MessageMutation) OldProviderMessageID(ctx context.Context) (v string, err error)

OldProviderMessageID returns the old "provider_message_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldReplyHeaders

func (m *MessageMutation) OldReplyHeaders(ctx context.Context) (v map[string]string, err error)

OldReplyHeaders returns the old "reply_headers" field's value of the Message entity. If the Message 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 (*MessageMutation) OldRfc822MessageID

func (m *MessageMutation) OldRfc822MessageID(ctx context.Context) (v string, err error)

OldRfc822MessageID returns the old "rfc822_message_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldSnippet

func (m *MessageMutation) OldSnippet(ctx context.Context) (v string, err error)

OldSnippet returns the old "snippet" field's value of the Message entity. If the Message 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 (*MessageMutation) OldTo

func (m *MessageMutation) OldTo(ctx context.Context) (v []string, err error)

OldTo returns the old "to" field's value of the Message entity. If the Message 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 (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) ProviderMessageID

func (m *MessageMutation) ProviderMessageID() (r string, exists bool)

ProviderMessageID returns the value of the "provider_message_id" field in the mutation.

func (*MessageMutation) QueryContext

func (c *MessageMutation) 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 (*MessageMutation) RemovedEdges

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

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

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) 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 (*MessageMutation) ReplyHeaders

func (m *MessageMutation) ReplyHeaders() (r map[string]string, exists bool)

ReplyHeaders returns the value of the "reply_headers" field in the mutation.

func (*MessageMutation) ResetAttachments

func (m *MessageMutation) ResetAttachments()

ResetAttachments resets all changes to the "attachments" field.

func (*MessageMutation) ResetBodyText

func (m *MessageMutation) ResetBodyText()

ResetBodyText resets all changes to the "body_text" field.

func (*MessageMutation) ResetCc

func (m *MessageMutation) ResetCc()

ResetCc resets all changes to the "cc" field.

func (*MessageMutation) ResetDate

func (m *MessageMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*MessageMutation) ResetEdge

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

func (m *MessageMutation) 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 (*MessageMutation) ResetFrom

func (m *MessageMutation) ResetFrom()

ResetFrom resets all changes to the "from" field.

func (*MessageMutation) ResetIsSent

func (m *MessageMutation) ResetIsSent()

ResetIsSent resets all changes to the "is_sent" field.

func (*MessageMutation) ResetProviderMessageID

func (m *MessageMutation) ResetProviderMessageID()

ResetProviderMessageID resets all changes to the "provider_message_id" field.

func (*MessageMutation) ResetReplyHeaders

func (m *MessageMutation) ResetReplyHeaders()

ResetReplyHeaders resets all changes to the "reply_headers" field.

func (*MessageMutation) ResetRfc822MessageID

func (m *MessageMutation) ResetRfc822MessageID()

ResetRfc822MessageID resets all changes to the "rfc822_message_id" field.

func (*MessageMutation) ResetSnippet

func (m *MessageMutation) ResetSnippet()

ResetSnippet resets all changes to the "snippet" field.

func (*MessageMutation) ResetThread

func (m *MessageMutation) ResetThread()

ResetThread resets all changes to the "thread" edge.

func (*MessageMutation) ResetTo

func (m *MessageMutation) ResetTo()

ResetTo resets all changes to the "to" field.

func (*MessageMutation) Rfc822MessageID

func (m *MessageMutation) Rfc822MessageID() (r string, exists bool)

Rfc822MessageID returns the value of the "rfc822_message_id" field in the mutation.

func (*MessageMutation) SetAttachments

func (m *MessageMutation) SetAttachments(pm []provider.AttachmentMeta)

SetAttachments sets the "attachments" field.

func (*MessageMutation) SetBodyText

func (m *MessageMutation) SetBodyText(s string)

SetBodyText sets the "body_text" field.

func (*MessageMutation) SetCc

func (m *MessageMutation) SetCc(s []string)

SetCc sets the "cc" field.

func (*MessageMutation) SetDate

func (m *MessageMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*MessageMutation) SetField

func (m *MessageMutation) 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 (*MessageMutation) SetFrom

func (m *MessageMutation) SetFrom(s string)

SetFrom sets the "from" field.

func (*MessageMutation) SetIsSent

func (m *MessageMutation) SetIsSent(b bool)

SetIsSent sets the "is_sent" field.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetProviderMessageID

func (m *MessageMutation) SetProviderMessageID(s string)

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageMutation) SetReplyHeaders

func (m *MessageMutation) SetReplyHeaders(value map[string]string)

SetReplyHeaders sets the "reply_headers" field.

func (*MessageMutation) SetRfc822MessageID

func (m *MessageMutation) SetRfc822MessageID(s string)

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageMutation) SetSnippet

func (m *MessageMutation) SetSnippet(s string)

SetSnippet sets the "snippet" field.

func (*MessageMutation) SetThreadID

func (m *MessageMutation) SetThreadID(id int)

SetThreadID sets the "thread" edge to the Thread entity by id.

func (*MessageMutation) SetTo

func (m *MessageMutation) SetTo(s []string)

SetTo sets the "to" field.

func (*MessageMutation) Snippet

func (m *MessageMutation) Snippet() (r string, exists bool)

Snippet returns the value of the "snippet" field in the mutation.

func (*MessageMutation) ThreadCleared

func (m *MessageMutation) ThreadCleared() bool

ThreadCleared reports if the "thread" edge to the Thread entity was cleared.

func (*MessageMutation) ThreadID

func (m *MessageMutation) ThreadID() (id int, exists bool)

ThreadID returns the "thread" edge ID in the mutation.

func (*MessageMutation) ThreadIDs

func (m *MessageMutation) ThreadIDs() (ids []int)

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

func (*MessageMutation) To

func (m *MessageMutation) To() (r []string, exists bool)

To returns the value of the "to" field in the mutation.

func (MessageMutation) Tx

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

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

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

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

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

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

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

type MessageQuery

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

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (_q *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (_q *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (_q *MessageQuery) AllX(ctx context.Context) []*Message

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

func (*MessageQuery) Clone

func (_q *MessageQuery) Clone() *MessageQuery

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

func (*MessageQuery) Count

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

Count returns the count of the given query.

func (*MessageQuery) CountX

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

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

func (*MessageQuery) ExecContext

func (c *MessageQuery) 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 (*MessageQuery) Exist

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

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

func (*MessageQuery) ExistX

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

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

func (*MessageQuery) First

func (_q *MessageQuery) First(ctx context.Context) (*Message, error)

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

func (*MessageQuery) FirstID

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

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

func (*MessageQuery) FirstIDX

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

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

func (*MessageQuery) FirstX

func (_q *MessageQuery) FirstX(ctx context.Context) *Message

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

func (*MessageQuery) GroupBy

func (_q *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

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

client.Message.Query().
	GroupBy(message.FieldProviderMessageID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

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

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

func (*MessageQuery) IDsX

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

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

func (*MessageQuery) Limit

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

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

func (*MessageQuery) Modify

func (_q *MessageQuery) Modify(modifiers ...func(s *sql.Selector)) *MessageSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*MessageQuery) Offset

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

Offset to start from.

func (*MessageQuery) Only

func (_q *MessageQuery) Only(ctx context.Context) (*Message, error)

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

func (*MessageQuery) OnlyID

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

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

func (*MessageQuery) OnlyIDX

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

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

func (*MessageQuery) OnlyX

func (_q *MessageQuery) OnlyX(ctx context.Context) *Message

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

func (*MessageQuery) Order

func (_q *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryContext

func (c *MessageQuery) 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 (*MessageQuery) QueryThread

func (_q *MessageQuery) QueryThread() *ThreadQuery

QueryThread chains the current query on the "thread" edge.

func (*MessageQuery) Select

func (_q *MessageQuery) Select(fields ...string) *MessageSelect

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

client.Message.Query().
	Select(message.FieldProviderMessageID).
	Scan(ctx, &v)

func (*MessageQuery) Unique

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

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

func (_q *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithThread

func (_q *MessageQuery) WithThread(opts ...func(*ThreadQuery)) *MessageQuery

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

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

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

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

func (*MessageSelect) BoolX

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

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

func (*MessageSelect) Bools

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

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

func (*MessageSelect) BoolsX

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

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

func (MessageSelect) ExecContext

func (c MessageSelect) 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 (*MessageSelect) Float64

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

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

func (*MessageSelect) Float64X

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

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

func (*MessageSelect) Float64s

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

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

func (*MessageSelect) Float64sX

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

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

func (*MessageSelect) Int

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

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

func (*MessageSelect) IntX

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

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

func (*MessageSelect) Ints

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

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

func (*MessageSelect) IntsX

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

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

func (*MessageSelect) Modify

func (_s *MessageSelect) Modify(modifiers ...func(s *sql.Selector)) *MessageSelect

Modify adds a query modifier for attaching custom logic to queries.

func (MessageSelect) QueryContext

func (c MessageSelect) 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 (*MessageSelect) Scan

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

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

func (*MessageSelect) ScanX

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

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

func (*MessageSelect) String

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

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

func (*MessageSelect) StringX

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

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

func (*MessageSelect) Strings

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

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

func (*MessageSelect) StringsX

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

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

type MessageUpdate

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

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) AppendAttachments

func (_u *MessageUpdate) AppendAttachments(v []provider.AttachmentMeta) *MessageUpdate

AppendAttachments appends value to the "attachments" field.

func (*MessageUpdate) AppendCc

func (_u *MessageUpdate) AppendCc(v []string) *MessageUpdate

AppendCc appends value to the "cc" field.

func (*MessageUpdate) AppendTo

func (_u *MessageUpdate) AppendTo(v []string) *MessageUpdate

AppendTo appends value to the "to" field.

func (*MessageUpdate) ClearAttachments

func (_u *MessageUpdate) ClearAttachments() *MessageUpdate

ClearAttachments clears the value of the "attachments" field.

func (*MessageUpdate) ClearThread

func (_u *MessageUpdate) ClearThread() *MessageUpdate

ClearThread clears the "thread" edge to the Thread entity.

func (*MessageUpdate) Exec

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

Exec executes the query.

func (*MessageUpdate) ExecContext

func (c *MessageUpdate) 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 (*MessageUpdate) ExecX

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

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

func (*MessageUpdate) Modify

func (_u *MessageUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MessageUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*MessageUpdate) Mutation

func (_u *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) QueryContext

func (c *MessageUpdate) 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 (*MessageUpdate) Save

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

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

func (*MessageUpdate) SaveX

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

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

func (*MessageUpdate) SetAttachments

func (_u *MessageUpdate) SetAttachments(v []provider.AttachmentMeta) *MessageUpdate

SetAttachments sets the "attachments" field.

func (*MessageUpdate) SetBodyText

func (_u *MessageUpdate) SetBodyText(v string) *MessageUpdate

SetBodyText sets the "body_text" field.

func (*MessageUpdate) SetCc

func (_u *MessageUpdate) SetCc(v []string) *MessageUpdate

SetCc sets the "cc" field.

func (*MessageUpdate) SetDate

func (_u *MessageUpdate) SetDate(v time.Time) *MessageUpdate

SetDate sets the "date" field.

func (*MessageUpdate) SetFrom

func (_u *MessageUpdate) SetFrom(v string) *MessageUpdate

SetFrom sets the "from" field.

func (*MessageUpdate) SetIsSent

func (_u *MessageUpdate) SetIsSent(v bool) *MessageUpdate

SetIsSent sets the "is_sent" field.

func (*MessageUpdate) SetNillableBodyText

func (_u *MessageUpdate) SetNillableBodyText(v *string) *MessageUpdate

SetNillableBodyText sets the "body_text" field if the given value is not nil.

func (*MessageUpdate) SetNillableDate

func (_u *MessageUpdate) SetNillableDate(v *time.Time) *MessageUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*MessageUpdate) SetNillableFrom

func (_u *MessageUpdate) SetNillableFrom(v *string) *MessageUpdate

SetNillableFrom sets the "from" field if the given value is not nil.

func (*MessageUpdate) SetNillableIsSent

func (_u *MessageUpdate) SetNillableIsSent(v *bool) *MessageUpdate

SetNillableIsSent sets the "is_sent" field if the given value is not nil.

func (*MessageUpdate) SetNillableProviderMessageID

func (_u *MessageUpdate) SetNillableProviderMessageID(v *string) *MessageUpdate

SetNillableProviderMessageID sets the "provider_message_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableRfc822MessageID

func (_u *MessageUpdate) SetNillableRfc822MessageID(v *string) *MessageUpdate

SetNillableRfc822MessageID sets the "rfc822_message_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableSnippet

func (_u *MessageUpdate) SetNillableSnippet(v *string) *MessageUpdate

SetNillableSnippet sets the "snippet" field if the given value is not nil.

func (*MessageUpdate) SetProviderMessageID

func (_u *MessageUpdate) SetProviderMessageID(v string) *MessageUpdate

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageUpdate) SetReplyHeaders

func (_u *MessageUpdate) SetReplyHeaders(v map[string]string) *MessageUpdate

SetReplyHeaders sets the "reply_headers" field.

func (*MessageUpdate) SetRfc822MessageID

func (_u *MessageUpdate) SetRfc822MessageID(v string) *MessageUpdate

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageUpdate) SetSnippet

func (_u *MessageUpdate) SetSnippet(v string) *MessageUpdate

SetSnippet sets the "snippet" field.

func (*MessageUpdate) SetThread

func (_u *MessageUpdate) SetThread(v *Thread) *MessageUpdate

SetThread sets the "thread" edge to the Thread entity.

func (*MessageUpdate) SetThreadID

func (_u *MessageUpdate) SetThreadID(id int) *MessageUpdate

SetThreadID sets the "thread" edge to the Thread entity by ID.

func (*MessageUpdate) SetTo

func (_u *MessageUpdate) SetTo(v []string) *MessageUpdate

SetTo sets the "to" field.

func (*MessageUpdate) Where

func (_u *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

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

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) AppendAttachments

func (_u *MessageUpdateOne) AppendAttachments(v []provider.AttachmentMeta) *MessageUpdateOne

AppendAttachments appends value to the "attachments" field.

func (*MessageUpdateOne) AppendCc

func (_u *MessageUpdateOne) AppendCc(v []string) *MessageUpdateOne

AppendCc appends value to the "cc" field.

func (*MessageUpdateOne) AppendTo

func (_u *MessageUpdateOne) AppendTo(v []string) *MessageUpdateOne

AppendTo appends value to the "to" field.

func (*MessageUpdateOne) ClearAttachments

func (_u *MessageUpdateOne) ClearAttachments() *MessageUpdateOne

ClearAttachments clears the value of the "attachments" field.

func (*MessageUpdateOne) ClearThread

func (_u *MessageUpdateOne) ClearThread() *MessageUpdateOne

ClearThread clears the "thread" edge to the Thread entity.

func (*MessageUpdateOne) Exec

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

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecContext

func (c *MessageUpdateOne) 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 (*MessageUpdateOne) ExecX

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

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

func (*MessageUpdateOne) Modify

func (_u *MessageUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MessageUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*MessageUpdateOne) Mutation

func (_u *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) QueryContext

func (c *MessageUpdateOne) 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 (*MessageUpdateOne) Save

func (_u *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (_u *MessageUpdateOne) SaveX(ctx context.Context) *Message

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

func (*MessageUpdateOne) Select

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

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

func (*MessageUpdateOne) SetAttachments

func (_u *MessageUpdateOne) SetAttachments(v []provider.AttachmentMeta) *MessageUpdateOne

SetAttachments sets the "attachments" field.

func (*MessageUpdateOne) SetBodyText

func (_u *MessageUpdateOne) SetBodyText(v string) *MessageUpdateOne

SetBodyText sets the "body_text" field.

func (*MessageUpdateOne) SetCc

func (_u *MessageUpdateOne) SetCc(v []string) *MessageUpdateOne

SetCc sets the "cc" field.

func (*MessageUpdateOne) SetDate

func (_u *MessageUpdateOne) SetDate(v time.Time) *MessageUpdateOne

SetDate sets the "date" field.

func (*MessageUpdateOne) SetFrom

func (_u *MessageUpdateOne) SetFrom(v string) *MessageUpdateOne

SetFrom sets the "from" field.

func (*MessageUpdateOne) SetIsSent

func (_u *MessageUpdateOne) SetIsSent(v bool) *MessageUpdateOne

SetIsSent sets the "is_sent" field.

func (*MessageUpdateOne) SetNillableBodyText

func (_u *MessageUpdateOne) SetNillableBodyText(v *string) *MessageUpdateOne

SetNillableBodyText sets the "body_text" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableDate

func (_u *MessageUpdateOne) SetNillableDate(v *time.Time) *MessageUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableFrom

func (_u *MessageUpdateOne) SetNillableFrom(v *string) *MessageUpdateOne

SetNillableFrom sets the "from" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableIsSent

func (_u *MessageUpdateOne) SetNillableIsSent(v *bool) *MessageUpdateOne

SetNillableIsSent sets the "is_sent" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableProviderMessageID

func (_u *MessageUpdateOne) SetNillableProviderMessageID(v *string) *MessageUpdateOne

SetNillableProviderMessageID sets the "provider_message_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableRfc822MessageID

func (_u *MessageUpdateOne) SetNillableRfc822MessageID(v *string) *MessageUpdateOne

SetNillableRfc822MessageID sets the "rfc822_message_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableSnippet

func (_u *MessageUpdateOne) SetNillableSnippet(v *string) *MessageUpdateOne

SetNillableSnippet sets the "snippet" field if the given value is not nil.

func (*MessageUpdateOne) SetProviderMessageID

func (_u *MessageUpdateOne) SetProviderMessageID(v string) *MessageUpdateOne

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageUpdateOne) SetReplyHeaders

func (_u *MessageUpdateOne) SetReplyHeaders(v map[string]string) *MessageUpdateOne

SetReplyHeaders sets the "reply_headers" field.

func (*MessageUpdateOne) SetRfc822MessageID

func (_u *MessageUpdateOne) SetRfc822MessageID(v string) *MessageUpdateOne

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageUpdateOne) SetSnippet

func (_u *MessageUpdateOne) SetSnippet(v string) *MessageUpdateOne

SetSnippet sets the "snippet" field.

func (*MessageUpdateOne) SetThread

func (_u *MessageUpdateOne) SetThread(v *Thread) *MessageUpdateOne

SetThread sets the "thread" edge to the Thread entity.

func (*MessageUpdateOne) SetThreadID

func (_u *MessageUpdateOne) SetThreadID(id int) *MessageUpdateOne

SetThreadID sets the "thread" edge to the Thread entity by ID.

func (*MessageUpdateOne) SetTo

func (_u *MessageUpdateOne) SetTo(v []string) *MessageUpdateOne

SetTo sets the "to" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type MessageUpsert

type MessageUpsert struct {
	*sql.UpdateSet
}

MessageUpsert is the "OnConflict" setter.

func (*MessageUpsert) ClearAttachments

func (u *MessageUpsert) ClearAttachments() *MessageUpsert

ClearAttachments clears the value of the "attachments" field.

func (*MessageUpsert) SetAttachments

func (u *MessageUpsert) SetAttachments(v []provider.AttachmentMeta) *MessageUpsert

SetAttachments sets the "attachments" field.

func (*MessageUpsert) SetBodyText

func (u *MessageUpsert) SetBodyText(v string) *MessageUpsert

SetBodyText sets the "body_text" field.

func (*MessageUpsert) SetCc

func (u *MessageUpsert) SetCc(v []string) *MessageUpsert

SetCc sets the "cc" field.

func (*MessageUpsert) SetDate

func (u *MessageUpsert) SetDate(v time.Time) *MessageUpsert

SetDate sets the "date" field.

func (*MessageUpsert) SetFrom

func (u *MessageUpsert) SetFrom(v string) *MessageUpsert

SetFrom sets the "from" field.

func (*MessageUpsert) SetIsSent

func (u *MessageUpsert) SetIsSent(v bool) *MessageUpsert

SetIsSent sets the "is_sent" field.

func (*MessageUpsert) SetProviderMessageID

func (u *MessageUpsert) SetProviderMessageID(v string) *MessageUpsert

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageUpsert) SetReplyHeaders

func (u *MessageUpsert) SetReplyHeaders(v map[string]string) *MessageUpsert

SetReplyHeaders sets the "reply_headers" field.

func (*MessageUpsert) SetRfc822MessageID

func (u *MessageUpsert) SetRfc822MessageID(v string) *MessageUpsert

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageUpsert) SetSnippet

func (u *MessageUpsert) SetSnippet(v string) *MessageUpsert

SetSnippet sets the "snippet" field.

func (*MessageUpsert) SetTo

func (u *MessageUpsert) SetTo(v []string) *MessageUpsert

SetTo sets the "to" field.

func (*MessageUpsert) UpdateAttachments

func (u *MessageUpsert) UpdateAttachments() *MessageUpsert

UpdateAttachments sets the "attachments" field to the value that was provided on create.

func (*MessageUpsert) UpdateBodyText

func (u *MessageUpsert) UpdateBodyText() *MessageUpsert

UpdateBodyText sets the "body_text" field to the value that was provided on create.

func (*MessageUpsert) UpdateCc

func (u *MessageUpsert) UpdateCc() *MessageUpsert

UpdateCc sets the "cc" field to the value that was provided on create.

func (*MessageUpsert) UpdateDate

func (u *MessageUpsert) UpdateDate() *MessageUpsert

UpdateDate sets the "date" field to the value that was provided on create.

func (*MessageUpsert) UpdateFrom

func (u *MessageUpsert) UpdateFrom() *MessageUpsert

UpdateFrom sets the "from" field to the value that was provided on create.

func (*MessageUpsert) UpdateIsSent

func (u *MessageUpsert) UpdateIsSent() *MessageUpsert

UpdateIsSent sets the "is_sent" field to the value that was provided on create.

func (*MessageUpsert) UpdateProviderMessageID

func (u *MessageUpsert) UpdateProviderMessageID() *MessageUpsert

UpdateProviderMessageID sets the "provider_message_id" field to the value that was provided on create.

func (*MessageUpsert) UpdateReplyHeaders

func (u *MessageUpsert) UpdateReplyHeaders() *MessageUpsert

UpdateReplyHeaders sets the "reply_headers" field to the value that was provided on create.

func (*MessageUpsert) UpdateRfc822MessageID

func (u *MessageUpsert) UpdateRfc822MessageID() *MessageUpsert

UpdateRfc822MessageID sets the "rfc822_message_id" field to the value that was provided on create.

func (*MessageUpsert) UpdateSnippet

func (u *MessageUpsert) UpdateSnippet() *MessageUpsert

UpdateSnippet sets the "snippet" field to the value that was provided on create.

func (*MessageUpsert) UpdateTo

func (u *MessageUpsert) UpdateTo() *MessageUpsert

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

type MessageUpsertBulk

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

MessageUpsertBulk is the builder for "upsert"-ing a bulk of Message nodes.

func (*MessageUpsertBulk) ClearAttachments

func (u *MessageUpsertBulk) ClearAttachments() *MessageUpsertBulk

ClearAttachments clears the value of the "attachments" field.

func (*MessageUpsertBulk) DoNothing

func (u *MessageUpsertBulk) DoNothing() *MessageUpsertBulk

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

func (*MessageUpsertBulk) Exec

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

Exec executes the query.

func (*MessageUpsertBulk) ExecX

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

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

func (*MessageUpsertBulk) Ignore

func (u *MessageUpsertBulk) Ignore() *MessageUpsertBulk

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

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

func (*MessageUpsertBulk) SetAttachments

SetAttachments sets the "attachments" field.

func (*MessageUpsertBulk) SetBodyText

func (u *MessageUpsertBulk) SetBodyText(v string) *MessageUpsertBulk

SetBodyText sets the "body_text" field.

func (*MessageUpsertBulk) SetCc

SetCc sets the "cc" field.

func (*MessageUpsertBulk) SetDate

SetDate sets the "date" field.

func (*MessageUpsertBulk) SetFrom

SetFrom sets the "from" field.

func (*MessageUpsertBulk) SetIsSent

func (u *MessageUpsertBulk) SetIsSent(v bool) *MessageUpsertBulk

SetIsSent sets the "is_sent" field.

func (*MessageUpsertBulk) SetProviderMessageID

func (u *MessageUpsertBulk) SetProviderMessageID(v string) *MessageUpsertBulk

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageUpsertBulk) SetReplyHeaders

func (u *MessageUpsertBulk) SetReplyHeaders(v map[string]string) *MessageUpsertBulk

SetReplyHeaders sets the "reply_headers" field.

func (*MessageUpsertBulk) SetRfc822MessageID

func (u *MessageUpsertBulk) SetRfc822MessageID(v string) *MessageUpsertBulk

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageUpsertBulk) SetSnippet

func (u *MessageUpsertBulk) SetSnippet(v string) *MessageUpsertBulk

SetSnippet sets the "snippet" field.

func (*MessageUpsertBulk) SetTo

SetTo sets the "to" field.

func (*MessageUpsertBulk) Update

func (u *MessageUpsertBulk) Update(set func(*MessageUpsert)) *MessageUpsertBulk

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

func (*MessageUpsertBulk) UpdateAttachments

func (u *MessageUpsertBulk) UpdateAttachments() *MessageUpsertBulk

UpdateAttachments sets the "attachments" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateBodyText

func (u *MessageUpsertBulk) UpdateBodyText() *MessageUpsertBulk

UpdateBodyText sets the "body_text" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateCc

func (u *MessageUpsertBulk) UpdateCc() *MessageUpsertBulk

UpdateCc sets the "cc" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateDate

func (u *MessageUpsertBulk) UpdateDate() *MessageUpsertBulk

UpdateDate sets the "date" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateFrom

func (u *MessageUpsertBulk) UpdateFrom() *MessageUpsertBulk

UpdateFrom sets the "from" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateIsSent

func (u *MessageUpsertBulk) UpdateIsSent() *MessageUpsertBulk

UpdateIsSent sets the "is_sent" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateNewValues

func (u *MessageUpsertBulk) UpdateNewValues() *MessageUpsertBulk

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

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

func (*MessageUpsertBulk) UpdateProviderMessageID

func (u *MessageUpsertBulk) UpdateProviderMessageID() *MessageUpsertBulk

UpdateProviderMessageID sets the "provider_message_id" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateReplyHeaders

func (u *MessageUpsertBulk) UpdateReplyHeaders() *MessageUpsertBulk

UpdateReplyHeaders sets the "reply_headers" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateRfc822MessageID

func (u *MessageUpsertBulk) UpdateRfc822MessageID() *MessageUpsertBulk

UpdateRfc822MessageID sets the "rfc822_message_id" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateSnippet

func (u *MessageUpsertBulk) UpdateSnippet() *MessageUpsertBulk

UpdateSnippet sets the "snippet" field to the value that was provided on create.

func (*MessageUpsertBulk) UpdateTo

func (u *MessageUpsertBulk) UpdateTo() *MessageUpsertBulk

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

type MessageUpsertOne

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

MessageUpsertOne is the builder for "upsert"-ing

one Message node.

func (*MessageUpsertOne) ClearAttachments

func (u *MessageUpsertOne) ClearAttachments() *MessageUpsertOne

ClearAttachments clears the value of the "attachments" field.

func (*MessageUpsertOne) DoNothing

func (u *MessageUpsertOne) DoNothing() *MessageUpsertOne

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

func (*MessageUpsertOne) Exec

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

Exec executes the query.

func (*MessageUpsertOne) ExecX

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

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

func (*MessageUpsertOne) ID

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

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

func (*MessageUpsertOne) IDX

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

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

func (*MessageUpsertOne) Ignore

func (u *MessageUpsertOne) Ignore() *MessageUpsertOne

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

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

func (*MessageUpsertOne) SetAttachments

func (u *MessageUpsertOne) SetAttachments(v []provider.AttachmentMeta) *MessageUpsertOne

SetAttachments sets the "attachments" field.

func (*MessageUpsertOne) SetBodyText

func (u *MessageUpsertOne) SetBodyText(v string) *MessageUpsertOne

SetBodyText sets the "body_text" field.

func (*MessageUpsertOne) SetCc

func (u *MessageUpsertOne) SetCc(v []string) *MessageUpsertOne

SetCc sets the "cc" field.

func (*MessageUpsertOne) SetDate

func (u *MessageUpsertOne) SetDate(v time.Time) *MessageUpsertOne

SetDate sets the "date" field.

func (*MessageUpsertOne) SetFrom

func (u *MessageUpsertOne) SetFrom(v string) *MessageUpsertOne

SetFrom sets the "from" field.

func (*MessageUpsertOne) SetIsSent

func (u *MessageUpsertOne) SetIsSent(v bool) *MessageUpsertOne

SetIsSent sets the "is_sent" field.

func (*MessageUpsertOne) SetProviderMessageID

func (u *MessageUpsertOne) SetProviderMessageID(v string) *MessageUpsertOne

SetProviderMessageID sets the "provider_message_id" field.

func (*MessageUpsertOne) SetReplyHeaders

func (u *MessageUpsertOne) SetReplyHeaders(v map[string]string) *MessageUpsertOne

SetReplyHeaders sets the "reply_headers" field.

func (*MessageUpsertOne) SetRfc822MessageID

func (u *MessageUpsertOne) SetRfc822MessageID(v string) *MessageUpsertOne

SetRfc822MessageID sets the "rfc822_message_id" field.

func (*MessageUpsertOne) SetSnippet

func (u *MessageUpsertOne) SetSnippet(v string) *MessageUpsertOne

SetSnippet sets the "snippet" field.

func (*MessageUpsertOne) SetTo

func (u *MessageUpsertOne) SetTo(v []string) *MessageUpsertOne

SetTo sets the "to" field.

func (*MessageUpsertOne) Update

func (u *MessageUpsertOne) Update(set func(*MessageUpsert)) *MessageUpsertOne

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

func (*MessageUpsertOne) UpdateAttachments

func (u *MessageUpsertOne) UpdateAttachments() *MessageUpsertOne

UpdateAttachments sets the "attachments" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateBodyText

func (u *MessageUpsertOne) UpdateBodyText() *MessageUpsertOne

UpdateBodyText sets the "body_text" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateCc

func (u *MessageUpsertOne) UpdateCc() *MessageUpsertOne

UpdateCc sets the "cc" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateDate

func (u *MessageUpsertOne) UpdateDate() *MessageUpsertOne

UpdateDate sets the "date" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateFrom

func (u *MessageUpsertOne) UpdateFrom() *MessageUpsertOne

UpdateFrom sets the "from" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateIsSent

func (u *MessageUpsertOne) UpdateIsSent() *MessageUpsertOne

UpdateIsSent sets the "is_sent" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateNewValues

func (u *MessageUpsertOne) UpdateNewValues() *MessageUpsertOne

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

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

func (*MessageUpsertOne) UpdateProviderMessageID

func (u *MessageUpsertOne) UpdateProviderMessageID() *MessageUpsertOne

UpdateProviderMessageID sets the "provider_message_id" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateReplyHeaders

func (u *MessageUpsertOne) UpdateReplyHeaders() *MessageUpsertOne

UpdateReplyHeaders sets the "reply_headers" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateRfc822MessageID

func (u *MessageUpsertOne) UpdateRfc822MessageID() *MessageUpsertOne

UpdateRfc822MessageID sets the "rfc822_message_id" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateSnippet

func (u *MessageUpsertOne) UpdateSnippet() *MessageUpsertOne

UpdateSnippet sets the "snippet" field to the value that was provided on create.

func (*MessageUpsertOne) UpdateTo

func (u *MessageUpsertOne) UpdateTo() *MessageUpsertOne

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

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

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 NotifyRule

type NotifyRule struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Label holds the value of the "label" field.
	Label string `json:"label,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// Notify holds the value of the "notify" field.
	Notify bool `json:"notify,omitempty"`
	// Sound holds the value of the "sound" field.
	Sound string `json:"sound,omitempty"`
	// Urgency holds the value of the "urgency" field.
	Urgency notifyrule.Urgency `json:"urgency,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotifyRuleQuery when eager-loading is set.
	Edges NotifyRuleEdges `json:"edges"`
	// contains filtered or unexported fields
}

NotifyRule is the model entity for the NotifyRule schema.

func (*NotifyRule) ExecContext

func (c *NotifyRule) 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 (*NotifyRule) QueryAccount

func (_m *NotifyRule) QueryAccount() *AccountQuery

QueryAccount queries the "account" edge of the NotifyRule entity.

func (*NotifyRule) QueryContext

func (c *NotifyRule) 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 (*NotifyRule) String

func (_m *NotifyRule) String() string

String implements the fmt.Stringer.

func (*NotifyRule) Unwrap

func (_m *NotifyRule) Unwrap() *NotifyRule

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

func (_m *NotifyRule) Update() *NotifyRuleUpdateOne

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

func (*NotifyRule) Value

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

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

type NotifyRuleClient

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

NotifyRuleClient is a client for the NotifyRule schema.

func NewNotifyRuleClient

func NewNotifyRuleClient(c config) *NotifyRuleClient

NewNotifyRuleClient returns a client for the NotifyRule from the given config.

func (*NotifyRuleClient) Create

func (c *NotifyRuleClient) Create() *NotifyRuleCreate

Create returns a builder for creating a NotifyRule entity.

func (*NotifyRuleClient) CreateBulk

func (c *NotifyRuleClient) CreateBulk(builders ...*NotifyRuleCreate) *NotifyRuleCreateBulk

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

func (*NotifyRuleClient) Delete

func (c *NotifyRuleClient) Delete() *NotifyRuleDelete

Delete returns a delete builder for NotifyRule.

func (*NotifyRuleClient) DeleteOne

func (c *NotifyRuleClient) DeleteOne(_m *NotifyRule) *NotifyRuleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotifyRuleClient) DeleteOneID

func (c *NotifyRuleClient) DeleteOneID(id int) *NotifyRuleDeleteOne

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

func (*NotifyRuleClient) ExecContext

func (c *NotifyRuleClient) 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 (*NotifyRuleClient) Get

func (c *NotifyRuleClient) Get(ctx context.Context, id int) (*NotifyRule, error)

Get returns a NotifyRule entity by its id.

func (*NotifyRuleClient) GetX

func (c *NotifyRuleClient) GetX(ctx context.Context, id int) *NotifyRule

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

func (*NotifyRuleClient) Hooks

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

Hooks returns the client hooks.

func (*NotifyRuleClient) Intercept

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

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

func (*NotifyRuleClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NotifyRuleClient) MapCreateBulk

func (c *NotifyRuleClient) MapCreateBulk(slice any, setFunc func(*NotifyRuleCreate, int)) *NotifyRuleCreateBulk

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

func (c *NotifyRuleClient) Query() *NotifyRuleQuery

Query returns a query builder for NotifyRule.

func (*NotifyRuleClient) QueryAccount

func (c *NotifyRuleClient) QueryAccount(_m *NotifyRule) *AccountQuery

QueryAccount queries the account edge of a NotifyRule.

func (*NotifyRuleClient) QueryContext

func (c *NotifyRuleClient) 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 (*NotifyRuleClient) Update

func (c *NotifyRuleClient) Update() *NotifyRuleUpdate

Update returns an update builder for NotifyRule.

func (*NotifyRuleClient) UpdateOne

func (c *NotifyRuleClient) UpdateOne(_m *NotifyRule) *NotifyRuleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotifyRuleClient) UpdateOneID

func (c *NotifyRuleClient) UpdateOneID(id int) *NotifyRuleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NotifyRuleClient) Use

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

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

type NotifyRuleCreate

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

NotifyRuleCreate is the builder for creating a NotifyRule entity.

func (*NotifyRuleCreate) Exec

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

Exec executes the query.

func (*NotifyRuleCreate) ExecContext

func (c *NotifyRuleCreate) 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 (*NotifyRuleCreate) ExecX

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

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

func (*NotifyRuleCreate) Mutation

func (_c *NotifyRuleCreate) Mutation() *NotifyRuleMutation

Mutation returns the NotifyRuleMutation object of the builder.

func (*NotifyRuleCreate) OnConflict

func (_c *NotifyRuleCreate) OnConflict(opts ...sql.ConflictOption) *NotifyRuleUpsertOne

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

client.NotifyRule.Create().
	SetLabel(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.NotifyRuleUpsert) {
		SetLabel(v+v).
	}).
	Exec(ctx)

func (*NotifyRuleCreate) OnConflictColumns

func (_c *NotifyRuleCreate) OnConflictColumns(columns ...string) *NotifyRuleUpsertOne

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

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

func (*NotifyRuleCreate) QueryContext

func (c *NotifyRuleCreate) 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 (*NotifyRuleCreate) Save

func (_c *NotifyRuleCreate) Save(ctx context.Context) (*NotifyRule, error)

Save creates the NotifyRule in the database.

func (*NotifyRuleCreate) SaveX

func (_c *NotifyRuleCreate) SaveX(ctx context.Context) *NotifyRule

SaveX calls Save and panics if Save returns an error.

func (*NotifyRuleCreate) SetAccount

func (_c *NotifyRuleCreate) SetAccount(v *Account) *NotifyRuleCreate

SetAccount sets the "account" edge to the Account entity.

func (*NotifyRuleCreate) SetAccountID

func (_c *NotifyRuleCreate) SetAccountID(id uuid.UUID) *NotifyRuleCreate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*NotifyRuleCreate) SetEnabled

func (_c *NotifyRuleCreate) SetEnabled(v bool) *NotifyRuleCreate

SetEnabled sets the "enabled" field.

func (*NotifyRuleCreate) SetLabel

func (_c *NotifyRuleCreate) SetLabel(v string) *NotifyRuleCreate

SetLabel sets the "label" field.

func (*NotifyRuleCreate) SetNillableEnabled

func (_c *NotifyRuleCreate) SetNillableEnabled(v *bool) *NotifyRuleCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*NotifyRuleCreate) SetNillableNotify

func (_c *NotifyRuleCreate) SetNillableNotify(v *bool) *NotifyRuleCreate

SetNillableNotify sets the "notify" field if the given value is not nil.

func (*NotifyRuleCreate) SetNillableSound

func (_c *NotifyRuleCreate) SetNillableSound(v *string) *NotifyRuleCreate

SetNillableSound sets the "sound" field if the given value is not nil.

func (*NotifyRuleCreate) SetNillableUrgency

func (_c *NotifyRuleCreate) SetNillableUrgency(v *notifyrule.Urgency) *NotifyRuleCreate

SetNillableUrgency sets the "urgency" field if the given value is not nil.

func (*NotifyRuleCreate) SetNotify

func (_c *NotifyRuleCreate) SetNotify(v bool) *NotifyRuleCreate

SetNotify sets the "notify" field.

func (*NotifyRuleCreate) SetSound

func (_c *NotifyRuleCreate) SetSound(v string) *NotifyRuleCreate

SetSound sets the "sound" field.

func (*NotifyRuleCreate) SetUrgency

SetUrgency sets the "urgency" field.

type NotifyRuleCreateBulk

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

NotifyRuleCreateBulk is the builder for creating many NotifyRule entities in bulk.

func (*NotifyRuleCreateBulk) Exec

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

Exec executes the query.

func (*NotifyRuleCreateBulk) ExecContext

func (c *NotifyRuleCreateBulk) 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 (*NotifyRuleCreateBulk) ExecX

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

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

func (*NotifyRuleCreateBulk) OnConflict

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

client.NotifyRule.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.NotifyRuleUpsert) {
		SetLabel(v+v).
	}).
	Exec(ctx)

func (*NotifyRuleCreateBulk) OnConflictColumns

func (_c *NotifyRuleCreateBulk) OnConflictColumns(columns ...string) *NotifyRuleUpsertBulk

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

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

func (*NotifyRuleCreateBulk) QueryContext

func (c *NotifyRuleCreateBulk) 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 (*NotifyRuleCreateBulk) Save

func (_c *NotifyRuleCreateBulk) Save(ctx context.Context) ([]*NotifyRule, error)

Save creates the NotifyRule entities in the database.

func (*NotifyRuleCreateBulk) SaveX

func (_c *NotifyRuleCreateBulk) SaveX(ctx context.Context) []*NotifyRule

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

type NotifyRuleDelete

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

NotifyRuleDelete is the builder for deleting a NotifyRule entity.

func (*NotifyRuleDelete) Exec

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

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

func (*NotifyRuleDelete) ExecContext

func (c *NotifyRuleDelete) 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 (*NotifyRuleDelete) ExecX

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

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

func (*NotifyRuleDelete) QueryContext

func (c *NotifyRuleDelete) 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 (*NotifyRuleDelete) Where

Where appends a list predicates to the NotifyRuleDelete builder.

type NotifyRuleDeleteOne

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

NotifyRuleDeleteOne is the builder for deleting a single NotifyRule entity.

func (*NotifyRuleDeleteOne) Exec

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

Exec executes the deletion query.

func (*NotifyRuleDeleteOne) ExecX

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

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

func (*NotifyRuleDeleteOne) Where

Where appends a list predicates to the NotifyRuleDelete builder.

type NotifyRuleEdges

type NotifyRuleEdges struct {
	// Account holds the value of the account edge.
	Account *Account `json:"account,omitempty"`
	// contains filtered or unexported fields
}

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

func (NotifyRuleEdges) AccountOrErr

func (e NotifyRuleEdges) AccountOrErr() (*Account, error)

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

type NotifyRuleGroupBy

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

NotifyRuleGroupBy is the group-by builder for NotifyRule entities.

func (*NotifyRuleGroupBy) Aggregate

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

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

func (*NotifyRuleGroupBy) Bool

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

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

func (*NotifyRuleGroupBy) BoolX

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

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

func (*NotifyRuleGroupBy) Bools

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

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

func (*NotifyRuleGroupBy) BoolsX

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

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

func (*NotifyRuleGroupBy) Float64

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

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

func (*NotifyRuleGroupBy) Float64X

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

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

func (*NotifyRuleGroupBy) Float64s

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

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

func (*NotifyRuleGroupBy) Float64sX

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

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

func (*NotifyRuleGroupBy) Int

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

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

func (*NotifyRuleGroupBy) IntX

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

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

func (*NotifyRuleGroupBy) Ints

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

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

func (*NotifyRuleGroupBy) IntsX

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

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

func (*NotifyRuleGroupBy) Scan

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

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

func (*NotifyRuleGroupBy) ScanX

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

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

func (*NotifyRuleGroupBy) String

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

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

func (*NotifyRuleGroupBy) StringX

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

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

func (*NotifyRuleGroupBy) Strings

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

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

func (*NotifyRuleGroupBy) StringsX

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

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

type NotifyRuleMutation

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

NotifyRuleMutation represents an operation that mutates the NotifyRule nodes in the graph.

func (*NotifyRuleMutation) AccountCleared

func (m *NotifyRuleMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Account entity was cleared.

func (*NotifyRuleMutation) AccountID

func (m *NotifyRuleMutation) AccountID() (id uuid.UUID, exists bool)

AccountID returns the "account" edge ID in the mutation.

func (*NotifyRuleMutation) AccountIDs

func (m *NotifyRuleMutation) AccountIDs() (ids []uuid.UUID)

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

func (*NotifyRuleMutation) AddField

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

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

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

func (*NotifyRuleMutation) AddedField

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

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

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

func (*NotifyRuleMutation) AddedIDs

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

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

func (*NotifyRuleMutation) ClearAccount

func (m *NotifyRuleMutation) ClearAccount()

ClearAccount clears the "account" edge to the Account entity.

func (*NotifyRuleMutation) ClearEdge

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

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

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

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

func (*NotifyRuleMutation) ClearedFields

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

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

func (NotifyRuleMutation) Client

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

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

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

func (*NotifyRuleMutation) Enabled

func (m *NotifyRuleMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*NotifyRuleMutation) ExecContext

func (c *NotifyRuleMutation) 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 (*NotifyRuleMutation) Field

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

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

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

func (*NotifyRuleMutation) Fields

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

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

func (m *NotifyRuleMutation) 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 (*NotifyRuleMutation) Label

func (m *NotifyRuleMutation) Label() (r string, exists bool)

Label returns the value of the "label" field in the mutation.

func (*NotifyRuleMutation) Notify

func (m *NotifyRuleMutation) Notify() (r bool, exists bool)

Notify returns the value of the "notify" field in the mutation.

func (*NotifyRuleMutation) OldEnabled

func (m *NotifyRuleMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the NotifyRule entity. If the NotifyRule 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 (*NotifyRuleMutation) OldField

func (m *NotifyRuleMutation) 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 (*NotifyRuleMutation) OldLabel

func (m *NotifyRuleMutation) OldLabel(ctx context.Context) (v string, err error)

OldLabel returns the old "label" field's value of the NotifyRule entity. If the NotifyRule 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 (*NotifyRuleMutation) OldNotify

func (m *NotifyRuleMutation) OldNotify(ctx context.Context) (v bool, err error)

OldNotify returns the old "notify" field's value of the NotifyRule entity. If the NotifyRule 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 (*NotifyRuleMutation) OldSound

func (m *NotifyRuleMutation) OldSound(ctx context.Context) (v string, err error)

OldSound returns the old "sound" field's value of the NotifyRule entity. If the NotifyRule 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 (*NotifyRuleMutation) OldUrgency

func (m *NotifyRuleMutation) OldUrgency(ctx context.Context) (v notifyrule.Urgency, err error)

OldUrgency returns the old "urgency" field's value of the NotifyRule entity. If the NotifyRule 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 (*NotifyRuleMutation) Op

func (m *NotifyRuleMutation) Op() Op

Op returns the operation name.

func (*NotifyRuleMutation) QueryContext

func (c *NotifyRuleMutation) 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 (*NotifyRuleMutation) RemovedEdges

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

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

func (*NotifyRuleMutation) RemovedIDs

func (m *NotifyRuleMutation) 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 (*NotifyRuleMutation) ResetAccount

func (m *NotifyRuleMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*NotifyRuleMutation) ResetEdge

func (m *NotifyRuleMutation) 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 (*NotifyRuleMutation) ResetEnabled

func (m *NotifyRuleMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*NotifyRuleMutation) ResetField

func (m *NotifyRuleMutation) 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 (*NotifyRuleMutation) ResetLabel

func (m *NotifyRuleMutation) ResetLabel()

ResetLabel resets all changes to the "label" field.

func (*NotifyRuleMutation) ResetNotify

func (m *NotifyRuleMutation) ResetNotify()

ResetNotify resets all changes to the "notify" field.

func (*NotifyRuleMutation) ResetSound

func (m *NotifyRuleMutation) ResetSound()

ResetSound resets all changes to the "sound" field.

func (*NotifyRuleMutation) ResetUrgency

func (m *NotifyRuleMutation) ResetUrgency()

ResetUrgency resets all changes to the "urgency" field.

func (*NotifyRuleMutation) SetAccountID

func (m *NotifyRuleMutation) SetAccountID(id uuid.UUID)

SetAccountID sets the "account" edge to the Account entity by id.

func (*NotifyRuleMutation) SetEnabled

func (m *NotifyRuleMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*NotifyRuleMutation) SetField

func (m *NotifyRuleMutation) 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 (*NotifyRuleMutation) SetLabel

func (m *NotifyRuleMutation) SetLabel(s string)

SetLabel sets the "label" field.

func (*NotifyRuleMutation) SetNotify

func (m *NotifyRuleMutation) SetNotify(b bool)

SetNotify sets the "notify" field.

func (*NotifyRuleMutation) SetOp

func (m *NotifyRuleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotifyRuleMutation) SetSound

func (m *NotifyRuleMutation) SetSound(s string)

SetSound sets the "sound" field.

func (*NotifyRuleMutation) SetUrgency

func (m *NotifyRuleMutation) SetUrgency(n notifyrule.Urgency)

SetUrgency sets the "urgency" field.

func (*NotifyRuleMutation) Sound

func (m *NotifyRuleMutation) Sound() (r string, exists bool)

Sound returns the value of the "sound" field in the mutation.

func (NotifyRuleMutation) Tx

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

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

func (*NotifyRuleMutation) Type

func (m *NotifyRuleMutation) Type() string

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

func (*NotifyRuleMutation) Urgency

func (m *NotifyRuleMutation) Urgency() (r notifyrule.Urgency, exists bool)

Urgency returns the value of the "urgency" field in the mutation.

func (*NotifyRuleMutation) Where

func (m *NotifyRuleMutation) Where(ps ...predicate.NotifyRule)

Where appends a list predicates to the NotifyRuleMutation builder.

func (*NotifyRuleMutation) WhereP

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

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

type NotifyRuleQuery

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

NotifyRuleQuery is the builder for querying NotifyRule entities.

func (*NotifyRuleQuery) Aggregate

func (_q *NotifyRuleQuery) Aggregate(fns ...AggregateFunc) *NotifyRuleSelect

Aggregate returns a NotifyRuleSelect configured with the given aggregations.

func (*NotifyRuleQuery) All

func (_q *NotifyRuleQuery) All(ctx context.Context) ([]*NotifyRule, error)

All executes the query and returns a list of NotifyRules.

func (*NotifyRuleQuery) AllX

func (_q *NotifyRuleQuery) AllX(ctx context.Context) []*NotifyRule

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

func (*NotifyRuleQuery) Clone

func (_q *NotifyRuleQuery) Clone() *NotifyRuleQuery

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

func (*NotifyRuleQuery) Count

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

Count returns the count of the given query.

func (*NotifyRuleQuery) CountX

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

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

func (*NotifyRuleQuery) ExecContext

func (c *NotifyRuleQuery) 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 (*NotifyRuleQuery) Exist

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

Exist returns true if the query has elements in the graph.

func (*NotifyRuleQuery) ExistX

func (_q *NotifyRuleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NotifyRuleQuery) First

func (_q *NotifyRuleQuery) First(ctx context.Context) (*NotifyRule, error)

First returns the first NotifyRule entity from the query. Returns a *NotFoundError when no NotifyRule was found.

func (*NotifyRuleQuery) FirstID

func (_q *NotifyRuleQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NotifyRule ID from the query. Returns a *NotFoundError when no NotifyRule ID was found.

func (*NotifyRuleQuery) FirstIDX

func (_q *NotifyRuleQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NotifyRuleQuery) FirstX

func (_q *NotifyRuleQuery) FirstX(ctx context.Context) *NotifyRule

FirstX is like First, but panics if an error occurs.

func (*NotifyRuleQuery) GroupBy

func (_q *NotifyRuleQuery) GroupBy(field string, fields ...string) *NotifyRuleGroupBy

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 {
	Label string `json:"label,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NotifyRule.Query().
	GroupBy(notifyrule.FieldLabel).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NotifyRuleQuery) IDs

func (_q *NotifyRuleQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of NotifyRule IDs.

func (*NotifyRuleQuery) IDsX

func (_q *NotifyRuleQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NotifyRuleQuery) Limit

func (_q *NotifyRuleQuery) Limit(limit int) *NotifyRuleQuery

Limit the number of records to be returned by this query.

func (*NotifyRuleQuery) Modify

func (_q *NotifyRuleQuery) Modify(modifiers ...func(s *sql.Selector)) *NotifyRuleSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*NotifyRuleQuery) Offset

func (_q *NotifyRuleQuery) Offset(offset int) *NotifyRuleQuery

Offset to start from.

func (*NotifyRuleQuery) Only

func (_q *NotifyRuleQuery) Only(ctx context.Context) (*NotifyRule, error)

Only returns a single NotifyRule entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NotifyRule entity is found. Returns a *NotFoundError when no NotifyRule entities are found.

func (*NotifyRuleQuery) OnlyID

func (_q *NotifyRuleQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NotifyRule ID in the query. Returns a *NotSingularError when more than one NotifyRule ID is found. Returns a *NotFoundError when no entities are found.

func (*NotifyRuleQuery) OnlyIDX

func (_q *NotifyRuleQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NotifyRuleQuery) OnlyX

func (_q *NotifyRuleQuery) OnlyX(ctx context.Context) *NotifyRule

OnlyX is like Only, but panics if an error occurs.

func (*NotifyRuleQuery) Order

Order specifies how the records should be ordered.

func (*NotifyRuleQuery) QueryAccount

func (_q *NotifyRuleQuery) QueryAccount() *AccountQuery

QueryAccount chains the current query on the "account" edge.

func (*NotifyRuleQuery) QueryContext

func (c *NotifyRuleQuery) 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 (*NotifyRuleQuery) Select

func (_q *NotifyRuleQuery) Select(fields ...string) *NotifyRuleSelect

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 {
	Label string `json:"label,omitempty"`
}

client.NotifyRule.Query().
	Select(notifyrule.FieldLabel).
	Scan(ctx, &v)

func (*NotifyRuleQuery) Unique

func (_q *NotifyRuleQuery) Unique(unique bool) *NotifyRuleQuery

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 (*NotifyRuleQuery) Where

Where adds a new predicate for the NotifyRuleQuery builder.

func (*NotifyRuleQuery) WithAccount

func (_q *NotifyRuleQuery) WithAccount(opts ...func(*AccountQuery)) *NotifyRuleQuery

WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.

type NotifyRuleSelect

type NotifyRuleSelect struct {
	*NotifyRuleQuery
	// contains filtered or unexported fields
}

NotifyRuleSelect is the builder for selecting fields of NotifyRule entities.

func (*NotifyRuleSelect) Aggregate

func (_s *NotifyRuleSelect) Aggregate(fns ...AggregateFunc) *NotifyRuleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NotifyRuleSelect) Bool

func (s *NotifyRuleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) BoolX

func (s *NotifyRuleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotifyRuleSelect) Bools

func (s *NotifyRuleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) BoolsX

func (s *NotifyRuleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (NotifyRuleSelect) ExecContext

func (c NotifyRuleSelect) 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 (*NotifyRuleSelect) Float64

func (s *NotifyRuleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) Float64X

func (s *NotifyRuleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotifyRuleSelect) Float64s

func (s *NotifyRuleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) Float64sX

func (s *NotifyRuleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotifyRuleSelect) Int

func (s *NotifyRuleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) IntX

func (s *NotifyRuleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotifyRuleSelect) Ints

func (s *NotifyRuleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) IntsX

func (s *NotifyRuleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotifyRuleSelect) Modify

func (_s *NotifyRuleSelect) Modify(modifiers ...func(s *sql.Selector)) *NotifyRuleSelect

Modify adds a query modifier for attaching custom logic to queries.

func (NotifyRuleSelect) QueryContext

func (c NotifyRuleSelect) 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 (*NotifyRuleSelect) Scan

func (_s *NotifyRuleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotifyRuleSelect) ScanX

func (s *NotifyRuleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotifyRuleSelect) String

func (s *NotifyRuleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) StringX

func (s *NotifyRuleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotifyRuleSelect) Strings

func (s *NotifyRuleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotifyRuleSelect) StringsX

func (s *NotifyRuleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotifyRuleUpdate

type NotifyRuleUpdate struct {
	// contains filtered or unexported fields
}

NotifyRuleUpdate is the builder for updating NotifyRule entities.

func (*NotifyRuleUpdate) ClearAccount

func (_u *NotifyRuleUpdate) ClearAccount() *NotifyRuleUpdate

ClearAccount clears the "account" edge to the Account entity.

func (*NotifyRuleUpdate) Exec

func (_u *NotifyRuleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NotifyRuleUpdate) ExecContext

func (c *NotifyRuleUpdate) 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 (*NotifyRuleUpdate) ExecX

func (_u *NotifyRuleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifyRuleUpdate) Modify

func (_u *NotifyRuleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *NotifyRuleUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*NotifyRuleUpdate) Mutation

func (_u *NotifyRuleUpdate) Mutation() *NotifyRuleMutation

Mutation returns the NotifyRuleMutation object of the builder.

func (*NotifyRuleUpdate) QueryContext

func (c *NotifyRuleUpdate) 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 (*NotifyRuleUpdate) Save

func (_u *NotifyRuleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NotifyRuleUpdate) SaveX

func (_u *NotifyRuleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NotifyRuleUpdate) SetAccount

func (_u *NotifyRuleUpdate) SetAccount(v *Account) *NotifyRuleUpdate

SetAccount sets the "account" edge to the Account entity.

func (*NotifyRuleUpdate) SetAccountID

func (_u *NotifyRuleUpdate) SetAccountID(id uuid.UUID) *NotifyRuleUpdate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*NotifyRuleUpdate) SetEnabled

func (_u *NotifyRuleUpdate) SetEnabled(v bool) *NotifyRuleUpdate

SetEnabled sets the "enabled" field.

func (*NotifyRuleUpdate) SetLabel

func (_u *NotifyRuleUpdate) SetLabel(v string) *NotifyRuleUpdate

SetLabel sets the "label" field.

func (*NotifyRuleUpdate) SetNillableEnabled

func (_u *NotifyRuleUpdate) SetNillableEnabled(v *bool) *NotifyRuleUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*NotifyRuleUpdate) SetNillableLabel

func (_u *NotifyRuleUpdate) SetNillableLabel(v *string) *NotifyRuleUpdate

SetNillableLabel sets the "label" field if the given value is not nil.

func (*NotifyRuleUpdate) SetNillableNotify

func (_u *NotifyRuleUpdate) SetNillableNotify(v *bool) *NotifyRuleUpdate

SetNillableNotify sets the "notify" field if the given value is not nil.

func (*NotifyRuleUpdate) SetNillableSound

func (_u *NotifyRuleUpdate) SetNillableSound(v *string) *NotifyRuleUpdate

SetNillableSound sets the "sound" field if the given value is not nil.

func (*NotifyRuleUpdate) SetNillableUrgency

func (_u *NotifyRuleUpdate) SetNillableUrgency(v *notifyrule.Urgency) *NotifyRuleUpdate

SetNillableUrgency sets the "urgency" field if the given value is not nil.

func (*NotifyRuleUpdate) SetNotify

func (_u *NotifyRuleUpdate) SetNotify(v bool) *NotifyRuleUpdate

SetNotify sets the "notify" field.

func (*NotifyRuleUpdate) SetSound

func (_u *NotifyRuleUpdate) SetSound(v string) *NotifyRuleUpdate

SetSound sets the "sound" field.

func (*NotifyRuleUpdate) SetUrgency

SetUrgency sets the "urgency" field.

func (*NotifyRuleUpdate) Where

Where appends a list predicates to the NotifyRuleUpdate builder.

type NotifyRuleUpdateOne

type NotifyRuleUpdateOne struct {
	// contains filtered or unexported fields
}

NotifyRuleUpdateOne is the builder for updating a single NotifyRule entity.

func (*NotifyRuleUpdateOne) ClearAccount

func (_u *NotifyRuleUpdateOne) ClearAccount() *NotifyRuleUpdateOne

ClearAccount clears the "account" edge to the Account entity.

func (*NotifyRuleUpdateOne) Exec

func (_u *NotifyRuleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NotifyRuleUpdateOne) ExecContext

func (c *NotifyRuleUpdateOne) 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 (*NotifyRuleUpdateOne) ExecX

func (_u *NotifyRuleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifyRuleUpdateOne) Modify

func (_u *NotifyRuleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *NotifyRuleUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*NotifyRuleUpdateOne) Mutation

func (_u *NotifyRuleUpdateOne) Mutation() *NotifyRuleMutation

Mutation returns the NotifyRuleMutation object of the builder.

func (*NotifyRuleUpdateOne) QueryContext

func (c *NotifyRuleUpdateOne) 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 (*NotifyRuleUpdateOne) Save

Save executes the query and returns the updated NotifyRule entity.

func (*NotifyRuleUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NotifyRuleUpdateOne) Select

func (_u *NotifyRuleUpdateOne) Select(field string, fields ...string) *NotifyRuleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NotifyRuleUpdateOne) SetAccount

func (_u *NotifyRuleUpdateOne) SetAccount(v *Account) *NotifyRuleUpdateOne

SetAccount sets the "account" edge to the Account entity.

func (*NotifyRuleUpdateOne) SetAccountID

func (_u *NotifyRuleUpdateOne) SetAccountID(id uuid.UUID) *NotifyRuleUpdateOne

SetAccountID sets the "account" edge to the Account entity by ID.

func (*NotifyRuleUpdateOne) SetEnabled

func (_u *NotifyRuleUpdateOne) SetEnabled(v bool) *NotifyRuleUpdateOne

SetEnabled sets the "enabled" field.

func (*NotifyRuleUpdateOne) SetLabel

SetLabel sets the "label" field.

func (*NotifyRuleUpdateOne) SetNillableEnabled

func (_u *NotifyRuleUpdateOne) SetNillableEnabled(v *bool) *NotifyRuleUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*NotifyRuleUpdateOne) SetNillableLabel

func (_u *NotifyRuleUpdateOne) SetNillableLabel(v *string) *NotifyRuleUpdateOne

SetNillableLabel sets the "label" field if the given value is not nil.

func (*NotifyRuleUpdateOne) SetNillableNotify

func (_u *NotifyRuleUpdateOne) SetNillableNotify(v *bool) *NotifyRuleUpdateOne

SetNillableNotify sets the "notify" field if the given value is not nil.

func (*NotifyRuleUpdateOne) SetNillableSound

func (_u *NotifyRuleUpdateOne) SetNillableSound(v *string) *NotifyRuleUpdateOne

SetNillableSound sets the "sound" field if the given value is not nil.

func (*NotifyRuleUpdateOne) SetNillableUrgency

func (_u *NotifyRuleUpdateOne) SetNillableUrgency(v *notifyrule.Urgency) *NotifyRuleUpdateOne

SetNillableUrgency sets the "urgency" field if the given value is not nil.

func (*NotifyRuleUpdateOne) SetNotify

func (_u *NotifyRuleUpdateOne) SetNotify(v bool) *NotifyRuleUpdateOne

SetNotify sets the "notify" field.

func (*NotifyRuleUpdateOne) SetSound

SetSound sets the "sound" field.

func (*NotifyRuleUpdateOne) SetUrgency

SetUrgency sets the "urgency" field.

func (*NotifyRuleUpdateOne) Where

Where appends a list predicates to the NotifyRuleUpdate builder.

type NotifyRuleUpsert

type NotifyRuleUpsert struct {
	*sql.UpdateSet
}

NotifyRuleUpsert is the "OnConflict" setter.

func (*NotifyRuleUpsert) SetEnabled

func (u *NotifyRuleUpsert) SetEnabled(v bool) *NotifyRuleUpsert

SetEnabled sets the "enabled" field.

func (*NotifyRuleUpsert) SetLabel

func (u *NotifyRuleUpsert) SetLabel(v string) *NotifyRuleUpsert

SetLabel sets the "label" field.

func (*NotifyRuleUpsert) SetNotify

func (u *NotifyRuleUpsert) SetNotify(v bool) *NotifyRuleUpsert

SetNotify sets the "notify" field.

func (*NotifyRuleUpsert) SetSound

func (u *NotifyRuleUpsert) SetSound(v string) *NotifyRuleUpsert

SetSound sets the "sound" field.

func (*NotifyRuleUpsert) SetUrgency

SetUrgency sets the "urgency" field.

func (*NotifyRuleUpsert) UpdateEnabled

func (u *NotifyRuleUpsert) UpdateEnabled() *NotifyRuleUpsert

UpdateEnabled sets the "enabled" field to the value that was provided on create.

func (*NotifyRuleUpsert) UpdateLabel

func (u *NotifyRuleUpsert) UpdateLabel() *NotifyRuleUpsert

UpdateLabel sets the "label" field to the value that was provided on create.

func (*NotifyRuleUpsert) UpdateNotify

func (u *NotifyRuleUpsert) UpdateNotify() *NotifyRuleUpsert

UpdateNotify sets the "notify" field to the value that was provided on create.

func (*NotifyRuleUpsert) UpdateSound

func (u *NotifyRuleUpsert) UpdateSound() *NotifyRuleUpsert

UpdateSound sets the "sound" field to the value that was provided on create.

func (*NotifyRuleUpsert) UpdateUrgency

func (u *NotifyRuleUpsert) UpdateUrgency() *NotifyRuleUpsert

UpdateUrgency sets the "urgency" field to the value that was provided on create.

type NotifyRuleUpsertBulk

type NotifyRuleUpsertBulk struct {
	// contains filtered or unexported fields
}

NotifyRuleUpsertBulk is the builder for "upsert"-ing a bulk of NotifyRule nodes.

func (*NotifyRuleUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotifyRuleUpsertBulk) Exec

Exec executes the query.

func (*NotifyRuleUpsertBulk) ExecX

func (u *NotifyRuleUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifyRuleUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotifyRule.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NotifyRuleUpsertBulk) SetEnabled

SetEnabled sets the "enabled" field.

func (*NotifyRuleUpsertBulk) SetLabel

SetLabel sets the "label" field.

func (*NotifyRuleUpsertBulk) SetNotify

SetNotify sets the "notify" field.

func (*NotifyRuleUpsertBulk) SetSound

SetSound sets the "sound" field.

func (*NotifyRuleUpsertBulk) SetUrgency

SetUrgency sets the "urgency" field.

func (*NotifyRuleUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the NotifyRuleCreateBulk.OnConflict documentation for more info.

func (*NotifyRuleUpsertBulk) UpdateEnabled

func (u *NotifyRuleUpsertBulk) UpdateEnabled() *NotifyRuleUpsertBulk

UpdateEnabled sets the "enabled" field to the value that was provided on create.

func (*NotifyRuleUpsertBulk) UpdateLabel

func (u *NotifyRuleUpsertBulk) UpdateLabel() *NotifyRuleUpsertBulk

UpdateLabel sets the "label" field to the value that was provided on create.

func (*NotifyRuleUpsertBulk) UpdateNewValues

func (u *NotifyRuleUpsertBulk) UpdateNewValues() *NotifyRuleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NotifyRule.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*NotifyRuleUpsertBulk) UpdateNotify

func (u *NotifyRuleUpsertBulk) UpdateNotify() *NotifyRuleUpsertBulk

UpdateNotify sets the "notify" field to the value that was provided on create.

func (*NotifyRuleUpsertBulk) UpdateSound

func (u *NotifyRuleUpsertBulk) UpdateSound() *NotifyRuleUpsertBulk

UpdateSound sets the "sound" field to the value that was provided on create.

func (*NotifyRuleUpsertBulk) UpdateUrgency

func (u *NotifyRuleUpsertBulk) UpdateUrgency() *NotifyRuleUpsertBulk

UpdateUrgency sets the "urgency" field to the value that was provided on create.

type NotifyRuleUpsertOne

type NotifyRuleUpsertOne struct {
	// contains filtered or unexported fields
}

NotifyRuleUpsertOne is the builder for "upsert"-ing

one NotifyRule node.

func (*NotifyRuleUpsertOne) DoNothing

func (u *NotifyRuleUpsertOne) DoNothing() *NotifyRuleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotifyRuleUpsertOne) Exec

Exec executes the query.

func (*NotifyRuleUpsertOne) ExecX

func (u *NotifyRuleUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifyRuleUpsertOne) ID

func (u *NotifyRuleUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NotifyRuleUpsertOne) IDX

func (u *NotifyRuleUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*NotifyRuleUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotifyRule.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NotifyRuleUpsertOne) SetEnabled

func (u *NotifyRuleUpsertOne) SetEnabled(v bool) *NotifyRuleUpsertOne

SetEnabled sets the "enabled" field.

func (*NotifyRuleUpsertOne) SetLabel

SetLabel sets the "label" field.

func (*NotifyRuleUpsertOne) SetNotify

func (u *NotifyRuleUpsertOne) SetNotify(v bool) *NotifyRuleUpsertOne

SetNotify sets the "notify" field.

func (*NotifyRuleUpsertOne) SetSound

SetSound sets the "sound" field.

func (*NotifyRuleUpsertOne) SetUrgency

SetUrgency sets the "urgency" field.

func (*NotifyRuleUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the NotifyRuleCreate.OnConflict documentation for more info.

func (*NotifyRuleUpsertOne) UpdateEnabled

func (u *NotifyRuleUpsertOne) UpdateEnabled() *NotifyRuleUpsertOne

UpdateEnabled sets the "enabled" field to the value that was provided on create.

func (*NotifyRuleUpsertOne) UpdateLabel

func (u *NotifyRuleUpsertOne) UpdateLabel() *NotifyRuleUpsertOne

UpdateLabel sets the "label" field to the value that was provided on create.

func (*NotifyRuleUpsertOne) UpdateNewValues

func (u *NotifyRuleUpsertOne) UpdateNewValues() *NotifyRuleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NotifyRule.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*NotifyRuleUpsertOne) UpdateNotify

func (u *NotifyRuleUpsertOne) UpdateNotify() *NotifyRuleUpsertOne

UpdateNotify sets the "notify" field to the value that was provided on create.

func (*NotifyRuleUpsertOne) UpdateSound

func (u *NotifyRuleUpsertOne) UpdateSound() *NotifyRuleUpsertOne

UpdateSound sets the "sound" field to the value that was provided on create.

func (*NotifyRuleUpsertOne) UpdateUrgency

func (u *NotifyRuleUpsertOne) UpdateUrgency() *NotifyRuleUpsertOne

UpdateUrgency sets the "urgency" field to the value that was provided on create.

type NotifyRules

type NotifyRules []*NotifyRule

NotifyRules is a parsable slice of NotifyRule.

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 PendingOp

type PendingOp struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ProviderThreadIds holds the value of the "provider_thread_ids" field.
	ProviderThreadIds []string `json:"provider_thread_ids,omitempty"`
	// OpType holds the value of the "op_type" field.
	OpType pendingop.OpType `json:"op_type,omitempty"`
	// Payload holds the value of the "payload" field.
	Payload map[string]interface{} `json:"payload,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Attempts holds the value of the "attempts" field.
	Attempts int `json:"attempts,omitempty"`
	// NextAttemptAt holds the value of the "next_attempt_at" field.
	NextAttemptAt *time.Time `json:"next_attempt_at,omitempty"`
	// LastError holds the value of the "last_error" field.
	LastError string `json:"last_error,omitempty"`
	// State holds the value of the "state" field.
	State pendingop.State `json:"state,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PendingOpQuery when eager-loading is set.
	Edges PendingOpEdges `json:"edges"`
	// contains filtered or unexported fields
}

PendingOp is the model entity for the PendingOp schema.

func (*PendingOp) ExecContext

func (c *PendingOp) 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 (*PendingOp) QueryAccount

func (_m *PendingOp) QueryAccount() *AccountQuery

QueryAccount queries the "account" edge of the PendingOp entity.

func (*PendingOp) QueryContext

func (c *PendingOp) 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 (*PendingOp) String

func (_m *PendingOp) String() string

String implements the fmt.Stringer.

func (*PendingOp) Unwrap

func (_m *PendingOp) Unwrap() *PendingOp

Unwrap unwraps the PendingOp 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 (*PendingOp) Update

func (_m *PendingOp) Update() *PendingOpUpdateOne

Update returns a builder for updating this PendingOp. Note that you need to call PendingOp.Unwrap() before calling this method if this PendingOp was returned from a transaction, and the transaction was committed or rolled back.

func (*PendingOp) Value

func (_m *PendingOp) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PendingOp. This includes values selected through modifiers, order, etc.

type PendingOpClient

type PendingOpClient struct {
	// contains filtered or unexported fields
}

PendingOpClient is a client for the PendingOp schema.

func NewPendingOpClient

func NewPendingOpClient(c config) *PendingOpClient

NewPendingOpClient returns a client for the PendingOp from the given config.

func (*PendingOpClient) Create

func (c *PendingOpClient) Create() *PendingOpCreate

Create returns a builder for creating a PendingOp entity.

func (*PendingOpClient) CreateBulk

func (c *PendingOpClient) CreateBulk(builders ...*PendingOpCreate) *PendingOpCreateBulk

CreateBulk returns a builder for creating a bulk of PendingOp entities.

func (*PendingOpClient) Delete

func (c *PendingOpClient) Delete() *PendingOpDelete

Delete returns a delete builder for PendingOp.

func (*PendingOpClient) DeleteOne

func (c *PendingOpClient) DeleteOne(_m *PendingOp) *PendingOpDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PendingOpClient) DeleteOneID

func (c *PendingOpClient) DeleteOneID(id int) *PendingOpDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PendingOpClient) ExecContext

func (c *PendingOpClient) 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 (*PendingOpClient) Get

func (c *PendingOpClient) Get(ctx context.Context, id int) (*PendingOp, error)

Get returns a PendingOp entity by its id.

func (*PendingOpClient) GetX

func (c *PendingOpClient) GetX(ctx context.Context, id int) *PendingOp

GetX is like Get, but panics if an error occurs.

func (*PendingOpClient) Hooks

func (c *PendingOpClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PendingOpClient) Intercept

func (c *PendingOpClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pendingop.Intercept(f(g(h())))`.

func (*PendingOpClient) Interceptors

func (c *PendingOpClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PendingOpClient) MapCreateBulk

func (c *PendingOpClient) MapCreateBulk(slice any, setFunc func(*PendingOpCreate, int)) *PendingOpCreateBulk

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 (*PendingOpClient) Query

func (c *PendingOpClient) Query() *PendingOpQuery

Query returns a query builder for PendingOp.

func (*PendingOpClient) QueryAccount

func (c *PendingOpClient) QueryAccount(_m *PendingOp) *AccountQuery

QueryAccount queries the account edge of a PendingOp.

func (*PendingOpClient) QueryContext

func (c *PendingOpClient) 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 (*PendingOpClient) Update

func (c *PendingOpClient) Update() *PendingOpUpdate

Update returns an update builder for PendingOp.

func (*PendingOpClient) UpdateOne

func (c *PendingOpClient) UpdateOne(_m *PendingOp) *PendingOpUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PendingOpClient) UpdateOneID

func (c *PendingOpClient) UpdateOneID(id int) *PendingOpUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PendingOpClient) Use

func (c *PendingOpClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `pendingop.Hooks(f(g(h())))`.

type PendingOpCreate

type PendingOpCreate struct {
	// contains filtered or unexported fields
}

PendingOpCreate is the builder for creating a PendingOp entity.

func (*PendingOpCreate) Exec

func (_c *PendingOpCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PendingOpCreate) ExecContext

func (c *PendingOpCreate) 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 (*PendingOpCreate) ExecX

func (_c *PendingOpCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpCreate) Mutation

func (_c *PendingOpCreate) Mutation() *PendingOpMutation

Mutation returns the PendingOpMutation object of the builder.

func (*PendingOpCreate) OnConflict

func (_c *PendingOpCreate) OnConflict(opts ...sql.ConflictOption) *PendingOpUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.PendingOp.Create().
	SetProviderThreadIds(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.PendingOpUpsert) {
		SetProviderThreadIds(v+v).
	}).
	Exec(ctx)

func (*PendingOpCreate) OnConflictColumns

func (_c *PendingOpCreate) OnConflictColumns(columns ...string) *PendingOpUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.PendingOp.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PendingOpCreate) QueryContext

func (c *PendingOpCreate) 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 (*PendingOpCreate) Save

func (_c *PendingOpCreate) Save(ctx context.Context) (*PendingOp, error)

Save creates the PendingOp in the database.

func (*PendingOpCreate) SaveX

func (_c *PendingOpCreate) SaveX(ctx context.Context) *PendingOp

SaveX calls Save and panics if Save returns an error.

func (*PendingOpCreate) SetAccount

func (_c *PendingOpCreate) SetAccount(v *Account) *PendingOpCreate

SetAccount sets the "account" edge to the Account entity.

func (*PendingOpCreate) SetAccountID

func (_c *PendingOpCreate) SetAccountID(id uuid.UUID) *PendingOpCreate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*PendingOpCreate) SetAttempts

func (_c *PendingOpCreate) SetAttempts(v int) *PendingOpCreate

SetAttempts sets the "attempts" field.

func (*PendingOpCreate) SetCreatedAt

func (_c *PendingOpCreate) SetCreatedAt(v time.Time) *PendingOpCreate

SetCreatedAt sets the "created_at" field.

func (*PendingOpCreate) SetLastError

func (_c *PendingOpCreate) SetLastError(v string) *PendingOpCreate

SetLastError sets the "last_error" field.

func (*PendingOpCreate) SetNextAttemptAt

func (_c *PendingOpCreate) SetNextAttemptAt(v time.Time) *PendingOpCreate

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpCreate) SetNillableAttempts

func (_c *PendingOpCreate) SetNillableAttempts(v *int) *PendingOpCreate

SetNillableAttempts sets the "attempts" field if the given value is not nil.

func (*PendingOpCreate) SetNillableCreatedAt

func (_c *PendingOpCreate) SetNillableCreatedAt(v *time.Time) *PendingOpCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PendingOpCreate) SetNillableLastError

func (_c *PendingOpCreate) SetNillableLastError(v *string) *PendingOpCreate

SetNillableLastError sets the "last_error" field if the given value is not nil.

func (*PendingOpCreate) SetNillableNextAttemptAt

func (_c *PendingOpCreate) SetNillableNextAttemptAt(v *time.Time) *PendingOpCreate

SetNillableNextAttemptAt sets the "next_attempt_at" field if the given value is not nil.

func (*PendingOpCreate) SetNillableState

func (_c *PendingOpCreate) SetNillableState(v *pendingop.State) *PendingOpCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*PendingOpCreate) SetOpType

func (_c *PendingOpCreate) SetOpType(v pendingop.OpType) *PendingOpCreate

SetOpType sets the "op_type" field.

func (*PendingOpCreate) SetPayload

func (_c *PendingOpCreate) SetPayload(v map[string]interface{}) *PendingOpCreate

SetPayload sets the "payload" field.

func (*PendingOpCreate) SetProviderThreadIds

func (_c *PendingOpCreate) SetProviderThreadIds(v []string) *PendingOpCreate

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpCreate) SetState

SetState sets the "state" field.

type PendingOpCreateBulk

type PendingOpCreateBulk struct {
	// contains filtered or unexported fields
}

PendingOpCreateBulk is the builder for creating many PendingOp entities in bulk.

func (*PendingOpCreateBulk) Exec

func (_c *PendingOpCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PendingOpCreateBulk) ExecContext

func (c *PendingOpCreateBulk) 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 (*PendingOpCreateBulk) ExecX

func (_c *PendingOpCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpCreateBulk) OnConflict

func (_c *PendingOpCreateBulk) OnConflict(opts ...sql.ConflictOption) *PendingOpUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.PendingOp.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.PendingOpUpsert) {
		SetProviderThreadIds(v+v).
	}).
	Exec(ctx)

func (*PendingOpCreateBulk) OnConflictColumns

func (_c *PendingOpCreateBulk) OnConflictColumns(columns ...string) *PendingOpUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.PendingOp.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PendingOpCreateBulk) QueryContext

func (c *PendingOpCreateBulk) 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 (*PendingOpCreateBulk) Save

func (_c *PendingOpCreateBulk) Save(ctx context.Context) ([]*PendingOp, error)

Save creates the PendingOp entities in the database.

func (*PendingOpCreateBulk) SaveX

func (_c *PendingOpCreateBulk) SaveX(ctx context.Context) []*PendingOp

SaveX is like Save, but panics if an error occurs.

type PendingOpDelete

type PendingOpDelete struct {
	// contains filtered or unexported fields
}

PendingOpDelete is the builder for deleting a PendingOp entity.

func (*PendingOpDelete) Exec

func (_d *PendingOpDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PendingOpDelete) ExecContext

func (c *PendingOpDelete) 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 (*PendingOpDelete) ExecX

func (_d *PendingOpDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpDelete) QueryContext

func (c *PendingOpDelete) 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 (*PendingOpDelete) Where

Where appends a list predicates to the PendingOpDelete builder.

type PendingOpDeleteOne

type PendingOpDeleteOne struct {
	// contains filtered or unexported fields
}

PendingOpDeleteOne is the builder for deleting a single PendingOp entity.

func (*PendingOpDeleteOne) Exec

func (_d *PendingOpDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PendingOpDeleteOne) ExecX

func (_d *PendingOpDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpDeleteOne) Where

Where appends a list predicates to the PendingOpDelete builder.

type PendingOpEdges

type PendingOpEdges struct {
	// Account holds the value of the account edge.
	Account *Account `json:"account,omitempty"`
	// contains filtered or unexported fields
}

PendingOpEdges holds the relations/edges for other nodes in the graph.

func (PendingOpEdges) AccountOrErr

func (e PendingOpEdges) AccountOrErr() (*Account, error)

AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PendingOpGroupBy

type PendingOpGroupBy struct {
	// contains filtered or unexported fields
}

PendingOpGroupBy is the group-by builder for PendingOp entities.

func (*PendingOpGroupBy) Aggregate

func (_g *PendingOpGroupBy) Aggregate(fns ...AggregateFunc) *PendingOpGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PendingOpGroupBy) Bool

func (s *PendingOpGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) BoolX

func (s *PendingOpGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PendingOpGroupBy) Bools

func (s *PendingOpGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) BoolsX

func (s *PendingOpGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PendingOpGroupBy) Float64

func (s *PendingOpGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) Float64X

func (s *PendingOpGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PendingOpGroupBy) Float64s

func (s *PendingOpGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) Float64sX

func (s *PendingOpGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PendingOpGroupBy) Int

func (s *PendingOpGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) IntX

func (s *PendingOpGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PendingOpGroupBy) Ints

func (s *PendingOpGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) IntsX

func (s *PendingOpGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PendingOpGroupBy) Scan

func (_g *PendingOpGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PendingOpGroupBy) ScanX

func (s *PendingOpGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PendingOpGroupBy) String

func (s *PendingOpGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) StringX

func (s *PendingOpGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PendingOpGroupBy) Strings

func (s *PendingOpGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PendingOpGroupBy) StringsX

func (s *PendingOpGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PendingOpMutation

type PendingOpMutation struct {
	// contains filtered or unexported fields
}

PendingOpMutation represents an operation that mutates the PendingOp nodes in the graph.

func (*PendingOpMutation) AccountCleared

func (m *PendingOpMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Account entity was cleared.

func (*PendingOpMutation) AccountID

func (m *PendingOpMutation) AccountID() (id uuid.UUID, exists bool)

AccountID returns the "account" edge ID in the mutation.

func (*PendingOpMutation) AccountIDs

func (m *PendingOpMutation) AccountIDs() (ids []uuid.UUID)

AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.

func (*PendingOpMutation) AddAttempts

func (m *PendingOpMutation) AddAttempts(i int)

AddAttempts adds i to the "attempts" field.

func (*PendingOpMutation) AddField

func (m *PendingOpMutation) 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 (*PendingOpMutation) AddedAttempts

func (m *PendingOpMutation) AddedAttempts() (r int, exists bool)

AddedAttempts returns the value that was added to the "attempts" field in this mutation.

func (*PendingOpMutation) AddedEdges

func (m *PendingOpMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PendingOpMutation) AddedField

func (m *PendingOpMutation) 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 (*PendingOpMutation) AddedFields

func (m *PendingOpMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PendingOpMutation) AddedIDs

func (m *PendingOpMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PendingOpMutation) AppendProviderThreadIds

func (m *PendingOpMutation) AppendProviderThreadIds(s []string)

AppendProviderThreadIds adds s to the "provider_thread_ids" field.

func (*PendingOpMutation) AppendedProviderThreadIds

func (m *PendingOpMutation) AppendedProviderThreadIds() ([]string, bool)

AppendedProviderThreadIds returns the list of values that were appended to the "provider_thread_ids" field in this mutation.

func (*PendingOpMutation) Attempts

func (m *PendingOpMutation) Attempts() (r int, exists bool)

Attempts returns the value of the "attempts" field in the mutation.

func (*PendingOpMutation) ClearAccount

func (m *PendingOpMutation) ClearAccount()

ClearAccount clears the "account" edge to the Account entity.

func (*PendingOpMutation) ClearEdge

func (m *PendingOpMutation) 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 (*PendingOpMutation) ClearField

func (m *PendingOpMutation) 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 (*PendingOpMutation) ClearNextAttemptAt

func (m *PendingOpMutation) ClearNextAttemptAt()

ClearNextAttemptAt clears the value of the "next_attempt_at" field.

func (*PendingOpMutation) ClearedEdges

func (m *PendingOpMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PendingOpMutation) ClearedFields

func (m *PendingOpMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PendingOpMutation) Client

func (m PendingOpMutation) 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 (*PendingOpMutation) CreatedAt

func (m *PendingOpMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PendingOpMutation) EdgeCleared

func (m *PendingOpMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PendingOpMutation) ExecContext

func (c *PendingOpMutation) 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 (*PendingOpMutation) Field

func (m *PendingOpMutation) 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 (*PendingOpMutation) FieldCleared

func (m *PendingOpMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PendingOpMutation) Fields

func (m *PendingOpMutation) 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 (*PendingOpMutation) ID

func (m *PendingOpMutation) 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 (*PendingOpMutation) IDs

func (m *PendingOpMutation) 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 (*PendingOpMutation) LastError

func (m *PendingOpMutation) LastError() (r string, exists bool)

LastError returns the value of the "last_error" field in the mutation.

func (*PendingOpMutation) NextAttemptAt

func (m *PendingOpMutation) NextAttemptAt() (r time.Time, exists bool)

NextAttemptAt returns the value of the "next_attempt_at" field in the mutation.

func (*PendingOpMutation) NextAttemptAtCleared

func (m *PendingOpMutation) NextAttemptAtCleared() bool

NextAttemptAtCleared returns if the "next_attempt_at" field was cleared in this mutation.

func (*PendingOpMutation) OldAttempts

func (m *PendingOpMutation) OldAttempts(ctx context.Context) (v int, err error)

OldAttempts returns the old "attempts" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldCreatedAt

func (m *PendingOpMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldField

func (m *PendingOpMutation) 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 (*PendingOpMutation) OldLastError

func (m *PendingOpMutation) OldLastError(ctx context.Context) (v string, err error)

OldLastError returns the old "last_error" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldNextAttemptAt

func (m *PendingOpMutation) OldNextAttemptAt(ctx context.Context) (v *time.Time, err error)

OldNextAttemptAt returns the old "next_attempt_at" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldOpType

func (m *PendingOpMutation) OldOpType(ctx context.Context) (v pendingop.OpType, err error)

OldOpType returns the old "op_type" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldPayload

func (m *PendingOpMutation) OldPayload(ctx context.Context) (v map[string]interface{}, err error)

OldPayload returns the old "payload" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldProviderThreadIds

func (m *PendingOpMutation) OldProviderThreadIds(ctx context.Context) (v []string, err error)

OldProviderThreadIds returns the old "provider_thread_ids" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) OldState

func (m *PendingOpMutation) OldState(ctx context.Context) (v pendingop.State, err error)

OldState returns the old "state" field's value of the PendingOp entity. If the PendingOp 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 (*PendingOpMutation) Op

func (m *PendingOpMutation) Op() Op

Op returns the operation name.

func (*PendingOpMutation) OpType

func (m *PendingOpMutation) OpType() (r pendingop.OpType, exists bool)

OpType returns the value of the "op_type" field in the mutation.

func (*PendingOpMutation) Payload

func (m *PendingOpMutation) Payload() (r map[string]interface{}, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*PendingOpMutation) ProviderThreadIds

func (m *PendingOpMutation) ProviderThreadIds() (r []string, exists bool)

ProviderThreadIds returns the value of the "provider_thread_ids" field in the mutation.

func (*PendingOpMutation) QueryContext

func (c *PendingOpMutation) 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 (*PendingOpMutation) RemovedEdges

func (m *PendingOpMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PendingOpMutation) RemovedIDs

func (m *PendingOpMutation) 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 (*PendingOpMutation) ResetAccount

func (m *PendingOpMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*PendingOpMutation) ResetAttempts

func (m *PendingOpMutation) ResetAttempts()

ResetAttempts resets all changes to the "attempts" field.

func (*PendingOpMutation) ResetCreatedAt

func (m *PendingOpMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PendingOpMutation) ResetEdge

func (m *PendingOpMutation) 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 (*PendingOpMutation) ResetField

func (m *PendingOpMutation) 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 (*PendingOpMutation) ResetLastError

func (m *PendingOpMutation) ResetLastError()

ResetLastError resets all changes to the "last_error" field.

func (*PendingOpMutation) ResetNextAttemptAt

func (m *PendingOpMutation) ResetNextAttemptAt()

ResetNextAttemptAt resets all changes to the "next_attempt_at" field.

func (*PendingOpMutation) ResetOpType

func (m *PendingOpMutation) ResetOpType()

ResetOpType resets all changes to the "op_type" field.

func (*PendingOpMutation) ResetPayload

func (m *PendingOpMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*PendingOpMutation) ResetProviderThreadIds

func (m *PendingOpMutation) ResetProviderThreadIds()

ResetProviderThreadIds resets all changes to the "provider_thread_ids" field.

func (*PendingOpMutation) ResetState

func (m *PendingOpMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*PendingOpMutation) SetAccountID

func (m *PendingOpMutation) SetAccountID(id uuid.UUID)

SetAccountID sets the "account" edge to the Account entity by id.

func (*PendingOpMutation) SetAttempts

func (m *PendingOpMutation) SetAttempts(i int)

SetAttempts sets the "attempts" field.

func (*PendingOpMutation) SetCreatedAt

func (m *PendingOpMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PendingOpMutation) SetField

func (m *PendingOpMutation) 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 (*PendingOpMutation) SetLastError

func (m *PendingOpMutation) SetLastError(s string)

SetLastError sets the "last_error" field.

func (*PendingOpMutation) SetNextAttemptAt

func (m *PendingOpMutation) SetNextAttemptAt(t time.Time)

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpMutation) SetOp

func (m *PendingOpMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PendingOpMutation) SetOpType

func (m *PendingOpMutation) SetOpType(pt pendingop.OpType)

SetOpType sets the "op_type" field.

func (*PendingOpMutation) SetPayload

func (m *PendingOpMutation) SetPayload(value map[string]interface{})

SetPayload sets the "payload" field.

func (*PendingOpMutation) SetProviderThreadIds

func (m *PendingOpMutation) SetProviderThreadIds(s []string)

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpMutation) SetState

func (m *PendingOpMutation) SetState(pe pendingop.State)

SetState sets the "state" field.

func (*PendingOpMutation) State

func (m *PendingOpMutation) State() (r pendingop.State, exists bool)

State returns the value of the "state" field in the mutation.

func (PendingOpMutation) Tx

func (m PendingOpMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PendingOpMutation) Type

func (m *PendingOpMutation) Type() string

Type returns the node type of this mutation (PendingOp).

func (*PendingOpMutation) Where

func (m *PendingOpMutation) Where(ps ...predicate.PendingOp)

Where appends a list predicates to the PendingOpMutation builder.

func (*PendingOpMutation) WhereP

func (m *PendingOpMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PendingOpMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PendingOpQuery

type PendingOpQuery struct {
	// contains filtered or unexported fields
}

PendingOpQuery is the builder for querying PendingOp entities.

func (*PendingOpQuery) Aggregate

func (_q *PendingOpQuery) Aggregate(fns ...AggregateFunc) *PendingOpSelect

Aggregate returns a PendingOpSelect configured with the given aggregations.

func (*PendingOpQuery) All

func (_q *PendingOpQuery) All(ctx context.Context) ([]*PendingOp, error)

All executes the query and returns a list of PendingOps.

func (*PendingOpQuery) AllX

func (_q *PendingOpQuery) AllX(ctx context.Context) []*PendingOp

AllX is like All, but panics if an error occurs.

func (*PendingOpQuery) Clone

func (_q *PendingOpQuery) Clone() *PendingOpQuery

Clone returns a duplicate of the PendingOpQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PendingOpQuery) Count

func (_q *PendingOpQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PendingOpQuery) CountX

func (_q *PendingOpQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PendingOpQuery) ExecContext

func (c *PendingOpQuery) 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 (*PendingOpQuery) Exist

func (_q *PendingOpQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PendingOpQuery) ExistX

func (_q *PendingOpQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PendingOpQuery) First

func (_q *PendingOpQuery) First(ctx context.Context) (*PendingOp, error)

First returns the first PendingOp entity from the query. Returns a *NotFoundError when no PendingOp was found.

func (*PendingOpQuery) FirstID

func (_q *PendingOpQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PendingOp ID from the query. Returns a *NotFoundError when no PendingOp ID was found.

func (*PendingOpQuery) FirstIDX

func (_q *PendingOpQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PendingOpQuery) FirstX

func (_q *PendingOpQuery) FirstX(ctx context.Context) *PendingOp

FirstX is like First, but panics if an error occurs.

func (*PendingOpQuery) GroupBy

func (_q *PendingOpQuery) GroupBy(field string, fields ...string) *PendingOpGroupBy

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 {
	ProviderThreadIds []string `json:"provider_thread_ids,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PendingOp.Query().
	GroupBy(pendingop.FieldProviderThreadIds).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PendingOpQuery) IDs

func (_q *PendingOpQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PendingOp IDs.

func (*PendingOpQuery) IDsX

func (_q *PendingOpQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PendingOpQuery) Limit

func (_q *PendingOpQuery) Limit(limit int) *PendingOpQuery

Limit the number of records to be returned by this query.

func (*PendingOpQuery) Modify

func (_q *PendingOpQuery) Modify(modifiers ...func(s *sql.Selector)) *PendingOpSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*PendingOpQuery) Offset

func (_q *PendingOpQuery) Offset(offset int) *PendingOpQuery

Offset to start from.

func (*PendingOpQuery) Only

func (_q *PendingOpQuery) Only(ctx context.Context) (*PendingOp, error)

Only returns a single PendingOp entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PendingOp entity is found. Returns a *NotFoundError when no PendingOp entities are found.

func (*PendingOpQuery) OnlyID

func (_q *PendingOpQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PendingOp ID in the query. Returns a *NotSingularError when more than one PendingOp ID is found. Returns a *NotFoundError when no entities are found.

func (*PendingOpQuery) OnlyIDX

func (_q *PendingOpQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PendingOpQuery) OnlyX

func (_q *PendingOpQuery) OnlyX(ctx context.Context) *PendingOp

OnlyX is like Only, but panics if an error occurs.

func (*PendingOpQuery) Order

Order specifies how the records should be ordered.

func (*PendingOpQuery) QueryAccount

func (_q *PendingOpQuery) QueryAccount() *AccountQuery

QueryAccount chains the current query on the "account" edge.

func (*PendingOpQuery) QueryContext

func (c *PendingOpQuery) 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 (*PendingOpQuery) Select

func (_q *PendingOpQuery) Select(fields ...string) *PendingOpSelect

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 {
	ProviderThreadIds []string `json:"provider_thread_ids,omitempty"`
}

client.PendingOp.Query().
	Select(pendingop.FieldProviderThreadIds).
	Scan(ctx, &v)

func (*PendingOpQuery) Unique

func (_q *PendingOpQuery) Unique(unique bool) *PendingOpQuery

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 (*PendingOpQuery) Where

Where adds a new predicate for the PendingOpQuery builder.

func (*PendingOpQuery) WithAccount

func (_q *PendingOpQuery) WithAccount(opts ...func(*AccountQuery)) *PendingOpQuery

WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.

type PendingOpSelect

type PendingOpSelect struct {
	*PendingOpQuery
	// contains filtered or unexported fields
}

PendingOpSelect is the builder for selecting fields of PendingOp entities.

func (*PendingOpSelect) Aggregate

func (_s *PendingOpSelect) Aggregate(fns ...AggregateFunc) *PendingOpSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PendingOpSelect) Bool

func (s *PendingOpSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) BoolX

func (s *PendingOpSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PendingOpSelect) Bools

func (s *PendingOpSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) BoolsX

func (s *PendingOpSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (PendingOpSelect) ExecContext

func (c PendingOpSelect) 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 (*PendingOpSelect) Float64

func (s *PendingOpSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) Float64X

func (s *PendingOpSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PendingOpSelect) Float64s

func (s *PendingOpSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) Float64sX

func (s *PendingOpSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PendingOpSelect) Int

func (s *PendingOpSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) IntX

func (s *PendingOpSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PendingOpSelect) Ints

func (s *PendingOpSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) IntsX

func (s *PendingOpSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PendingOpSelect) Modify

func (_s *PendingOpSelect) Modify(modifiers ...func(s *sql.Selector)) *PendingOpSelect

Modify adds a query modifier for attaching custom logic to queries.

func (PendingOpSelect) QueryContext

func (c PendingOpSelect) 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 (*PendingOpSelect) Scan

func (_s *PendingOpSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PendingOpSelect) ScanX

func (s *PendingOpSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PendingOpSelect) String

func (s *PendingOpSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) StringX

func (s *PendingOpSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PendingOpSelect) Strings

func (s *PendingOpSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PendingOpSelect) StringsX

func (s *PendingOpSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PendingOpUpdate

type PendingOpUpdate struct {
	// contains filtered or unexported fields
}

PendingOpUpdate is the builder for updating PendingOp entities.

func (*PendingOpUpdate) AddAttempts

func (_u *PendingOpUpdate) AddAttempts(v int) *PendingOpUpdate

AddAttempts adds value to the "attempts" field.

func (*PendingOpUpdate) AppendProviderThreadIds

func (_u *PendingOpUpdate) AppendProviderThreadIds(v []string) *PendingOpUpdate

AppendProviderThreadIds appends value to the "provider_thread_ids" field.

func (*PendingOpUpdate) ClearAccount

func (_u *PendingOpUpdate) ClearAccount() *PendingOpUpdate

ClearAccount clears the "account" edge to the Account entity.

func (*PendingOpUpdate) ClearNextAttemptAt

func (_u *PendingOpUpdate) ClearNextAttemptAt() *PendingOpUpdate

ClearNextAttemptAt clears the value of the "next_attempt_at" field.

func (*PendingOpUpdate) Exec

func (_u *PendingOpUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PendingOpUpdate) ExecContext

func (c *PendingOpUpdate) 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 (*PendingOpUpdate) ExecX

func (_u *PendingOpUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpUpdate) Modify

func (_u *PendingOpUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PendingOpUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*PendingOpUpdate) Mutation

func (_u *PendingOpUpdate) Mutation() *PendingOpMutation

Mutation returns the PendingOpMutation object of the builder.

func (*PendingOpUpdate) QueryContext

func (c *PendingOpUpdate) 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 (*PendingOpUpdate) Save

func (_u *PendingOpUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PendingOpUpdate) SaveX

func (_u *PendingOpUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PendingOpUpdate) SetAccount

func (_u *PendingOpUpdate) SetAccount(v *Account) *PendingOpUpdate

SetAccount sets the "account" edge to the Account entity.

func (*PendingOpUpdate) SetAccountID

func (_u *PendingOpUpdate) SetAccountID(id uuid.UUID) *PendingOpUpdate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*PendingOpUpdate) SetAttempts

func (_u *PendingOpUpdate) SetAttempts(v int) *PendingOpUpdate

SetAttempts sets the "attempts" field.

func (*PendingOpUpdate) SetLastError

func (_u *PendingOpUpdate) SetLastError(v string) *PendingOpUpdate

SetLastError sets the "last_error" field.

func (*PendingOpUpdate) SetNextAttemptAt

func (_u *PendingOpUpdate) SetNextAttemptAt(v time.Time) *PendingOpUpdate

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpUpdate) SetNillableAttempts

func (_u *PendingOpUpdate) SetNillableAttempts(v *int) *PendingOpUpdate

SetNillableAttempts sets the "attempts" field if the given value is not nil.

func (*PendingOpUpdate) SetNillableLastError

func (_u *PendingOpUpdate) SetNillableLastError(v *string) *PendingOpUpdate

SetNillableLastError sets the "last_error" field if the given value is not nil.

func (*PendingOpUpdate) SetNillableNextAttemptAt

func (_u *PendingOpUpdate) SetNillableNextAttemptAt(v *time.Time) *PendingOpUpdate

SetNillableNextAttemptAt sets the "next_attempt_at" field if the given value is not nil.

func (*PendingOpUpdate) SetNillableOpType

func (_u *PendingOpUpdate) SetNillableOpType(v *pendingop.OpType) *PendingOpUpdate

SetNillableOpType sets the "op_type" field if the given value is not nil.

func (*PendingOpUpdate) SetNillableState

func (_u *PendingOpUpdate) SetNillableState(v *pendingop.State) *PendingOpUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*PendingOpUpdate) SetOpType

func (_u *PendingOpUpdate) SetOpType(v pendingop.OpType) *PendingOpUpdate

SetOpType sets the "op_type" field.

func (*PendingOpUpdate) SetPayload

func (_u *PendingOpUpdate) SetPayload(v map[string]interface{}) *PendingOpUpdate

SetPayload sets the "payload" field.

func (*PendingOpUpdate) SetProviderThreadIds

func (_u *PendingOpUpdate) SetProviderThreadIds(v []string) *PendingOpUpdate

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpUpdate) SetState

SetState sets the "state" field.

func (*PendingOpUpdate) Where

Where appends a list predicates to the PendingOpUpdate builder.

type PendingOpUpdateOne

type PendingOpUpdateOne struct {
	// contains filtered or unexported fields
}

PendingOpUpdateOne is the builder for updating a single PendingOp entity.

func (*PendingOpUpdateOne) AddAttempts

func (_u *PendingOpUpdateOne) AddAttempts(v int) *PendingOpUpdateOne

AddAttempts adds value to the "attempts" field.

func (*PendingOpUpdateOne) AppendProviderThreadIds

func (_u *PendingOpUpdateOne) AppendProviderThreadIds(v []string) *PendingOpUpdateOne

AppendProviderThreadIds appends value to the "provider_thread_ids" field.

func (*PendingOpUpdateOne) ClearAccount

func (_u *PendingOpUpdateOne) ClearAccount() *PendingOpUpdateOne

ClearAccount clears the "account" edge to the Account entity.

func (*PendingOpUpdateOne) ClearNextAttemptAt

func (_u *PendingOpUpdateOne) ClearNextAttemptAt() *PendingOpUpdateOne

ClearNextAttemptAt clears the value of the "next_attempt_at" field.

func (*PendingOpUpdateOne) Exec

func (_u *PendingOpUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PendingOpUpdateOne) ExecContext

func (c *PendingOpUpdateOne) 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 (*PendingOpUpdateOne) ExecX

func (_u *PendingOpUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpUpdateOne) Modify

func (_u *PendingOpUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PendingOpUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*PendingOpUpdateOne) Mutation

func (_u *PendingOpUpdateOne) Mutation() *PendingOpMutation

Mutation returns the PendingOpMutation object of the builder.

func (*PendingOpUpdateOne) QueryContext

func (c *PendingOpUpdateOne) 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 (*PendingOpUpdateOne) Save

func (_u *PendingOpUpdateOne) Save(ctx context.Context) (*PendingOp, error)

Save executes the query and returns the updated PendingOp entity.

func (*PendingOpUpdateOne) SaveX

func (_u *PendingOpUpdateOne) SaveX(ctx context.Context) *PendingOp

SaveX is like Save, but panics if an error occurs.

func (*PendingOpUpdateOne) Select

func (_u *PendingOpUpdateOne) Select(field string, fields ...string) *PendingOpUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PendingOpUpdateOne) SetAccount

func (_u *PendingOpUpdateOne) SetAccount(v *Account) *PendingOpUpdateOne

SetAccount sets the "account" edge to the Account entity.

func (*PendingOpUpdateOne) SetAccountID

func (_u *PendingOpUpdateOne) SetAccountID(id uuid.UUID) *PendingOpUpdateOne

SetAccountID sets the "account" edge to the Account entity by ID.

func (*PendingOpUpdateOne) SetAttempts

func (_u *PendingOpUpdateOne) SetAttempts(v int) *PendingOpUpdateOne

SetAttempts sets the "attempts" field.

func (*PendingOpUpdateOne) SetLastError

func (_u *PendingOpUpdateOne) SetLastError(v string) *PendingOpUpdateOne

SetLastError sets the "last_error" field.

func (*PendingOpUpdateOne) SetNextAttemptAt

func (_u *PendingOpUpdateOne) SetNextAttemptAt(v time.Time) *PendingOpUpdateOne

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpUpdateOne) SetNillableAttempts

func (_u *PendingOpUpdateOne) SetNillableAttempts(v *int) *PendingOpUpdateOne

SetNillableAttempts sets the "attempts" field if the given value is not nil.

func (*PendingOpUpdateOne) SetNillableLastError

func (_u *PendingOpUpdateOne) SetNillableLastError(v *string) *PendingOpUpdateOne

SetNillableLastError sets the "last_error" field if the given value is not nil.

func (*PendingOpUpdateOne) SetNillableNextAttemptAt

func (_u *PendingOpUpdateOne) SetNillableNextAttemptAt(v *time.Time) *PendingOpUpdateOne

SetNillableNextAttemptAt sets the "next_attempt_at" field if the given value is not nil.

func (*PendingOpUpdateOne) SetNillableOpType

func (_u *PendingOpUpdateOne) SetNillableOpType(v *pendingop.OpType) *PendingOpUpdateOne

SetNillableOpType sets the "op_type" field if the given value is not nil.

func (*PendingOpUpdateOne) SetNillableState

func (_u *PendingOpUpdateOne) SetNillableState(v *pendingop.State) *PendingOpUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*PendingOpUpdateOne) SetOpType

SetOpType sets the "op_type" field.

func (*PendingOpUpdateOne) SetPayload

func (_u *PendingOpUpdateOne) SetPayload(v map[string]interface{}) *PendingOpUpdateOne

SetPayload sets the "payload" field.

func (*PendingOpUpdateOne) SetProviderThreadIds

func (_u *PendingOpUpdateOne) SetProviderThreadIds(v []string) *PendingOpUpdateOne

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpUpdateOne) SetState

SetState sets the "state" field.

func (*PendingOpUpdateOne) Where

Where appends a list predicates to the PendingOpUpdate builder.

type PendingOpUpsert

type PendingOpUpsert struct {
	*sql.UpdateSet
}

PendingOpUpsert is the "OnConflict" setter.

func (*PendingOpUpsert) AddAttempts

func (u *PendingOpUpsert) AddAttempts(v int) *PendingOpUpsert

AddAttempts adds v to the "attempts" field.

func (*PendingOpUpsert) ClearNextAttemptAt

func (u *PendingOpUpsert) ClearNextAttemptAt() *PendingOpUpsert

ClearNextAttemptAt clears the value of the "next_attempt_at" field.

func (*PendingOpUpsert) SetAttempts

func (u *PendingOpUpsert) SetAttempts(v int) *PendingOpUpsert

SetAttempts sets the "attempts" field.

func (*PendingOpUpsert) SetLastError

func (u *PendingOpUpsert) SetLastError(v string) *PendingOpUpsert

SetLastError sets the "last_error" field.

func (*PendingOpUpsert) SetNextAttemptAt

func (u *PendingOpUpsert) SetNextAttemptAt(v time.Time) *PendingOpUpsert

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpUpsert) SetOpType

SetOpType sets the "op_type" field.

func (*PendingOpUpsert) SetPayload

func (u *PendingOpUpsert) SetPayload(v map[string]interface{}) *PendingOpUpsert

SetPayload sets the "payload" field.

func (*PendingOpUpsert) SetProviderThreadIds

func (u *PendingOpUpsert) SetProviderThreadIds(v []string) *PendingOpUpsert

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpUpsert) SetState

SetState sets the "state" field.

func (*PendingOpUpsert) UpdateAttempts

func (u *PendingOpUpsert) UpdateAttempts() *PendingOpUpsert

UpdateAttempts sets the "attempts" field to the value that was provided on create.

func (*PendingOpUpsert) UpdateLastError

func (u *PendingOpUpsert) UpdateLastError() *PendingOpUpsert

UpdateLastError sets the "last_error" field to the value that was provided on create.

func (*PendingOpUpsert) UpdateNextAttemptAt

func (u *PendingOpUpsert) UpdateNextAttemptAt() *PendingOpUpsert

UpdateNextAttemptAt sets the "next_attempt_at" field to the value that was provided on create.

func (*PendingOpUpsert) UpdateOpType

func (u *PendingOpUpsert) UpdateOpType() *PendingOpUpsert

UpdateOpType sets the "op_type" field to the value that was provided on create.

func (*PendingOpUpsert) UpdatePayload

func (u *PendingOpUpsert) UpdatePayload() *PendingOpUpsert

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*PendingOpUpsert) UpdateProviderThreadIds

func (u *PendingOpUpsert) UpdateProviderThreadIds() *PendingOpUpsert

UpdateProviderThreadIds sets the "provider_thread_ids" field to the value that was provided on create.

func (*PendingOpUpsert) UpdateState

func (u *PendingOpUpsert) UpdateState() *PendingOpUpsert

UpdateState sets the "state" field to the value that was provided on create.

type PendingOpUpsertBulk

type PendingOpUpsertBulk struct {
	// contains filtered or unexported fields
}

PendingOpUpsertBulk is the builder for "upsert"-ing a bulk of PendingOp nodes.

func (*PendingOpUpsertBulk) AddAttempts

func (u *PendingOpUpsertBulk) AddAttempts(v int) *PendingOpUpsertBulk

AddAttempts adds v to the "attempts" field.

func (*PendingOpUpsertBulk) ClearNextAttemptAt

func (u *PendingOpUpsertBulk) ClearNextAttemptAt() *PendingOpUpsertBulk

ClearNextAttemptAt clears the value of the "next_attempt_at" field.

func (*PendingOpUpsertBulk) DoNothing

func (u *PendingOpUpsertBulk) DoNothing() *PendingOpUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PendingOpUpsertBulk) Exec

Exec executes the query.

func (*PendingOpUpsertBulk) ExecX

func (u *PendingOpUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.PendingOp.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PendingOpUpsertBulk) SetAttempts

func (u *PendingOpUpsertBulk) SetAttempts(v int) *PendingOpUpsertBulk

SetAttempts sets the "attempts" field.

func (*PendingOpUpsertBulk) SetLastError

func (u *PendingOpUpsertBulk) SetLastError(v string) *PendingOpUpsertBulk

SetLastError sets the "last_error" field.

func (*PendingOpUpsertBulk) SetNextAttemptAt

func (u *PendingOpUpsertBulk) SetNextAttemptAt(v time.Time) *PendingOpUpsertBulk

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpUpsertBulk) SetOpType

SetOpType sets the "op_type" field.

func (*PendingOpUpsertBulk) SetPayload

func (u *PendingOpUpsertBulk) SetPayload(v map[string]interface{}) *PendingOpUpsertBulk

SetPayload sets the "payload" field.

func (*PendingOpUpsertBulk) SetProviderThreadIds

func (u *PendingOpUpsertBulk) SetProviderThreadIds(v []string) *PendingOpUpsertBulk

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpUpsertBulk) SetState

SetState sets the "state" field.

func (*PendingOpUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the PendingOpCreateBulk.OnConflict documentation for more info.

func (*PendingOpUpsertBulk) UpdateAttempts

func (u *PendingOpUpsertBulk) UpdateAttempts() *PendingOpUpsertBulk

UpdateAttempts sets the "attempts" field to the value that was provided on create.

func (*PendingOpUpsertBulk) UpdateLastError

func (u *PendingOpUpsertBulk) UpdateLastError() *PendingOpUpsertBulk

UpdateLastError sets the "last_error" field to the value that was provided on create.

func (*PendingOpUpsertBulk) UpdateNewValues

func (u *PendingOpUpsertBulk) UpdateNewValues() *PendingOpUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.PendingOp.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PendingOpUpsertBulk) UpdateNextAttemptAt

func (u *PendingOpUpsertBulk) UpdateNextAttemptAt() *PendingOpUpsertBulk

UpdateNextAttemptAt sets the "next_attempt_at" field to the value that was provided on create.

func (*PendingOpUpsertBulk) UpdateOpType

func (u *PendingOpUpsertBulk) UpdateOpType() *PendingOpUpsertBulk

UpdateOpType sets the "op_type" field to the value that was provided on create.

func (*PendingOpUpsertBulk) UpdatePayload

func (u *PendingOpUpsertBulk) UpdatePayload() *PendingOpUpsertBulk

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*PendingOpUpsertBulk) UpdateProviderThreadIds

func (u *PendingOpUpsertBulk) UpdateProviderThreadIds() *PendingOpUpsertBulk

UpdateProviderThreadIds sets the "provider_thread_ids" field to the value that was provided on create.

func (*PendingOpUpsertBulk) UpdateState

func (u *PendingOpUpsertBulk) UpdateState() *PendingOpUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

type PendingOpUpsertOne

type PendingOpUpsertOne struct {
	// contains filtered or unexported fields
}

PendingOpUpsertOne is the builder for "upsert"-ing

one PendingOp node.

func (*PendingOpUpsertOne) AddAttempts

func (u *PendingOpUpsertOne) AddAttempts(v int) *PendingOpUpsertOne

AddAttempts adds v to the "attempts" field.

func (*PendingOpUpsertOne) ClearNextAttemptAt

func (u *PendingOpUpsertOne) ClearNextAttemptAt() *PendingOpUpsertOne

ClearNextAttemptAt clears the value of the "next_attempt_at" field.

func (*PendingOpUpsertOne) DoNothing

func (u *PendingOpUpsertOne) DoNothing() *PendingOpUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PendingOpUpsertOne) Exec

func (u *PendingOpUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PendingOpUpsertOne) ExecX

func (u *PendingOpUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PendingOpUpsertOne) ID

func (u *PendingOpUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PendingOpUpsertOne) IDX

func (u *PendingOpUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*PendingOpUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.PendingOp.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PendingOpUpsertOne) SetAttempts

func (u *PendingOpUpsertOne) SetAttempts(v int) *PendingOpUpsertOne

SetAttempts sets the "attempts" field.

func (*PendingOpUpsertOne) SetLastError

func (u *PendingOpUpsertOne) SetLastError(v string) *PendingOpUpsertOne

SetLastError sets the "last_error" field.

func (*PendingOpUpsertOne) SetNextAttemptAt

func (u *PendingOpUpsertOne) SetNextAttemptAt(v time.Time) *PendingOpUpsertOne

SetNextAttemptAt sets the "next_attempt_at" field.

func (*PendingOpUpsertOne) SetOpType

SetOpType sets the "op_type" field.

func (*PendingOpUpsertOne) SetPayload

func (u *PendingOpUpsertOne) SetPayload(v map[string]interface{}) *PendingOpUpsertOne

SetPayload sets the "payload" field.

func (*PendingOpUpsertOne) SetProviderThreadIds

func (u *PendingOpUpsertOne) SetProviderThreadIds(v []string) *PendingOpUpsertOne

SetProviderThreadIds sets the "provider_thread_ids" field.

func (*PendingOpUpsertOne) SetState

SetState sets the "state" field.

func (*PendingOpUpsertOne) Update

func (u *PendingOpUpsertOne) Update(set func(*PendingOpUpsert)) *PendingOpUpsertOne

Update allows overriding fields `UPDATE` values. See the PendingOpCreate.OnConflict documentation for more info.

func (*PendingOpUpsertOne) UpdateAttempts

func (u *PendingOpUpsertOne) UpdateAttempts() *PendingOpUpsertOne

UpdateAttempts sets the "attempts" field to the value that was provided on create.

func (*PendingOpUpsertOne) UpdateLastError

func (u *PendingOpUpsertOne) UpdateLastError() *PendingOpUpsertOne

UpdateLastError sets the "last_error" field to the value that was provided on create.

func (*PendingOpUpsertOne) UpdateNewValues

func (u *PendingOpUpsertOne) UpdateNewValues() *PendingOpUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.PendingOp.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PendingOpUpsertOne) UpdateNextAttemptAt

func (u *PendingOpUpsertOne) UpdateNextAttemptAt() *PendingOpUpsertOne

UpdateNextAttemptAt sets the "next_attempt_at" field to the value that was provided on create.

func (*PendingOpUpsertOne) UpdateOpType

func (u *PendingOpUpsertOne) UpdateOpType() *PendingOpUpsertOne

UpdateOpType sets the "op_type" field to the value that was provided on create.

func (*PendingOpUpsertOne) UpdatePayload

func (u *PendingOpUpsertOne) UpdatePayload() *PendingOpUpsertOne

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*PendingOpUpsertOne) UpdateProviderThreadIds

func (u *PendingOpUpsertOne) UpdateProviderThreadIds() *PendingOpUpsertOne

UpdateProviderThreadIds sets the "provider_thread_ids" field to the value that was provided on create.

func (*PendingOpUpsertOne) UpdateState

func (u *PendingOpUpsertOne) UpdateState() *PendingOpUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

type PendingOps

type PendingOps []*PendingOp

PendingOps is a parsable slice of PendingOp.

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 Secret

type Secret struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value []byte `json:"-"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SecretQuery when eager-loading is set.
	Edges SecretEdges `json:"edges"`
	// contains filtered or unexported fields
}

Secret is the model entity for the Secret schema.

func (*Secret) ExecContext

func (c *Secret) 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 (*Secret) GetValue

func (_m *Secret) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the Secret. This includes values selected through modifiers, order, etc.

func (*Secret) QueryAccount

func (_m *Secret) QueryAccount() *AccountQuery

QueryAccount queries the "account" edge of the Secret entity.

func (*Secret) QueryContext

func (c *Secret) 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 (*Secret) String

func (_m *Secret) String() string

String implements the fmt.Stringer.

func (*Secret) Unwrap

func (_m *Secret) Unwrap() *Secret

Unwrap unwraps the Secret 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 (*Secret) Update

func (_m *Secret) Update() *SecretUpdateOne

Update returns a builder for updating this Secret. Note that you need to call Secret.Unwrap() before calling this method if this Secret was returned from a transaction, and the transaction was committed or rolled back.

type SecretClient

type SecretClient struct {
	// contains filtered or unexported fields
}

SecretClient is a client for the Secret schema.

func NewSecretClient

func NewSecretClient(c config) *SecretClient

NewSecretClient returns a client for the Secret from the given config.

func (*SecretClient) Create

func (c *SecretClient) Create() *SecretCreate

Create returns a builder for creating a Secret entity.

func (*SecretClient) CreateBulk

func (c *SecretClient) CreateBulk(builders ...*SecretCreate) *SecretCreateBulk

CreateBulk returns a builder for creating a bulk of Secret entities.

func (*SecretClient) Delete

func (c *SecretClient) Delete() *SecretDelete

Delete returns a delete builder for Secret.

func (*SecretClient) DeleteOne

func (c *SecretClient) DeleteOne(_m *Secret) *SecretDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SecretClient) DeleteOneID

func (c *SecretClient) DeleteOneID(id uuid.UUID) *SecretDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SecretClient) ExecContext

func (c *SecretClient) 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 (*SecretClient) Get

func (c *SecretClient) Get(ctx context.Context, id uuid.UUID) (*Secret, error)

Get returns a Secret entity by its id.

func (*SecretClient) GetX

func (c *SecretClient) GetX(ctx context.Context, id uuid.UUID) *Secret

GetX is like Get, but panics if an error occurs.

func (*SecretClient) Hooks

func (c *SecretClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SecretClient) Intercept

func (c *SecretClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `secret.Intercept(f(g(h())))`.

func (*SecretClient) Interceptors

func (c *SecretClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SecretClient) MapCreateBulk

func (c *SecretClient) MapCreateBulk(slice any, setFunc func(*SecretCreate, int)) *SecretCreateBulk

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 (*SecretClient) Query

func (c *SecretClient) Query() *SecretQuery

Query returns a query builder for Secret.

func (*SecretClient) QueryAccount

func (c *SecretClient) QueryAccount(_m *Secret) *AccountQuery

QueryAccount queries the account edge of a Secret.

func (*SecretClient) QueryContext

func (c *SecretClient) 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 (*SecretClient) Update

func (c *SecretClient) Update() *SecretUpdate

Update returns an update builder for Secret.

func (*SecretClient) UpdateOne

func (c *SecretClient) UpdateOne(_m *Secret) *SecretUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SecretClient) UpdateOneID

func (c *SecretClient) UpdateOneID(id uuid.UUID) *SecretUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SecretClient) Use

func (c *SecretClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `secret.Hooks(f(g(h())))`.

type SecretCreate

type SecretCreate struct {
	// contains filtered or unexported fields
}

SecretCreate is the builder for creating a Secret entity.

func (*SecretCreate) Exec

func (_c *SecretCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretCreate) ExecContext

func (c *SecretCreate) 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 (*SecretCreate) ExecX

func (_c *SecretCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretCreate) Mutation

func (_c *SecretCreate) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretCreate) OnConflict

func (_c *SecretCreate) OnConflict(opts ...sql.ConflictOption) *SecretUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Secret.Create().
	SetKey(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.SecretUpsert) {
		SetKey(v+v).
	}).
	Exec(ctx)

func (*SecretCreate) OnConflictColumns

func (_c *SecretCreate) OnConflictColumns(columns ...string) *SecretUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Secret.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SecretCreate) QueryContext

func (c *SecretCreate) 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 (*SecretCreate) Save

func (_c *SecretCreate) Save(ctx context.Context) (*Secret, error)

Save creates the Secret in the database.

func (*SecretCreate) SaveX

func (_c *SecretCreate) SaveX(ctx context.Context) *Secret

SaveX calls Save and panics if Save returns an error.

func (*SecretCreate) SetAccount

func (_c *SecretCreate) SetAccount(v *Account) *SecretCreate

SetAccount sets the "account" edge to the Account entity.

func (*SecretCreate) SetAccountID

func (_c *SecretCreate) SetAccountID(id uuid.UUID) *SecretCreate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*SecretCreate) SetCreatedAt

func (_c *SecretCreate) SetCreatedAt(v time.Time) *SecretCreate

SetCreatedAt sets the "created_at" field.

func (*SecretCreate) SetID

func (_c *SecretCreate) SetID(v uuid.UUID) *SecretCreate

SetID sets the "id" field.

func (*SecretCreate) SetKey

func (_c *SecretCreate) SetKey(v string) *SecretCreate

SetKey sets the "key" field.

func (*SecretCreate) SetNillableCreatedAt

func (_c *SecretCreate) SetNillableCreatedAt(v *time.Time) *SecretCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SecretCreate) SetNillableID

func (_c *SecretCreate) SetNillableID(v *uuid.UUID) *SecretCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SecretCreate) SetNillableUpdatedAt

func (_c *SecretCreate) SetNillableUpdatedAt(v *time.Time) *SecretCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SecretCreate) SetUpdatedAt

func (_c *SecretCreate) SetUpdatedAt(v time.Time) *SecretCreate

SetUpdatedAt sets the "updated_at" field.

func (*SecretCreate) SetValue

func (_c *SecretCreate) SetValue(v []byte) *SecretCreate

SetValue sets the "value" field.

type SecretCreateBulk

type SecretCreateBulk struct {
	// contains filtered or unexported fields
}

SecretCreateBulk is the builder for creating many Secret entities in bulk.

func (*SecretCreateBulk) Exec

func (_c *SecretCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretCreateBulk) ExecContext

func (c *SecretCreateBulk) 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 (*SecretCreateBulk) ExecX

func (_c *SecretCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretCreateBulk) OnConflict

func (_c *SecretCreateBulk) OnConflict(opts ...sql.ConflictOption) *SecretUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Secret.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.SecretUpsert) {
		SetKey(v+v).
	}).
	Exec(ctx)

func (*SecretCreateBulk) OnConflictColumns

func (_c *SecretCreateBulk) OnConflictColumns(columns ...string) *SecretUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Secret.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SecretCreateBulk) QueryContext

func (c *SecretCreateBulk) 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 (*SecretCreateBulk) Save

func (_c *SecretCreateBulk) Save(ctx context.Context) ([]*Secret, error)

Save creates the Secret entities in the database.

func (*SecretCreateBulk) SaveX

func (_c *SecretCreateBulk) SaveX(ctx context.Context) []*Secret

SaveX is like Save, but panics if an error occurs.

type SecretDelete

type SecretDelete struct {
	// contains filtered or unexported fields
}

SecretDelete is the builder for deleting a Secret entity.

func (*SecretDelete) Exec

func (_d *SecretDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SecretDelete) ExecContext

func (c *SecretDelete) 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 (*SecretDelete) ExecX

func (_d *SecretDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SecretDelete) QueryContext

func (c *SecretDelete) 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 (*SecretDelete) Where

func (_d *SecretDelete) Where(ps ...predicate.Secret) *SecretDelete

Where appends a list predicates to the SecretDelete builder.

type SecretDeleteOne

type SecretDeleteOne struct {
	// contains filtered or unexported fields
}

SecretDeleteOne is the builder for deleting a single Secret entity.

func (*SecretDeleteOne) Exec

func (_d *SecretDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SecretDeleteOne) ExecX

func (_d *SecretDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretDeleteOne) Where

func (_d *SecretDeleteOne) Where(ps ...predicate.Secret) *SecretDeleteOne

Where appends a list predicates to the SecretDelete builder.

type SecretEdges

type SecretEdges struct {
	// Account holds the value of the account edge.
	Account *Account `json:"account,omitempty"`
	// contains filtered or unexported fields
}

SecretEdges holds the relations/edges for other nodes in the graph.

func (SecretEdges) AccountOrErr

func (e SecretEdges) AccountOrErr() (*Account, error)

AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SecretGroupBy

type SecretGroupBy struct {
	// contains filtered or unexported fields
}

SecretGroupBy is the group-by builder for Secret entities.

func (*SecretGroupBy) Aggregate

func (_g *SecretGroupBy) Aggregate(fns ...AggregateFunc) *SecretGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SecretGroupBy) Bool

func (s *SecretGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) BoolX

func (s *SecretGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SecretGroupBy) Bools

func (s *SecretGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) BoolsX

func (s *SecretGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SecretGroupBy) Float64

func (s *SecretGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) Float64X

func (s *SecretGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SecretGroupBy) Float64s

func (s *SecretGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) Float64sX

func (s *SecretGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SecretGroupBy) Int

func (s *SecretGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) IntX

func (s *SecretGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SecretGroupBy) Ints

func (s *SecretGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) IntsX

func (s *SecretGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SecretGroupBy) Scan

func (_g *SecretGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SecretGroupBy) ScanX

func (s *SecretGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SecretGroupBy) String

func (s *SecretGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) StringX

func (s *SecretGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SecretGroupBy) Strings

func (s *SecretGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) StringsX

func (s *SecretGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SecretMutation

type SecretMutation struct {
	// contains filtered or unexported fields
}

SecretMutation represents an operation that mutates the Secret nodes in the graph.

func (*SecretMutation) AccountCleared

func (m *SecretMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Account entity was cleared.

func (*SecretMutation) AccountID

func (m *SecretMutation) AccountID() (id uuid.UUID, exists bool)

AccountID returns the "account" edge ID in the mutation.

func (*SecretMutation) AccountIDs

func (m *SecretMutation) AccountIDs() (ids []uuid.UUID)

AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.

func (*SecretMutation) AddField

func (m *SecretMutation) 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 (*SecretMutation) AddedEdges

func (m *SecretMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SecretMutation) AddedField

func (m *SecretMutation) 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 (*SecretMutation) AddedFields

func (m *SecretMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SecretMutation) AddedIDs

func (m *SecretMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SecretMutation) ClearAccount

func (m *SecretMutation) ClearAccount()

ClearAccount clears the "account" edge to the Account entity.

func (*SecretMutation) ClearEdge

func (m *SecretMutation) 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 (*SecretMutation) ClearField

func (m *SecretMutation) 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 (*SecretMutation) ClearedEdges

func (m *SecretMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SecretMutation) ClearedFields

func (m *SecretMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SecretMutation) Client

func (m SecretMutation) 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 (*SecretMutation) CreatedAt

func (m *SecretMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SecretMutation) EdgeCleared

func (m *SecretMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SecretMutation) ExecContext

func (c *SecretMutation) 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 (*SecretMutation) Field

func (m *SecretMutation) 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 (*SecretMutation) FieldCleared

func (m *SecretMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SecretMutation) Fields

func (m *SecretMutation) 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 (*SecretMutation) ID

func (m *SecretMutation) 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 (*SecretMutation) IDs

func (m *SecretMutation) 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 (*SecretMutation) Key

func (m *SecretMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*SecretMutation) OldCreatedAt

func (m *SecretMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldField

func (m *SecretMutation) 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 (*SecretMutation) OldKey

func (m *SecretMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldUpdatedAt

func (m *SecretMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldValue

func (m *SecretMutation) OldValue(ctx context.Context) (v []byte, err error)

OldValue returns the old "value" field's value of the Secret entity. If the Secret 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 (*SecretMutation) Op

func (m *SecretMutation) Op() Op

Op returns the operation name.

func (*SecretMutation) QueryContext

func (c *SecretMutation) 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 (*SecretMutation) RemovedEdges

func (m *SecretMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SecretMutation) RemovedIDs

func (m *SecretMutation) 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 (*SecretMutation) ResetAccount

func (m *SecretMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*SecretMutation) ResetCreatedAt

func (m *SecretMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SecretMutation) ResetEdge

func (m *SecretMutation) 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 (*SecretMutation) ResetField

func (m *SecretMutation) 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 (*SecretMutation) ResetKey

func (m *SecretMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*SecretMutation) ResetUpdatedAt

func (m *SecretMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SecretMutation) ResetValue

func (m *SecretMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*SecretMutation) SetAccountID

func (m *SecretMutation) SetAccountID(id uuid.UUID)

SetAccountID sets the "account" edge to the Account entity by id.

func (*SecretMutation) SetCreatedAt

func (m *SecretMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SecretMutation) SetField

func (m *SecretMutation) 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 (*SecretMutation) SetID

func (m *SecretMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Secret entities.

func (*SecretMutation) SetKey

func (m *SecretMutation) SetKey(s string)

SetKey sets the "key" field.

func (*SecretMutation) SetOp

func (m *SecretMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SecretMutation) SetUpdatedAt

func (m *SecretMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SecretMutation) SetValue

func (m *SecretMutation) SetValue(b []byte)

SetValue sets the "value" field.

func (SecretMutation) Tx

func (m SecretMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SecretMutation) Type

func (m *SecretMutation) Type() string

Type returns the node type of this mutation (Secret).

func (*SecretMutation) UpdatedAt

func (m *SecretMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SecretMutation) Value

func (m *SecretMutation) Value() (r []byte, exists bool)

Value returns the value of the "value" field in the mutation.

func (*SecretMutation) Where

func (m *SecretMutation) Where(ps ...predicate.Secret)

Where appends a list predicates to the SecretMutation builder.

func (*SecretMutation) WhereP

func (m *SecretMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SecretMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SecretQuery

type SecretQuery struct {
	// contains filtered or unexported fields
}

SecretQuery is the builder for querying Secret entities.

func (*SecretQuery) Aggregate

func (_q *SecretQuery) Aggregate(fns ...AggregateFunc) *SecretSelect

Aggregate returns a SecretSelect configured with the given aggregations.

func (*SecretQuery) All

func (_q *SecretQuery) All(ctx context.Context) ([]*Secret, error)

All executes the query and returns a list of Secrets.

func (*SecretQuery) AllX

func (_q *SecretQuery) AllX(ctx context.Context) []*Secret

AllX is like All, but panics if an error occurs.

func (*SecretQuery) Clone

func (_q *SecretQuery) Clone() *SecretQuery

Clone returns a duplicate of the SecretQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SecretQuery) Count

func (_q *SecretQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SecretQuery) CountX

func (_q *SecretQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SecretQuery) ExecContext

func (c *SecretQuery) 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 (*SecretQuery) Exist

func (_q *SecretQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SecretQuery) ExistX

func (_q *SecretQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SecretQuery) First

func (_q *SecretQuery) First(ctx context.Context) (*Secret, error)

First returns the first Secret entity from the query. Returns a *NotFoundError when no Secret was found.

func (*SecretQuery) FirstID

func (_q *SecretQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Secret ID from the query. Returns a *NotFoundError when no Secret ID was found.

func (*SecretQuery) FirstIDX

func (_q *SecretQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SecretQuery) FirstX

func (_q *SecretQuery) FirstX(ctx context.Context) *Secret

FirstX is like First, but panics if an error occurs.

func (*SecretQuery) GroupBy

func (_q *SecretQuery) GroupBy(field string, fields ...string) *SecretGroupBy

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 {
	Key string `json:"key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Secret.Query().
	GroupBy(secret.FieldKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SecretQuery) IDs

func (_q *SecretQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Secret IDs.

func (*SecretQuery) IDsX

func (_q *SecretQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SecretQuery) Limit

func (_q *SecretQuery) Limit(limit int) *SecretQuery

Limit the number of records to be returned by this query.

func (*SecretQuery) Modify

func (_q *SecretQuery) Modify(modifiers ...func(s *sql.Selector)) *SecretSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*SecretQuery) Offset

func (_q *SecretQuery) Offset(offset int) *SecretQuery

Offset to start from.

func (*SecretQuery) Only

func (_q *SecretQuery) Only(ctx context.Context) (*Secret, error)

Only returns a single Secret entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Secret entity is found. Returns a *NotFoundError when no Secret entities are found.

func (*SecretQuery) OnlyID

func (_q *SecretQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Secret ID in the query. Returns a *NotSingularError when more than one Secret ID is found. Returns a *NotFoundError when no entities are found.

func (*SecretQuery) OnlyIDX

func (_q *SecretQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SecretQuery) OnlyX

func (_q *SecretQuery) OnlyX(ctx context.Context) *Secret

OnlyX is like Only, but panics if an error occurs.

func (*SecretQuery) Order

func (_q *SecretQuery) Order(o ...secret.OrderOption) *SecretQuery

Order specifies how the records should be ordered.

func (*SecretQuery) QueryAccount

func (_q *SecretQuery) QueryAccount() *AccountQuery

QueryAccount chains the current query on the "account" edge.

func (*SecretQuery) QueryContext

func (c *SecretQuery) 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 (*SecretQuery) Select

func (_q *SecretQuery) Select(fields ...string) *SecretSelect

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 {
	Key string `json:"key,omitempty"`
}

client.Secret.Query().
	Select(secret.FieldKey).
	Scan(ctx, &v)

func (*SecretQuery) Unique

func (_q *SecretQuery) Unique(unique bool) *SecretQuery

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 (*SecretQuery) Where

func (_q *SecretQuery) Where(ps ...predicate.Secret) *SecretQuery

Where adds a new predicate for the SecretQuery builder.

func (*SecretQuery) WithAccount

func (_q *SecretQuery) WithAccount(opts ...func(*AccountQuery)) *SecretQuery

WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.

type SecretSelect

type SecretSelect struct {
	*SecretQuery
	// contains filtered or unexported fields
}

SecretSelect is the builder for selecting fields of Secret entities.

func (*SecretSelect) Aggregate

func (_s *SecretSelect) Aggregate(fns ...AggregateFunc) *SecretSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SecretSelect) Bool

func (s *SecretSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SecretSelect) BoolX

func (s *SecretSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SecretSelect) Bools

func (s *SecretSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SecretSelect) BoolsX

func (s *SecretSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (SecretSelect) ExecContext

func (c SecretSelect) 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 (*SecretSelect) Float64

func (s *SecretSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SecretSelect) Float64X

func (s *SecretSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SecretSelect) Float64s

func (s *SecretSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SecretSelect) Float64sX

func (s *SecretSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SecretSelect) Int

func (s *SecretSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SecretSelect) IntX

func (s *SecretSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SecretSelect) Ints

func (s *SecretSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SecretSelect) IntsX

func (s *SecretSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SecretSelect) Modify

func (_s *SecretSelect) Modify(modifiers ...func(s *sql.Selector)) *SecretSelect

Modify adds a query modifier for attaching custom logic to queries.

func (SecretSelect) QueryContext

func (c SecretSelect) 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 (*SecretSelect) Scan

func (_s *SecretSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SecretSelect) ScanX

func (s *SecretSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SecretSelect) String

func (s *SecretSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SecretSelect) StringX

func (s *SecretSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SecretSelect) Strings

func (s *SecretSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SecretSelect) StringsX

func (s *SecretSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SecretUpdate

type SecretUpdate struct {
	// contains filtered or unexported fields
}

SecretUpdate is the builder for updating Secret entities.

func (*SecretUpdate) ClearAccount

func (_u *SecretUpdate) ClearAccount() *SecretUpdate

ClearAccount clears the "account" edge to the Account entity.

func (*SecretUpdate) Exec

func (_u *SecretUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretUpdate) ExecContext

func (c *SecretUpdate) 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 (*SecretUpdate) ExecX

func (_u *SecretUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretUpdate) Modify

func (_u *SecretUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *SecretUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*SecretUpdate) Mutation

func (_u *SecretUpdate) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretUpdate) QueryContext

func (c *SecretUpdate) 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 (*SecretUpdate) Save

func (_u *SecretUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SecretUpdate) SaveX

func (_u *SecretUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SecretUpdate) SetAccount

func (_u *SecretUpdate) SetAccount(v *Account) *SecretUpdate

SetAccount sets the "account" edge to the Account entity.

func (*SecretUpdate) SetAccountID

func (_u *SecretUpdate) SetAccountID(id uuid.UUID) *SecretUpdate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*SecretUpdate) SetKey

func (_u *SecretUpdate) SetKey(v string) *SecretUpdate

SetKey sets the "key" field.

func (*SecretUpdate) SetNillableKey

func (_u *SecretUpdate) SetNillableKey(v *string) *SecretUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*SecretUpdate) SetUpdatedAt

func (_u *SecretUpdate) SetUpdatedAt(v time.Time) *SecretUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpdate) SetValue

func (_u *SecretUpdate) SetValue(v []byte) *SecretUpdate

SetValue sets the "value" field.

func (*SecretUpdate) Where

func (_u *SecretUpdate) Where(ps ...predicate.Secret) *SecretUpdate

Where appends a list predicates to the SecretUpdate builder.

type SecretUpdateOne

type SecretUpdateOne struct {
	// contains filtered or unexported fields
}

SecretUpdateOne is the builder for updating a single Secret entity.

func (*SecretUpdateOne) ClearAccount

func (_u *SecretUpdateOne) ClearAccount() *SecretUpdateOne

ClearAccount clears the "account" edge to the Account entity.

func (*SecretUpdateOne) Exec

func (_u *SecretUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SecretUpdateOne) ExecContext

func (c *SecretUpdateOne) 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 (*SecretUpdateOne) ExecX

func (_u *SecretUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretUpdateOne) Modify

func (_u *SecretUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *SecretUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*SecretUpdateOne) Mutation

func (_u *SecretUpdateOne) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretUpdateOne) QueryContext

func (c *SecretUpdateOne) 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 (*SecretUpdateOne) Save

func (_u *SecretUpdateOne) Save(ctx context.Context) (*Secret, error)

Save executes the query and returns the updated Secret entity.

func (*SecretUpdateOne) SaveX

func (_u *SecretUpdateOne) SaveX(ctx context.Context) *Secret

SaveX is like Save, but panics if an error occurs.

func (*SecretUpdateOne) Select

func (_u *SecretUpdateOne) Select(field string, fields ...string) *SecretUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SecretUpdateOne) SetAccount

func (_u *SecretUpdateOne) SetAccount(v *Account) *SecretUpdateOne

SetAccount sets the "account" edge to the Account entity.

func (*SecretUpdateOne) SetAccountID

func (_u *SecretUpdateOne) SetAccountID(id uuid.UUID) *SecretUpdateOne

SetAccountID sets the "account" edge to the Account entity by ID.

func (*SecretUpdateOne) SetKey

func (_u *SecretUpdateOne) SetKey(v string) *SecretUpdateOne

SetKey sets the "key" field.

func (*SecretUpdateOne) SetNillableKey

func (_u *SecretUpdateOne) SetNillableKey(v *string) *SecretUpdateOne

SetNillableKey sets the "key" field if the given value is not nil.

func (*SecretUpdateOne) SetUpdatedAt

func (_u *SecretUpdateOne) SetUpdatedAt(v time.Time) *SecretUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpdateOne) SetValue

func (_u *SecretUpdateOne) SetValue(v []byte) *SecretUpdateOne

SetValue sets the "value" field.

func (*SecretUpdateOne) Where

func (_u *SecretUpdateOne) Where(ps ...predicate.Secret) *SecretUpdateOne

Where appends a list predicates to the SecretUpdate builder.

type SecretUpsert

type SecretUpsert struct {
	*sql.UpdateSet
}

SecretUpsert is the "OnConflict" setter.

func (*SecretUpsert) SetKey

func (u *SecretUpsert) SetKey(v string) *SecretUpsert

SetKey sets the "key" field.

func (*SecretUpsert) SetUpdatedAt

func (u *SecretUpsert) SetUpdatedAt(v time.Time) *SecretUpsert

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpsert) SetValue

func (u *SecretUpsert) SetValue(v []byte) *SecretUpsert

SetValue sets the "value" field.

func (*SecretUpsert) UpdateKey

func (u *SecretUpsert) UpdateKey() *SecretUpsert

UpdateKey sets the "key" field to the value that was provided on create.

func (*SecretUpsert) UpdateUpdatedAt

func (u *SecretUpsert) UpdateUpdatedAt() *SecretUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*SecretUpsert) UpdateValue

func (u *SecretUpsert) UpdateValue() *SecretUpsert

UpdateValue sets the "value" field to the value that was provided on create.

type SecretUpsertBulk

type SecretUpsertBulk struct {
	// contains filtered or unexported fields
}

SecretUpsertBulk is the builder for "upsert"-ing a bulk of Secret nodes.

func (*SecretUpsertBulk) DoNothing

func (u *SecretUpsertBulk) DoNothing() *SecretUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SecretUpsertBulk) Exec

func (u *SecretUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretUpsertBulk) ExecX

func (u *SecretUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretUpsertBulk) Ignore

func (u *SecretUpsertBulk) Ignore() *SecretUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Secret.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SecretUpsertBulk) SetKey

SetKey sets the "key" field.

func (*SecretUpsertBulk) SetUpdatedAt

func (u *SecretUpsertBulk) SetUpdatedAt(v time.Time) *SecretUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpsertBulk) SetValue

func (u *SecretUpsertBulk) SetValue(v []byte) *SecretUpsertBulk

SetValue sets the "value" field.

func (*SecretUpsertBulk) Update

func (u *SecretUpsertBulk) Update(set func(*SecretUpsert)) *SecretUpsertBulk

Update allows overriding fields `UPDATE` values. See the SecretCreateBulk.OnConflict documentation for more info.

func (*SecretUpsertBulk) UpdateKey

func (u *SecretUpsertBulk) UpdateKey() *SecretUpsertBulk

UpdateKey sets the "key" field to the value that was provided on create.

func (*SecretUpsertBulk) UpdateNewValues

func (u *SecretUpsertBulk) UpdateNewValues() *SecretUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Secret.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(secret.FieldID)
		}),
	).
	Exec(ctx)

func (*SecretUpsertBulk) UpdateUpdatedAt

func (u *SecretUpsertBulk) UpdateUpdatedAt() *SecretUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*SecretUpsertBulk) UpdateValue

func (u *SecretUpsertBulk) UpdateValue() *SecretUpsertBulk

UpdateValue sets the "value" field to the value that was provided on create.

type SecretUpsertOne

type SecretUpsertOne struct {
	// contains filtered or unexported fields
}

SecretUpsertOne is the builder for "upsert"-ing

one Secret node.

func (*SecretUpsertOne) DoNothing

func (u *SecretUpsertOne) DoNothing() *SecretUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SecretUpsertOne) Exec

func (u *SecretUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretUpsertOne) ExecX

func (u *SecretUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretUpsertOne) ID

func (u *SecretUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SecretUpsertOne) IDX

func (u *SecretUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*SecretUpsertOne) Ignore

func (u *SecretUpsertOne) Ignore() *SecretUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Secret.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SecretUpsertOne) SetKey

func (u *SecretUpsertOne) SetKey(v string) *SecretUpsertOne

SetKey sets the "key" field.

func (*SecretUpsertOne) SetUpdatedAt

func (u *SecretUpsertOne) SetUpdatedAt(v time.Time) *SecretUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpsertOne) SetValue

func (u *SecretUpsertOne) SetValue(v []byte) *SecretUpsertOne

SetValue sets the "value" field.

func (*SecretUpsertOne) Update

func (u *SecretUpsertOne) Update(set func(*SecretUpsert)) *SecretUpsertOne

Update allows overriding fields `UPDATE` values. See the SecretCreate.OnConflict documentation for more info.

func (*SecretUpsertOne) UpdateKey

func (u *SecretUpsertOne) UpdateKey() *SecretUpsertOne

UpdateKey sets the "key" field to the value that was provided on create.

func (*SecretUpsertOne) UpdateNewValues

func (u *SecretUpsertOne) UpdateNewValues() *SecretUpsertOne

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.Secret.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(secret.FieldID)
		}),
	).
	Exec(ctx)

func (*SecretUpsertOne) UpdateUpdatedAt

func (u *SecretUpsertOne) UpdateUpdatedAt() *SecretUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*SecretUpsertOne) UpdateValue

func (u *SecretUpsertOne) UpdateValue() *SecretUpsertOne

UpdateValue sets the "value" field to the value that was provided on create.

type Secrets

type Secrets []*Secret

Secrets is a parsable slice of Secret.

type Thread

type Thread struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ProviderThreadID holds the value of the "provider_thread_id" field.
	ProviderThreadID string `json:"provider_thread_id,omitempty"`
	// Subject holds the value of the "subject" field.
	Subject string `json:"subject,omitempty"`
	// Snippet holds the value of the "snippet" field.
	Snippet string `json:"snippet,omitempty"`
	// LastMessageAt holds the value of the "last_message_at" field.
	LastMessageAt time.Time `json:"last_message_at,omitempty"`
	// HistoryLoadedAt holds the value of the "history_loaded_at" field.
	HistoryLoadedAt *time.Time `json:"history_loaded_at,omitempty"`
	// Participants holds the value of the "participants" field.
	Participants []string `json:"participants,omitempty"`
	// Unread holds the value of the "unread" field.
	Unread bool `json:"unread,omitempty"`
	// Starred holds the value of the "starred" field.
	Starred bool `json:"starred,omitempty"`
	// InInbox holds the value of the "in_inbox" field.
	InInbox bool `json:"in_inbox,omitempty"`
	// Labels holds the value of the "labels" field.
	Labels []string `json:"labels,omitempty"`
	// SnoozedUntil holds the value of the "snoozed_until" field.
	SnoozedUntil *time.Time `json:"snoozed_until,omitempty"`
	// MessageCount holds the value of the "message_count" field.
	MessageCount int `json:"message_count,omitempty"`
	// HasAttachments holds the value of the "has_attachments" field.
	HasAttachments bool `json:"has_attachments,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ThreadQuery when eager-loading is set.
	Edges ThreadEdges `json:"edges"`
	// contains filtered or unexported fields
}

Thread is the model entity for the Thread schema.

func (*Thread) ExecContext

func (c *Thread) 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 (*Thread) QueryAccount

func (_m *Thread) QueryAccount() *AccountQuery

QueryAccount queries the "account" edge of the Thread entity.

func (*Thread) QueryContext

func (c *Thread) 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 (*Thread) QueryMessages

func (_m *Thread) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Thread entity.

func (*Thread) String

func (_m *Thread) String() string

String implements the fmt.Stringer.

func (*Thread) Unwrap

func (_m *Thread) Unwrap() *Thread

Unwrap unwraps the Thread 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 (*Thread) Update

func (_m *Thread) Update() *ThreadUpdateOne

Update returns a builder for updating this Thread. Note that you need to call Thread.Unwrap() before calling this method if this Thread was returned from a transaction, and the transaction was committed or rolled back.

func (*Thread) Value

func (_m *Thread) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Thread. This includes values selected through modifiers, order, etc.

type ThreadClient

type ThreadClient struct {
	// contains filtered or unexported fields
}

ThreadClient is a client for the Thread schema.

func NewThreadClient

func NewThreadClient(c config) *ThreadClient

NewThreadClient returns a client for the Thread from the given config.

func (*ThreadClient) Create

func (c *ThreadClient) Create() *ThreadCreate

Create returns a builder for creating a Thread entity.

func (*ThreadClient) CreateBulk

func (c *ThreadClient) CreateBulk(builders ...*ThreadCreate) *ThreadCreateBulk

CreateBulk returns a builder for creating a bulk of Thread entities.

func (*ThreadClient) Delete

func (c *ThreadClient) Delete() *ThreadDelete

Delete returns a delete builder for Thread.

func (*ThreadClient) DeleteOne

func (c *ThreadClient) DeleteOne(_m *Thread) *ThreadDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ThreadClient) DeleteOneID

func (c *ThreadClient) DeleteOneID(id int) *ThreadDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ThreadClient) ExecContext

func (c *ThreadClient) 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 (*ThreadClient) Get

func (c *ThreadClient) Get(ctx context.Context, id int) (*Thread, error)

Get returns a Thread entity by its id.

func (*ThreadClient) GetX

func (c *ThreadClient) GetX(ctx context.Context, id int) *Thread

GetX is like Get, but panics if an error occurs.

func (*ThreadClient) Hooks

func (c *ThreadClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ThreadClient) Intercept

func (c *ThreadClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `thread.Intercept(f(g(h())))`.

func (*ThreadClient) Interceptors

func (c *ThreadClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ThreadClient) MapCreateBulk

func (c *ThreadClient) MapCreateBulk(slice any, setFunc func(*ThreadCreate, int)) *ThreadCreateBulk

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 (*ThreadClient) Query

func (c *ThreadClient) Query() *ThreadQuery

Query returns a query builder for Thread.

func (*ThreadClient) QueryAccount

func (c *ThreadClient) QueryAccount(_m *Thread) *AccountQuery

QueryAccount queries the account edge of a Thread.

func (*ThreadClient) QueryContext

func (c *ThreadClient) 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 (*ThreadClient) QueryMessages

func (c *ThreadClient) QueryMessages(_m *Thread) *MessageQuery

QueryMessages queries the messages edge of a Thread.

func (*ThreadClient) Update

func (c *ThreadClient) Update() *ThreadUpdate

Update returns an update builder for Thread.

func (*ThreadClient) UpdateOne

func (c *ThreadClient) UpdateOne(_m *Thread) *ThreadUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ThreadClient) UpdateOneID

func (c *ThreadClient) UpdateOneID(id int) *ThreadUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ThreadClient) Use

func (c *ThreadClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `thread.Hooks(f(g(h())))`.

type ThreadCreate

type ThreadCreate struct {
	// contains filtered or unexported fields
}

ThreadCreate is the builder for creating a Thread entity.

func (*ThreadCreate) AddMessageIDs

func (_c *ThreadCreate) AddMessageIDs(ids ...int) *ThreadCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ThreadCreate) AddMessages

func (_c *ThreadCreate) AddMessages(v ...*Message) *ThreadCreate

AddMessages adds the "messages" edges to the Message entity.

func (*ThreadCreate) Exec

func (_c *ThreadCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ThreadCreate) ExecContext

func (c *ThreadCreate) 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 (*ThreadCreate) ExecX

func (_c *ThreadCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadCreate) Mutation

func (_c *ThreadCreate) Mutation() *ThreadMutation

Mutation returns the ThreadMutation object of the builder.

func (*ThreadCreate) OnConflict

func (_c *ThreadCreate) OnConflict(opts ...sql.ConflictOption) *ThreadUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Thread.Create().
	SetProviderThreadID(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.ThreadUpsert) {
		SetProviderThreadID(v+v).
	}).
	Exec(ctx)

func (*ThreadCreate) OnConflictColumns

func (_c *ThreadCreate) OnConflictColumns(columns ...string) *ThreadUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Thread.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ThreadCreate) QueryContext

func (c *ThreadCreate) 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 (*ThreadCreate) Save

func (_c *ThreadCreate) Save(ctx context.Context) (*Thread, error)

Save creates the Thread in the database.

func (*ThreadCreate) SaveX

func (_c *ThreadCreate) SaveX(ctx context.Context) *Thread

SaveX calls Save and panics if Save returns an error.

func (*ThreadCreate) SetAccount

func (_c *ThreadCreate) SetAccount(v *Account) *ThreadCreate

SetAccount sets the "account" edge to the Account entity.

func (*ThreadCreate) SetAccountID

func (_c *ThreadCreate) SetAccountID(id uuid.UUID) *ThreadCreate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*ThreadCreate) SetHasAttachments

func (_c *ThreadCreate) SetHasAttachments(v bool) *ThreadCreate

SetHasAttachments sets the "has_attachments" field.

func (*ThreadCreate) SetHistoryLoadedAt

func (_c *ThreadCreate) SetHistoryLoadedAt(v time.Time) *ThreadCreate

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadCreate) SetInInbox

func (_c *ThreadCreate) SetInInbox(v bool) *ThreadCreate

SetInInbox sets the "in_inbox" field.

func (*ThreadCreate) SetLabels

func (_c *ThreadCreate) SetLabels(v []string) *ThreadCreate

SetLabels sets the "labels" field.

func (*ThreadCreate) SetLastMessageAt

func (_c *ThreadCreate) SetLastMessageAt(v time.Time) *ThreadCreate

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadCreate) SetMessageCount

func (_c *ThreadCreate) SetMessageCount(v int) *ThreadCreate

SetMessageCount sets the "message_count" field.

func (*ThreadCreate) SetNillableHasAttachments

func (_c *ThreadCreate) SetNillableHasAttachments(v *bool) *ThreadCreate

SetNillableHasAttachments sets the "has_attachments" field if the given value is not nil.

func (*ThreadCreate) SetNillableHistoryLoadedAt

func (_c *ThreadCreate) SetNillableHistoryLoadedAt(v *time.Time) *ThreadCreate

SetNillableHistoryLoadedAt sets the "history_loaded_at" field if the given value is not nil.

func (*ThreadCreate) SetNillableInInbox

func (_c *ThreadCreate) SetNillableInInbox(v *bool) *ThreadCreate

SetNillableInInbox sets the "in_inbox" field if the given value is not nil.

func (*ThreadCreate) SetNillableMessageCount

func (_c *ThreadCreate) SetNillableMessageCount(v *int) *ThreadCreate

SetNillableMessageCount sets the "message_count" field if the given value is not nil.

func (*ThreadCreate) SetNillableSnippet

func (_c *ThreadCreate) SetNillableSnippet(v *string) *ThreadCreate

SetNillableSnippet sets the "snippet" field if the given value is not nil.

func (*ThreadCreate) SetNillableSnoozedUntil

func (_c *ThreadCreate) SetNillableSnoozedUntil(v *time.Time) *ThreadCreate

SetNillableSnoozedUntil sets the "snoozed_until" field if the given value is not nil.

func (*ThreadCreate) SetNillableStarred

func (_c *ThreadCreate) SetNillableStarred(v *bool) *ThreadCreate

SetNillableStarred sets the "starred" field if the given value is not nil.

func (*ThreadCreate) SetNillableSubject

func (_c *ThreadCreate) SetNillableSubject(v *string) *ThreadCreate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*ThreadCreate) SetNillableUnread

func (_c *ThreadCreate) SetNillableUnread(v *bool) *ThreadCreate

SetNillableUnread sets the "unread" field if the given value is not nil.

func (*ThreadCreate) SetParticipants

func (_c *ThreadCreate) SetParticipants(v []string) *ThreadCreate

SetParticipants sets the "participants" field.

func (*ThreadCreate) SetProviderThreadID

func (_c *ThreadCreate) SetProviderThreadID(v string) *ThreadCreate

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadCreate) SetSnippet

func (_c *ThreadCreate) SetSnippet(v string) *ThreadCreate

SetSnippet sets the "snippet" field.

func (*ThreadCreate) SetSnoozedUntil

func (_c *ThreadCreate) SetSnoozedUntil(v time.Time) *ThreadCreate

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadCreate) SetStarred

func (_c *ThreadCreate) SetStarred(v bool) *ThreadCreate

SetStarred sets the "starred" field.

func (*ThreadCreate) SetSubject

func (_c *ThreadCreate) SetSubject(v string) *ThreadCreate

SetSubject sets the "subject" field.

func (*ThreadCreate) SetUnread

func (_c *ThreadCreate) SetUnread(v bool) *ThreadCreate

SetUnread sets the "unread" field.

type ThreadCreateBulk

type ThreadCreateBulk struct {
	// contains filtered or unexported fields
}

ThreadCreateBulk is the builder for creating many Thread entities in bulk.

func (*ThreadCreateBulk) Exec

func (_c *ThreadCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ThreadCreateBulk) ExecContext

func (c *ThreadCreateBulk) 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 (*ThreadCreateBulk) ExecX

func (_c *ThreadCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadCreateBulk) OnConflict

func (_c *ThreadCreateBulk) OnConflict(opts ...sql.ConflictOption) *ThreadUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Thread.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.ThreadUpsert) {
		SetProviderThreadID(v+v).
	}).
	Exec(ctx)

func (*ThreadCreateBulk) OnConflictColumns

func (_c *ThreadCreateBulk) OnConflictColumns(columns ...string) *ThreadUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Thread.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ThreadCreateBulk) QueryContext

func (c *ThreadCreateBulk) 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 (*ThreadCreateBulk) Save

func (_c *ThreadCreateBulk) Save(ctx context.Context) ([]*Thread, error)

Save creates the Thread entities in the database.

func (*ThreadCreateBulk) SaveX

func (_c *ThreadCreateBulk) SaveX(ctx context.Context) []*Thread

SaveX is like Save, but panics if an error occurs.

type ThreadDelete

type ThreadDelete struct {
	// contains filtered or unexported fields
}

ThreadDelete is the builder for deleting a Thread entity.

func (*ThreadDelete) Exec

func (_d *ThreadDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ThreadDelete) ExecContext

func (c *ThreadDelete) 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 (*ThreadDelete) ExecX

func (_d *ThreadDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ThreadDelete) QueryContext

func (c *ThreadDelete) 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 (*ThreadDelete) Where

func (_d *ThreadDelete) Where(ps ...predicate.Thread) *ThreadDelete

Where appends a list predicates to the ThreadDelete builder.

type ThreadDeleteOne

type ThreadDeleteOne struct {
	// contains filtered or unexported fields
}

ThreadDeleteOne is the builder for deleting a single Thread entity.

func (*ThreadDeleteOne) Exec

func (_d *ThreadDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ThreadDeleteOne) ExecX

func (_d *ThreadDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadDeleteOne) Where

func (_d *ThreadDeleteOne) Where(ps ...predicate.Thread) *ThreadDeleteOne

Where appends a list predicates to the ThreadDelete builder.

type ThreadEdges

type ThreadEdges struct {
	// Account holds the value of the account edge.
	Account *Account `json:"account,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

ThreadEdges holds the relations/edges for other nodes in the graph.

func (ThreadEdges) AccountOrErr

func (e ThreadEdges) AccountOrErr() (*Account, error)

AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ThreadEdges) MessagesOrErr

func (e ThreadEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

type ThreadGroupBy

type ThreadGroupBy struct {
	// contains filtered or unexported fields
}

ThreadGroupBy is the group-by builder for Thread entities.

func (*ThreadGroupBy) Aggregate

func (_g *ThreadGroupBy) Aggregate(fns ...AggregateFunc) *ThreadGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ThreadGroupBy) Bool

func (s *ThreadGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) BoolX

func (s *ThreadGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThreadGroupBy) Bools

func (s *ThreadGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) BoolsX

func (s *ThreadGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThreadGroupBy) Float64

func (s *ThreadGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) Float64X

func (s *ThreadGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThreadGroupBy) Float64s

func (s *ThreadGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) Float64sX

func (s *ThreadGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThreadGroupBy) Int

func (s *ThreadGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) IntX

func (s *ThreadGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThreadGroupBy) Ints

func (s *ThreadGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) IntsX

func (s *ThreadGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ThreadGroupBy) Scan

func (_g *ThreadGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ThreadGroupBy) ScanX

func (s *ThreadGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ThreadGroupBy) String

func (s *ThreadGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) StringX

func (s *ThreadGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThreadGroupBy) Strings

func (s *ThreadGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) StringsX

func (s *ThreadGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ThreadMutation

type ThreadMutation struct {
	// contains filtered or unexported fields
}

ThreadMutation represents an operation that mutates the Thread nodes in the graph.

func (*ThreadMutation) AccountCleared

func (m *ThreadMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Account entity was cleared.

func (*ThreadMutation) AccountID

func (m *ThreadMutation) AccountID() (id uuid.UUID, exists bool)

AccountID returns the "account" edge ID in the mutation.

func (*ThreadMutation) AccountIDs

func (m *ThreadMutation) AccountIDs() (ids []uuid.UUID)

AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.

func (*ThreadMutation) AddField

func (m *ThreadMutation) 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 (*ThreadMutation) AddMessageCount

func (m *ThreadMutation) AddMessageCount(i int)

AddMessageCount adds i to the "message_count" field.

func (*ThreadMutation) AddMessageIDs

func (m *ThreadMutation) AddMessageIDs(ids ...int)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*ThreadMutation) AddedEdges

func (m *ThreadMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ThreadMutation) AddedField

func (m *ThreadMutation) 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 (*ThreadMutation) AddedFields

func (m *ThreadMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ThreadMutation) AddedIDs

func (m *ThreadMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ThreadMutation) AddedMessageCount

func (m *ThreadMutation) AddedMessageCount() (r int, exists bool)

AddedMessageCount returns the value that was added to the "message_count" field in this mutation.

func (*ThreadMutation) AppendLabels

func (m *ThreadMutation) AppendLabels(s []string)

AppendLabels adds s to the "labels" field.

func (*ThreadMutation) AppendParticipants

func (m *ThreadMutation) AppendParticipants(s []string)

AppendParticipants adds s to the "participants" field.

func (*ThreadMutation) AppendedLabels

func (m *ThreadMutation) AppendedLabels() ([]string, bool)

AppendedLabels returns the list of values that were appended to the "labels" field in this mutation.

func (*ThreadMutation) AppendedParticipants

func (m *ThreadMutation) AppendedParticipants() ([]string, bool)

AppendedParticipants returns the list of values that were appended to the "participants" field in this mutation.

func (*ThreadMutation) ClearAccount

func (m *ThreadMutation) ClearAccount()

ClearAccount clears the "account" edge to the Account entity.

func (*ThreadMutation) ClearEdge

func (m *ThreadMutation) 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 (*ThreadMutation) ClearField

func (m *ThreadMutation) 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 (*ThreadMutation) ClearHistoryLoadedAt

func (m *ThreadMutation) ClearHistoryLoadedAt()

ClearHistoryLoadedAt clears the value of the "history_loaded_at" field.

func (*ThreadMutation) ClearMessages

func (m *ThreadMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*ThreadMutation) ClearSnoozedUntil

func (m *ThreadMutation) ClearSnoozedUntil()

ClearSnoozedUntil clears the value of the "snoozed_until" field.

func (*ThreadMutation) ClearedEdges

func (m *ThreadMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ThreadMutation) ClearedFields

func (m *ThreadMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ThreadMutation) Client

func (m ThreadMutation) 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 (*ThreadMutation) EdgeCleared

func (m *ThreadMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ThreadMutation) ExecContext

func (c *ThreadMutation) 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 (*ThreadMutation) Field

func (m *ThreadMutation) 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 (*ThreadMutation) FieldCleared

func (m *ThreadMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ThreadMutation) Fields

func (m *ThreadMutation) 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 (*ThreadMutation) HasAttachments

func (m *ThreadMutation) HasAttachments() (r bool, exists bool)

HasAttachments returns the value of the "has_attachments" field in the mutation.

func (*ThreadMutation) HistoryLoadedAt

func (m *ThreadMutation) HistoryLoadedAt() (r time.Time, exists bool)

HistoryLoadedAt returns the value of the "history_loaded_at" field in the mutation.

func (*ThreadMutation) HistoryLoadedAtCleared

func (m *ThreadMutation) HistoryLoadedAtCleared() bool

HistoryLoadedAtCleared returns if the "history_loaded_at" field was cleared in this mutation.

func (*ThreadMutation) ID

func (m *ThreadMutation) 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 (*ThreadMutation) IDs

func (m *ThreadMutation) 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 (*ThreadMutation) InInbox

func (m *ThreadMutation) InInbox() (r bool, exists bool)

InInbox returns the value of the "in_inbox" field in the mutation.

func (*ThreadMutation) Labels

func (m *ThreadMutation) Labels() (r []string, exists bool)

Labels returns the value of the "labels" field in the mutation.

func (*ThreadMutation) LastMessageAt

func (m *ThreadMutation) LastMessageAt() (r time.Time, exists bool)

LastMessageAt returns the value of the "last_message_at" field in the mutation.

func (*ThreadMutation) MessageCount

func (m *ThreadMutation) MessageCount() (r int, exists bool)

MessageCount returns the value of the "message_count" field in the mutation.

func (*ThreadMutation) MessagesCleared

func (m *ThreadMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*ThreadMutation) MessagesIDs

func (m *ThreadMutation) MessagesIDs() (ids []int)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*ThreadMutation) OldField

func (m *ThreadMutation) 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 (*ThreadMutation) OldHasAttachments

func (m *ThreadMutation) OldHasAttachments(ctx context.Context) (v bool, err error)

OldHasAttachments returns the old "has_attachments" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldHistoryLoadedAt

func (m *ThreadMutation) OldHistoryLoadedAt(ctx context.Context) (v *time.Time, err error)

OldHistoryLoadedAt returns the old "history_loaded_at" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldInInbox

func (m *ThreadMutation) OldInInbox(ctx context.Context) (v bool, err error)

OldInInbox returns the old "in_inbox" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldLabels

func (m *ThreadMutation) OldLabels(ctx context.Context) (v []string, err error)

OldLabels returns the old "labels" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldLastMessageAt

func (m *ThreadMutation) OldLastMessageAt(ctx context.Context) (v time.Time, err error)

OldLastMessageAt returns the old "last_message_at" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldMessageCount

func (m *ThreadMutation) OldMessageCount(ctx context.Context) (v int, err error)

OldMessageCount returns the old "message_count" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldParticipants

func (m *ThreadMutation) OldParticipants(ctx context.Context) (v []string, err error)

OldParticipants returns the old "participants" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldProviderThreadID

func (m *ThreadMutation) OldProviderThreadID(ctx context.Context) (v string, err error)

OldProviderThreadID returns the old "provider_thread_id" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldSnippet

func (m *ThreadMutation) OldSnippet(ctx context.Context) (v string, err error)

OldSnippet returns the old "snippet" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldSnoozedUntil

func (m *ThreadMutation) OldSnoozedUntil(ctx context.Context) (v *time.Time, err error)

OldSnoozedUntil returns the old "snoozed_until" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldStarred

func (m *ThreadMutation) OldStarred(ctx context.Context) (v bool, err error)

OldStarred returns the old "starred" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldSubject

func (m *ThreadMutation) OldSubject(ctx context.Context) (v string, err error)

OldSubject returns the old "subject" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldUnread

func (m *ThreadMutation) OldUnread(ctx context.Context) (v bool, err error)

OldUnread returns the old "unread" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) Op

func (m *ThreadMutation) Op() Op

Op returns the operation name.

func (*ThreadMutation) Participants

func (m *ThreadMutation) Participants() (r []string, exists bool)

Participants returns the value of the "participants" field in the mutation.

func (*ThreadMutation) ProviderThreadID

func (m *ThreadMutation) ProviderThreadID() (r string, exists bool)

ProviderThreadID returns the value of the "provider_thread_id" field in the mutation.

func (*ThreadMutation) QueryContext

func (c *ThreadMutation) 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 (*ThreadMutation) RemoveMessageIDs

func (m *ThreadMutation) RemoveMessageIDs(ids ...int)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*ThreadMutation) RemovedEdges

func (m *ThreadMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ThreadMutation) RemovedIDs

func (m *ThreadMutation) 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 (*ThreadMutation) RemovedMessagesIDs

func (m *ThreadMutation) RemovedMessagesIDs() (ids []int)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*ThreadMutation) ResetAccount

func (m *ThreadMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*ThreadMutation) ResetEdge

func (m *ThreadMutation) 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 (*ThreadMutation) ResetField

func (m *ThreadMutation) 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 (*ThreadMutation) ResetHasAttachments

func (m *ThreadMutation) ResetHasAttachments()

ResetHasAttachments resets all changes to the "has_attachments" field.

func (*ThreadMutation) ResetHistoryLoadedAt

func (m *ThreadMutation) ResetHistoryLoadedAt()

ResetHistoryLoadedAt resets all changes to the "history_loaded_at" field.

func (*ThreadMutation) ResetInInbox

func (m *ThreadMutation) ResetInInbox()

ResetInInbox resets all changes to the "in_inbox" field.

func (*ThreadMutation) ResetLabels

func (m *ThreadMutation) ResetLabels()

ResetLabels resets all changes to the "labels" field.

func (*ThreadMutation) ResetLastMessageAt

func (m *ThreadMutation) ResetLastMessageAt()

ResetLastMessageAt resets all changes to the "last_message_at" field.

func (*ThreadMutation) ResetMessageCount

func (m *ThreadMutation) ResetMessageCount()

ResetMessageCount resets all changes to the "message_count" field.

func (*ThreadMutation) ResetMessages

func (m *ThreadMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*ThreadMutation) ResetParticipants

func (m *ThreadMutation) ResetParticipants()

ResetParticipants resets all changes to the "participants" field.

func (*ThreadMutation) ResetProviderThreadID

func (m *ThreadMutation) ResetProviderThreadID()

ResetProviderThreadID resets all changes to the "provider_thread_id" field.

func (*ThreadMutation) ResetSnippet

func (m *ThreadMutation) ResetSnippet()

ResetSnippet resets all changes to the "snippet" field.

func (*ThreadMutation) ResetSnoozedUntil

func (m *ThreadMutation) ResetSnoozedUntil()

ResetSnoozedUntil resets all changes to the "snoozed_until" field.

func (*ThreadMutation) ResetStarred

func (m *ThreadMutation) ResetStarred()

ResetStarred resets all changes to the "starred" field.

func (*ThreadMutation) ResetSubject

func (m *ThreadMutation) ResetSubject()

ResetSubject resets all changes to the "subject" field.

func (*ThreadMutation) ResetUnread

func (m *ThreadMutation) ResetUnread()

ResetUnread resets all changes to the "unread" field.

func (*ThreadMutation) SetAccountID

func (m *ThreadMutation) SetAccountID(id uuid.UUID)

SetAccountID sets the "account" edge to the Account entity by id.

func (*ThreadMutation) SetField

func (m *ThreadMutation) 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 (*ThreadMutation) SetHasAttachments

func (m *ThreadMutation) SetHasAttachments(b bool)

SetHasAttachments sets the "has_attachments" field.

func (*ThreadMutation) SetHistoryLoadedAt

func (m *ThreadMutation) SetHistoryLoadedAt(t time.Time)

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadMutation) SetInInbox

func (m *ThreadMutation) SetInInbox(b bool)

SetInInbox sets the "in_inbox" field.

func (*ThreadMutation) SetLabels

func (m *ThreadMutation) SetLabels(s []string)

SetLabels sets the "labels" field.

func (*ThreadMutation) SetLastMessageAt

func (m *ThreadMutation) SetLastMessageAt(t time.Time)

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadMutation) SetMessageCount

func (m *ThreadMutation) SetMessageCount(i int)

SetMessageCount sets the "message_count" field.

func (*ThreadMutation) SetOp

func (m *ThreadMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ThreadMutation) SetParticipants

func (m *ThreadMutation) SetParticipants(s []string)

SetParticipants sets the "participants" field.

func (*ThreadMutation) SetProviderThreadID

func (m *ThreadMutation) SetProviderThreadID(s string)

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadMutation) SetSnippet

func (m *ThreadMutation) SetSnippet(s string)

SetSnippet sets the "snippet" field.

func (*ThreadMutation) SetSnoozedUntil

func (m *ThreadMutation) SetSnoozedUntil(t time.Time)

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadMutation) SetStarred

func (m *ThreadMutation) SetStarred(b bool)

SetStarred sets the "starred" field.

func (*ThreadMutation) SetSubject

func (m *ThreadMutation) SetSubject(s string)

SetSubject sets the "subject" field.

func (*ThreadMutation) SetUnread

func (m *ThreadMutation) SetUnread(b bool)

SetUnread sets the "unread" field.

func (*ThreadMutation) Snippet

func (m *ThreadMutation) Snippet() (r string, exists bool)

Snippet returns the value of the "snippet" field in the mutation.

func (*ThreadMutation) SnoozedUntil

func (m *ThreadMutation) SnoozedUntil() (r time.Time, exists bool)

SnoozedUntil returns the value of the "snoozed_until" field in the mutation.

func (*ThreadMutation) SnoozedUntilCleared

func (m *ThreadMutation) SnoozedUntilCleared() bool

SnoozedUntilCleared returns if the "snoozed_until" field was cleared in this mutation.

func (*ThreadMutation) Starred

func (m *ThreadMutation) Starred() (r bool, exists bool)

Starred returns the value of the "starred" field in the mutation.

func (*ThreadMutation) Subject

func (m *ThreadMutation) Subject() (r string, exists bool)

Subject returns the value of the "subject" field in the mutation.

func (ThreadMutation) Tx

func (m ThreadMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ThreadMutation) Type

func (m *ThreadMutation) Type() string

Type returns the node type of this mutation (Thread).

func (*ThreadMutation) Unread

func (m *ThreadMutation) Unread() (r bool, exists bool)

Unread returns the value of the "unread" field in the mutation.

func (*ThreadMutation) Where

func (m *ThreadMutation) Where(ps ...predicate.Thread)

Where appends a list predicates to the ThreadMutation builder.

func (*ThreadMutation) WhereP

func (m *ThreadMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ThreadMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ThreadQuery

type ThreadQuery struct {
	// contains filtered or unexported fields
}

ThreadQuery is the builder for querying Thread entities.

func (*ThreadQuery) Aggregate

func (_q *ThreadQuery) Aggregate(fns ...AggregateFunc) *ThreadSelect

Aggregate returns a ThreadSelect configured with the given aggregations.

func (*ThreadQuery) All

func (_q *ThreadQuery) All(ctx context.Context) ([]*Thread, error)

All executes the query and returns a list of Threads.

func (*ThreadQuery) AllX

func (_q *ThreadQuery) AllX(ctx context.Context) []*Thread

AllX is like All, but panics if an error occurs.

func (*ThreadQuery) Clone

func (_q *ThreadQuery) Clone() *ThreadQuery

Clone returns a duplicate of the ThreadQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ThreadQuery) Count

func (_q *ThreadQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ThreadQuery) CountX

func (_q *ThreadQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ThreadQuery) ExecContext

func (c *ThreadQuery) 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 (*ThreadQuery) Exist

func (_q *ThreadQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ThreadQuery) ExistX

func (_q *ThreadQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ThreadQuery) First

func (_q *ThreadQuery) First(ctx context.Context) (*Thread, error)

First returns the first Thread entity from the query. Returns a *NotFoundError when no Thread was found.

func (*ThreadQuery) FirstID

func (_q *ThreadQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Thread ID from the query. Returns a *NotFoundError when no Thread ID was found.

func (*ThreadQuery) FirstIDX

func (_q *ThreadQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ThreadQuery) FirstX

func (_q *ThreadQuery) FirstX(ctx context.Context) *Thread

FirstX is like First, but panics if an error occurs.

func (*ThreadQuery) GroupBy

func (_q *ThreadQuery) GroupBy(field string, fields ...string) *ThreadGroupBy

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 {
	ProviderThreadID string `json:"provider_thread_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Thread.Query().
	GroupBy(thread.FieldProviderThreadID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ThreadQuery) IDs

func (_q *ThreadQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Thread IDs.

func (*ThreadQuery) IDsX

func (_q *ThreadQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ThreadQuery) Limit

func (_q *ThreadQuery) Limit(limit int) *ThreadQuery

Limit the number of records to be returned by this query.

func (*ThreadQuery) Modify

func (_q *ThreadQuery) Modify(modifiers ...func(s *sql.Selector)) *ThreadSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ThreadQuery) Offset

func (_q *ThreadQuery) Offset(offset int) *ThreadQuery

Offset to start from.

func (*ThreadQuery) Only

func (_q *ThreadQuery) Only(ctx context.Context) (*Thread, error)

Only returns a single Thread entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Thread entity is found. Returns a *NotFoundError when no Thread entities are found.

func (*ThreadQuery) OnlyID

func (_q *ThreadQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Thread ID in the query. Returns a *NotSingularError when more than one Thread ID is found. Returns a *NotFoundError when no entities are found.

func (*ThreadQuery) OnlyIDX

func (_q *ThreadQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ThreadQuery) OnlyX

func (_q *ThreadQuery) OnlyX(ctx context.Context) *Thread

OnlyX is like Only, but panics if an error occurs.

func (*ThreadQuery) Order

func (_q *ThreadQuery) Order(o ...thread.OrderOption) *ThreadQuery

Order specifies how the records should be ordered.

func (*ThreadQuery) QueryAccount

func (_q *ThreadQuery) QueryAccount() *AccountQuery

QueryAccount chains the current query on the "account" edge.

func (*ThreadQuery) QueryContext

func (c *ThreadQuery) 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 (*ThreadQuery) QueryMessages

func (_q *ThreadQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*ThreadQuery) Select

func (_q *ThreadQuery) Select(fields ...string) *ThreadSelect

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 {
	ProviderThreadID string `json:"provider_thread_id,omitempty"`
}

client.Thread.Query().
	Select(thread.FieldProviderThreadID).
	Scan(ctx, &v)

func (*ThreadQuery) Unique

func (_q *ThreadQuery) Unique(unique bool) *ThreadQuery

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 (*ThreadQuery) Where

func (_q *ThreadQuery) Where(ps ...predicate.Thread) *ThreadQuery

Where adds a new predicate for the ThreadQuery builder.

func (*ThreadQuery) WithAccount

func (_q *ThreadQuery) WithAccount(opts ...func(*AccountQuery)) *ThreadQuery

WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.

func (*ThreadQuery) WithMessages

func (_q *ThreadQuery) WithMessages(opts ...func(*MessageQuery)) *ThreadQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

type ThreadSelect

type ThreadSelect struct {
	*ThreadQuery
	// contains filtered or unexported fields
}

ThreadSelect is the builder for selecting fields of Thread entities.

func (*ThreadSelect) Aggregate

func (_s *ThreadSelect) Aggregate(fns ...AggregateFunc) *ThreadSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ThreadSelect) Bool

func (s *ThreadSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) BoolX

func (s *ThreadSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThreadSelect) Bools

func (s *ThreadSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) BoolsX

func (s *ThreadSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (ThreadSelect) ExecContext

func (c ThreadSelect) 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 (*ThreadSelect) Float64

func (s *ThreadSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) Float64X

func (s *ThreadSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThreadSelect) Float64s

func (s *ThreadSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) Float64sX

func (s *ThreadSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThreadSelect) Int

func (s *ThreadSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) IntX

func (s *ThreadSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThreadSelect) Ints

func (s *ThreadSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) IntsX

func (s *ThreadSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ThreadSelect) Modify

func (_s *ThreadSelect) Modify(modifiers ...func(s *sql.Selector)) *ThreadSelect

Modify adds a query modifier for attaching custom logic to queries.

func (ThreadSelect) QueryContext

func (c ThreadSelect) 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 (*ThreadSelect) Scan

func (_s *ThreadSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ThreadSelect) ScanX

func (s *ThreadSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ThreadSelect) String

func (s *ThreadSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) StringX

func (s *ThreadSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThreadSelect) Strings

func (s *ThreadSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) StringsX

func (s *ThreadSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ThreadUpdate

type ThreadUpdate struct {
	// contains filtered or unexported fields
}

ThreadUpdate is the builder for updating Thread entities.

func (*ThreadUpdate) AddMessageCount

func (_u *ThreadUpdate) AddMessageCount(v int) *ThreadUpdate

AddMessageCount adds value to the "message_count" field.

func (*ThreadUpdate) AddMessageIDs

func (_u *ThreadUpdate) AddMessageIDs(ids ...int) *ThreadUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ThreadUpdate) AddMessages

func (_u *ThreadUpdate) AddMessages(v ...*Message) *ThreadUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*ThreadUpdate) AppendLabels

func (_u *ThreadUpdate) AppendLabels(v []string) *ThreadUpdate

AppendLabels appends value to the "labels" field.

func (*ThreadUpdate) AppendParticipants

func (_u *ThreadUpdate) AppendParticipants(v []string) *ThreadUpdate

AppendParticipants appends value to the "participants" field.

func (*ThreadUpdate) ClearAccount

func (_u *ThreadUpdate) ClearAccount() *ThreadUpdate

ClearAccount clears the "account" edge to the Account entity.

func (*ThreadUpdate) ClearHistoryLoadedAt

func (_u *ThreadUpdate) ClearHistoryLoadedAt() *ThreadUpdate

ClearHistoryLoadedAt clears the value of the "history_loaded_at" field.

func (*ThreadUpdate) ClearMessages

func (_u *ThreadUpdate) ClearMessages() *ThreadUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*ThreadUpdate) ClearSnoozedUntil

func (_u *ThreadUpdate) ClearSnoozedUntil() *ThreadUpdate

ClearSnoozedUntil clears the value of the "snoozed_until" field.

func (*ThreadUpdate) Exec

func (_u *ThreadUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ThreadUpdate) ExecContext

func (c *ThreadUpdate) 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 (*ThreadUpdate) ExecX

func (_u *ThreadUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadUpdate) Modify

func (_u *ThreadUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ThreadUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ThreadUpdate) Mutation

func (_u *ThreadUpdate) Mutation() *ThreadMutation

Mutation returns the ThreadMutation object of the builder.

func (*ThreadUpdate) QueryContext

func (c *ThreadUpdate) 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 (*ThreadUpdate) RemoveMessageIDs

func (_u *ThreadUpdate) RemoveMessageIDs(ids ...int) *ThreadUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ThreadUpdate) RemoveMessages

func (_u *ThreadUpdate) RemoveMessages(v ...*Message) *ThreadUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*ThreadUpdate) Save

func (_u *ThreadUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ThreadUpdate) SaveX

func (_u *ThreadUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ThreadUpdate) SetAccount

func (_u *ThreadUpdate) SetAccount(v *Account) *ThreadUpdate

SetAccount sets the "account" edge to the Account entity.

func (*ThreadUpdate) SetAccountID

func (_u *ThreadUpdate) SetAccountID(id uuid.UUID) *ThreadUpdate

SetAccountID sets the "account" edge to the Account entity by ID.

func (*ThreadUpdate) SetHasAttachments

func (_u *ThreadUpdate) SetHasAttachments(v bool) *ThreadUpdate

SetHasAttachments sets the "has_attachments" field.

func (*ThreadUpdate) SetHistoryLoadedAt

func (_u *ThreadUpdate) SetHistoryLoadedAt(v time.Time) *ThreadUpdate

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadUpdate) SetInInbox

func (_u *ThreadUpdate) SetInInbox(v bool) *ThreadUpdate

SetInInbox sets the "in_inbox" field.

func (*ThreadUpdate) SetLabels

func (_u *ThreadUpdate) SetLabels(v []string) *ThreadUpdate

SetLabels sets the "labels" field.

func (*ThreadUpdate) SetLastMessageAt

func (_u *ThreadUpdate) SetLastMessageAt(v time.Time) *ThreadUpdate

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadUpdate) SetMessageCount

func (_u *ThreadUpdate) SetMessageCount(v int) *ThreadUpdate

SetMessageCount sets the "message_count" field.

func (*ThreadUpdate) SetNillableHasAttachments

func (_u *ThreadUpdate) SetNillableHasAttachments(v *bool) *ThreadUpdate

SetNillableHasAttachments sets the "has_attachments" field if the given value is not nil.

func (*ThreadUpdate) SetNillableHistoryLoadedAt

func (_u *ThreadUpdate) SetNillableHistoryLoadedAt(v *time.Time) *ThreadUpdate

SetNillableHistoryLoadedAt sets the "history_loaded_at" field if the given value is not nil.

func (*ThreadUpdate) SetNillableInInbox

func (_u *ThreadUpdate) SetNillableInInbox(v *bool) *ThreadUpdate

SetNillableInInbox sets the "in_inbox" field if the given value is not nil.

func (*ThreadUpdate) SetNillableLastMessageAt

func (_u *ThreadUpdate) SetNillableLastMessageAt(v *time.Time) *ThreadUpdate

SetNillableLastMessageAt sets the "last_message_at" field if the given value is not nil.

func (*ThreadUpdate) SetNillableMessageCount

func (_u *ThreadUpdate) SetNillableMessageCount(v *int) *ThreadUpdate

SetNillableMessageCount sets the "message_count" field if the given value is not nil.

func (*ThreadUpdate) SetNillableProviderThreadID

func (_u *ThreadUpdate) SetNillableProviderThreadID(v *string) *ThreadUpdate

SetNillableProviderThreadID sets the "provider_thread_id" field if the given value is not nil.

func (*ThreadUpdate) SetNillableSnippet

func (_u *ThreadUpdate) SetNillableSnippet(v *string) *ThreadUpdate

SetNillableSnippet sets the "snippet" field if the given value is not nil.

func (*ThreadUpdate) SetNillableSnoozedUntil

func (_u *ThreadUpdate) SetNillableSnoozedUntil(v *time.Time) *ThreadUpdate

SetNillableSnoozedUntil sets the "snoozed_until" field if the given value is not nil.

func (*ThreadUpdate) SetNillableStarred

func (_u *ThreadUpdate) SetNillableStarred(v *bool) *ThreadUpdate

SetNillableStarred sets the "starred" field if the given value is not nil.

func (*ThreadUpdate) SetNillableSubject

func (_u *ThreadUpdate) SetNillableSubject(v *string) *ThreadUpdate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*ThreadUpdate) SetNillableUnread

func (_u *ThreadUpdate) SetNillableUnread(v *bool) *ThreadUpdate

SetNillableUnread sets the "unread" field if the given value is not nil.

func (*ThreadUpdate) SetParticipants

func (_u *ThreadUpdate) SetParticipants(v []string) *ThreadUpdate

SetParticipants sets the "participants" field.

func (*ThreadUpdate) SetProviderThreadID

func (_u *ThreadUpdate) SetProviderThreadID(v string) *ThreadUpdate

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadUpdate) SetSnippet

func (_u *ThreadUpdate) SetSnippet(v string) *ThreadUpdate

SetSnippet sets the "snippet" field.

func (*ThreadUpdate) SetSnoozedUntil

func (_u *ThreadUpdate) SetSnoozedUntil(v time.Time) *ThreadUpdate

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadUpdate) SetStarred

func (_u *ThreadUpdate) SetStarred(v bool) *ThreadUpdate

SetStarred sets the "starred" field.

func (*ThreadUpdate) SetSubject

func (_u *ThreadUpdate) SetSubject(v string) *ThreadUpdate

SetSubject sets the "subject" field.

func (*ThreadUpdate) SetUnread

func (_u *ThreadUpdate) SetUnread(v bool) *ThreadUpdate

SetUnread sets the "unread" field.

func (*ThreadUpdate) Where

func (_u *ThreadUpdate) Where(ps ...predicate.Thread) *ThreadUpdate

Where appends a list predicates to the ThreadUpdate builder.

type ThreadUpdateOne

type ThreadUpdateOne struct {
	// contains filtered or unexported fields
}

ThreadUpdateOne is the builder for updating a single Thread entity.

func (*ThreadUpdateOne) AddMessageCount

func (_u *ThreadUpdateOne) AddMessageCount(v int) *ThreadUpdateOne

AddMessageCount adds value to the "message_count" field.

func (*ThreadUpdateOne) AddMessageIDs

func (_u *ThreadUpdateOne) AddMessageIDs(ids ...int) *ThreadUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ThreadUpdateOne) AddMessages

func (_u *ThreadUpdateOne) AddMessages(v ...*Message) *ThreadUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*ThreadUpdateOne) AppendLabels

func (_u *ThreadUpdateOne) AppendLabels(v []string) *ThreadUpdateOne

AppendLabels appends value to the "labels" field.

func (*ThreadUpdateOne) AppendParticipants

func (_u *ThreadUpdateOne) AppendParticipants(v []string) *ThreadUpdateOne

AppendParticipants appends value to the "participants" field.

func (*ThreadUpdateOne) ClearAccount

func (_u *ThreadUpdateOne) ClearAccount() *ThreadUpdateOne

ClearAccount clears the "account" edge to the Account entity.

func (*ThreadUpdateOne) ClearHistoryLoadedAt

func (_u *ThreadUpdateOne) ClearHistoryLoadedAt() *ThreadUpdateOne

ClearHistoryLoadedAt clears the value of the "history_loaded_at" field.

func (*ThreadUpdateOne) ClearMessages

func (_u *ThreadUpdateOne) ClearMessages() *ThreadUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*ThreadUpdateOne) ClearSnoozedUntil

func (_u *ThreadUpdateOne) ClearSnoozedUntil() *ThreadUpdateOne

ClearSnoozedUntil clears the value of the "snoozed_until" field.

func (*ThreadUpdateOne) Exec

func (_u *ThreadUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ThreadUpdateOne) ExecContext

func (c *ThreadUpdateOne) 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 (*ThreadUpdateOne) ExecX

func (_u *ThreadUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadUpdateOne) Modify

func (_u *ThreadUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ThreadUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ThreadUpdateOne) Mutation

func (_u *ThreadUpdateOne) Mutation() *ThreadMutation

Mutation returns the ThreadMutation object of the builder.

func (*ThreadUpdateOne) QueryContext

func (c *ThreadUpdateOne) 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 (*ThreadUpdateOne) RemoveMessageIDs

func (_u *ThreadUpdateOne) RemoveMessageIDs(ids ...int) *ThreadUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ThreadUpdateOne) RemoveMessages

func (_u *ThreadUpdateOne) RemoveMessages(v ...*Message) *ThreadUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*ThreadUpdateOne) Save

func (_u *ThreadUpdateOne) Save(ctx context.Context) (*Thread, error)

Save executes the query and returns the updated Thread entity.

func (*ThreadUpdateOne) SaveX

func (_u *ThreadUpdateOne) SaveX(ctx context.Context) *Thread

SaveX is like Save, but panics if an error occurs.

func (*ThreadUpdateOne) Select

func (_u *ThreadUpdateOne) Select(field string, fields ...string) *ThreadUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ThreadUpdateOne) SetAccount

func (_u *ThreadUpdateOne) SetAccount(v *Account) *ThreadUpdateOne

SetAccount sets the "account" edge to the Account entity.

func (*ThreadUpdateOne) SetAccountID

func (_u *ThreadUpdateOne) SetAccountID(id uuid.UUID) *ThreadUpdateOne

SetAccountID sets the "account" edge to the Account entity by ID.

func (*ThreadUpdateOne) SetHasAttachments

func (_u *ThreadUpdateOne) SetHasAttachments(v bool) *ThreadUpdateOne

SetHasAttachments sets the "has_attachments" field.

func (*ThreadUpdateOne) SetHistoryLoadedAt

func (_u *ThreadUpdateOne) SetHistoryLoadedAt(v time.Time) *ThreadUpdateOne

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadUpdateOne) SetInInbox

func (_u *ThreadUpdateOne) SetInInbox(v bool) *ThreadUpdateOne

SetInInbox sets the "in_inbox" field.

func (*ThreadUpdateOne) SetLabels

func (_u *ThreadUpdateOne) SetLabels(v []string) *ThreadUpdateOne

SetLabels sets the "labels" field.

func (*ThreadUpdateOne) SetLastMessageAt

func (_u *ThreadUpdateOne) SetLastMessageAt(v time.Time) *ThreadUpdateOne

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadUpdateOne) SetMessageCount

func (_u *ThreadUpdateOne) SetMessageCount(v int) *ThreadUpdateOne

SetMessageCount sets the "message_count" field.

func (*ThreadUpdateOne) SetNillableHasAttachments

func (_u *ThreadUpdateOne) SetNillableHasAttachments(v *bool) *ThreadUpdateOne

SetNillableHasAttachments sets the "has_attachments" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableHistoryLoadedAt

func (_u *ThreadUpdateOne) SetNillableHistoryLoadedAt(v *time.Time) *ThreadUpdateOne

SetNillableHistoryLoadedAt sets the "history_loaded_at" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableInInbox

func (_u *ThreadUpdateOne) SetNillableInInbox(v *bool) *ThreadUpdateOne

SetNillableInInbox sets the "in_inbox" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableLastMessageAt

func (_u *ThreadUpdateOne) SetNillableLastMessageAt(v *time.Time) *ThreadUpdateOne

SetNillableLastMessageAt sets the "last_message_at" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableMessageCount

func (_u *ThreadUpdateOne) SetNillableMessageCount(v *int) *ThreadUpdateOne

SetNillableMessageCount sets the "message_count" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableProviderThreadID

func (_u *ThreadUpdateOne) SetNillableProviderThreadID(v *string) *ThreadUpdateOne

SetNillableProviderThreadID sets the "provider_thread_id" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableSnippet

func (_u *ThreadUpdateOne) SetNillableSnippet(v *string) *ThreadUpdateOne

SetNillableSnippet sets the "snippet" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableSnoozedUntil

func (_u *ThreadUpdateOne) SetNillableSnoozedUntil(v *time.Time) *ThreadUpdateOne

SetNillableSnoozedUntil sets the "snoozed_until" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableStarred

func (_u *ThreadUpdateOne) SetNillableStarred(v *bool) *ThreadUpdateOne

SetNillableStarred sets the "starred" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableSubject

func (_u *ThreadUpdateOne) SetNillableSubject(v *string) *ThreadUpdateOne

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*ThreadUpdateOne) SetNillableUnread

func (_u *ThreadUpdateOne) SetNillableUnread(v *bool) *ThreadUpdateOne

SetNillableUnread sets the "unread" field if the given value is not nil.

func (*ThreadUpdateOne) SetParticipants

func (_u *ThreadUpdateOne) SetParticipants(v []string) *ThreadUpdateOne

SetParticipants sets the "participants" field.

func (*ThreadUpdateOne) SetProviderThreadID

func (_u *ThreadUpdateOne) SetProviderThreadID(v string) *ThreadUpdateOne

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadUpdateOne) SetSnippet

func (_u *ThreadUpdateOne) SetSnippet(v string) *ThreadUpdateOne

SetSnippet sets the "snippet" field.

func (*ThreadUpdateOne) SetSnoozedUntil

func (_u *ThreadUpdateOne) SetSnoozedUntil(v time.Time) *ThreadUpdateOne

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadUpdateOne) SetStarred

func (_u *ThreadUpdateOne) SetStarred(v bool) *ThreadUpdateOne

SetStarred sets the "starred" field.

func (*ThreadUpdateOne) SetSubject

func (_u *ThreadUpdateOne) SetSubject(v string) *ThreadUpdateOne

SetSubject sets the "subject" field.

func (*ThreadUpdateOne) SetUnread

func (_u *ThreadUpdateOne) SetUnread(v bool) *ThreadUpdateOne

SetUnread sets the "unread" field.

func (*ThreadUpdateOne) Where

func (_u *ThreadUpdateOne) Where(ps ...predicate.Thread) *ThreadUpdateOne

Where appends a list predicates to the ThreadUpdate builder.

type ThreadUpsert

type ThreadUpsert struct {
	*sql.UpdateSet
}

ThreadUpsert is the "OnConflict" setter.

func (*ThreadUpsert) AddMessageCount

func (u *ThreadUpsert) AddMessageCount(v int) *ThreadUpsert

AddMessageCount adds v to the "message_count" field.

func (*ThreadUpsert) ClearHistoryLoadedAt

func (u *ThreadUpsert) ClearHistoryLoadedAt() *ThreadUpsert

ClearHistoryLoadedAt clears the value of the "history_loaded_at" field.

func (*ThreadUpsert) ClearSnoozedUntil

func (u *ThreadUpsert) ClearSnoozedUntil() *ThreadUpsert

ClearSnoozedUntil clears the value of the "snoozed_until" field.

func (*ThreadUpsert) SetHasAttachments

func (u *ThreadUpsert) SetHasAttachments(v bool) *ThreadUpsert

SetHasAttachments sets the "has_attachments" field.

func (*ThreadUpsert) SetHistoryLoadedAt

func (u *ThreadUpsert) SetHistoryLoadedAt(v time.Time) *ThreadUpsert

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadUpsert) SetInInbox

func (u *ThreadUpsert) SetInInbox(v bool) *ThreadUpsert

SetInInbox sets the "in_inbox" field.

func (*ThreadUpsert) SetLabels

func (u *ThreadUpsert) SetLabels(v []string) *ThreadUpsert

SetLabels sets the "labels" field.

func (*ThreadUpsert) SetLastMessageAt

func (u *ThreadUpsert) SetLastMessageAt(v time.Time) *ThreadUpsert

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadUpsert) SetMessageCount

func (u *ThreadUpsert) SetMessageCount(v int) *ThreadUpsert

SetMessageCount sets the "message_count" field.

func (*ThreadUpsert) SetParticipants

func (u *ThreadUpsert) SetParticipants(v []string) *ThreadUpsert

SetParticipants sets the "participants" field.

func (*ThreadUpsert) SetProviderThreadID

func (u *ThreadUpsert) SetProviderThreadID(v string) *ThreadUpsert

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadUpsert) SetSnippet

func (u *ThreadUpsert) SetSnippet(v string) *ThreadUpsert

SetSnippet sets the "snippet" field.

func (*ThreadUpsert) SetSnoozedUntil

func (u *ThreadUpsert) SetSnoozedUntil(v time.Time) *ThreadUpsert

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadUpsert) SetStarred

func (u *ThreadUpsert) SetStarred(v bool) *ThreadUpsert

SetStarred sets the "starred" field.

func (*ThreadUpsert) SetSubject

func (u *ThreadUpsert) SetSubject(v string) *ThreadUpsert

SetSubject sets the "subject" field.

func (*ThreadUpsert) SetUnread

func (u *ThreadUpsert) SetUnread(v bool) *ThreadUpsert

SetUnread sets the "unread" field.

func (*ThreadUpsert) UpdateHasAttachments

func (u *ThreadUpsert) UpdateHasAttachments() *ThreadUpsert

UpdateHasAttachments sets the "has_attachments" field to the value that was provided on create.

func (*ThreadUpsert) UpdateHistoryLoadedAt

func (u *ThreadUpsert) UpdateHistoryLoadedAt() *ThreadUpsert

UpdateHistoryLoadedAt sets the "history_loaded_at" field to the value that was provided on create.

func (*ThreadUpsert) UpdateInInbox

func (u *ThreadUpsert) UpdateInInbox() *ThreadUpsert

UpdateInInbox sets the "in_inbox" field to the value that was provided on create.

func (*ThreadUpsert) UpdateLabels

func (u *ThreadUpsert) UpdateLabels() *ThreadUpsert

UpdateLabels sets the "labels" field to the value that was provided on create.

func (*ThreadUpsert) UpdateLastMessageAt

func (u *ThreadUpsert) UpdateLastMessageAt() *ThreadUpsert

UpdateLastMessageAt sets the "last_message_at" field to the value that was provided on create.

func (*ThreadUpsert) UpdateMessageCount

func (u *ThreadUpsert) UpdateMessageCount() *ThreadUpsert

UpdateMessageCount sets the "message_count" field to the value that was provided on create.

func (*ThreadUpsert) UpdateParticipants

func (u *ThreadUpsert) UpdateParticipants() *ThreadUpsert

UpdateParticipants sets the "participants" field to the value that was provided on create.

func (*ThreadUpsert) UpdateProviderThreadID

func (u *ThreadUpsert) UpdateProviderThreadID() *ThreadUpsert

UpdateProviderThreadID sets the "provider_thread_id" field to the value that was provided on create.

func (*ThreadUpsert) UpdateSnippet

func (u *ThreadUpsert) UpdateSnippet() *ThreadUpsert

UpdateSnippet sets the "snippet" field to the value that was provided on create.

func (*ThreadUpsert) UpdateSnoozedUntil

func (u *ThreadUpsert) UpdateSnoozedUntil() *ThreadUpsert

UpdateSnoozedUntil sets the "snoozed_until" field to the value that was provided on create.

func (*ThreadUpsert) UpdateStarred

func (u *ThreadUpsert) UpdateStarred() *ThreadUpsert

UpdateStarred sets the "starred" field to the value that was provided on create.

func (*ThreadUpsert) UpdateSubject

func (u *ThreadUpsert) UpdateSubject() *ThreadUpsert

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*ThreadUpsert) UpdateUnread

func (u *ThreadUpsert) UpdateUnread() *ThreadUpsert

UpdateUnread sets the "unread" field to the value that was provided on create.

type ThreadUpsertBulk

type ThreadUpsertBulk struct {
	// contains filtered or unexported fields
}

ThreadUpsertBulk is the builder for "upsert"-ing a bulk of Thread nodes.

func (*ThreadUpsertBulk) AddMessageCount

func (u *ThreadUpsertBulk) AddMessageCount(v int) *ThreadUpsertBulk

AddMessageCount adds v to the "message_count" field.

func (*ThreadUpsertBulk) ClearHistoryLoadedAt

func (u *ThreadUpsertBulk) ClearHistoryLoadedAt() *ThreadUpsertBulk

ClearHistoryLoadedAt clears the value of the "history_loaded_at" field.

func (*ThreadUpsertBulk) ClearSnoozedUntil

func (u *ThreadUpsertBulk) ClearSnoozedUntil() *ThreadUpsertBulk

ClearSnoozedUntil clears the value of the "snoozed_until" field.

func (*ThreadUpsertBulk) DoNothing

func (u *ThreadUpsertBulk) DoNothing() *ThreadUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ThreadUpsertBulk) Exec

func (u *ThreadUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ThreadUpsertBulk) ExecX

func (u *ThreadUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadUpsertBulk) Ignore

func (u *ThreadUpsertBulk) Ignore() *ThreadUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Thread.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ThreadUpsertBulk) SetHasAttachments

func (u *ThreadUpsertBulk) SetHasAttachments(v bool) *ThreadUpsertBulk

SetHasAttachments sets the "has_attachments" field.

func (*ThreadUpsertBulk) SetHistoryLoadedAt

func (u *ThreadUpsertBulk) SetHistoryLoadedAt(v time.Time) *ThreadUpsertBulk

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadUpsertBulk) SetInInbox

func (u *ThreadUpsertBulk) SetInInbox(v bool) *ThreadUpsertBulk

SetInInbox sets the "in_inbox" field.

func (*ThreadUpsertBulk) SetLabels

func (u *ThreadUpsertBulk) SetLabels(v []string) *ThreadUpsertBulk

SetLabels sets the "labels" field.

func (*ThreadUpsertBulk) SetLastMessageAt

func (u *ThreadUpsertBulk) SetLastMessageAt(v time.Time) *ThreadUpsertBulk

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadUpsertBulk) SetMessageCount

func (u *ThreadUpsertBulk) SetMessageCount(v int) *ThreadUpsertBulk

SetMessageCount sets the "message_count" field.

func (*ThreadUpsertBulk) SetParticipants

func (u *ThreadUpsertBulk) SetParticipants(v []string) *ThreadUpsertBulk

SetParticipants sets the "participants" field.

func (*ThreadUpsertBulk) SetProviderThreadID

func (u *ThreadUpsertBulk) SetProviderThreadID(v string) *ThreadUpsertBulk

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadUpsertBulk) SetSnippet

func (u *ThreadUpsertBulk) SetSnippet(v string) *ThreadUpsertBulk

SetSnippet sets the "snippet" field.

func (*ThreadUpsertBulk) SetSnoozedUntil

func (u *ThreadUpsertBulk) SetSnoozedUntil(v time.Time) *ThreadUpsertBulk

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadUpsertBulk) SetStarred

func (u *ThreadUpsertBulk) SetStarred(v bool) *ThreadUpsertBulk

SetStarred sets the "starred" field.

func (*ThreadUpsertBulk) SetSubject

func (u *ThreadUpsertBulk) SetSubject(v string) *ThreadUpsertBulk

SetSubject sets the "subject" field.

func (*ThreadUpsertBulk) SetUnread

func (u *ThreadUpsertBulk) SetUnread(v bool) *ThreadUpsertBulk

SetUnread sets the "unread" field.

func (*ThreadUpsertBulk) Update

func (u *ThreadUpsertBulk) Update(set func(*ThreadUpsert)) *ThreadUpsertBulk

Update allows overriding fields `UPDATE` values. See the ThreadCreateBulk.OnConflict documentation for more info.

func (*ThreadUpsertBulk) UpdateHasAttachments

func (u *ThreadUpsertBulk) UpdateHasAttachments() *ThreadUpsertBulk

UpdateHasAttachments sets the "has_attachments" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateHistoryLoadedAt

func (u *ThreadUpsertBulk) UpdateHistoryLoadedAt() *ThreadUpsertBulk

UpdateHistoryLoadedAt sets the "history_loaded_at" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateInInbox

func (u *ThreadUpsertBulk) UpdateInInbox() *ThreadUpsertBulk

UpdateInInbox sets the "in_inbox" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateLabels

func (u *ThreadUpsertBulk) UpdateLabels() *ThreadUpsertBulk

UpdateLabels sets the "labels" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateLastMessageAt

func (u *ThreadUpsertBulk) UpdateLastMessageAt() *ThreadUpsertBulk

UpdateLastMessageAt sets the "last_message_at" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateMessageCount

func (u *ThreadUpsertBulk) UpdateMessageCount() *ThreadUpsertBulk

UpdateMessageCount sets the "message_count" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateNewValues

func (u *ThreadUpsertBulk) UpdateNewValues() *ThreadUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Thread.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ThreadUpsertBulk) UpdateParticipants

func (u *ThreadUpsertBulk) UpdateParticipants() *ThreadUpsertBulk

UpdateParticipants sets the "participants" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateProviderThreadID

func (u *ThreadUpsertBulk) UpdateProviderThreadID() *ThreadUpsertBulk

UpdateProviderThreadID sets the "provider_thread_id" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateSnippet

func (u *ThreadUpsertBulk) UpdateSnippet() *ThreadUpsertBulk

UpdateSnippet sets the "snippet" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateSnoozedUntil

func (u *ThreadUpsertBulk) UpdateSnoozedUntil() *ThreadUpsertBulk

UpdateSnoozedUntil sets the "snoozed_until" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateStarred

func (u *ThreadUpsertBulk) UpdateStarred() *ThreadUpsertBulk

UpdateStarred sets the "starred" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateSubject

func (u *ThreadUpsertBulk) UpdateSubject() *ThreadUpsertBulk

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*ThreadUpsertBulk) UpdateUnread

func (u *ThreadUpsertBulk) UpdateUnread() *ThreadUpsertBulk

UpdateUnread sets the "unread" field to the value that was provided on create.

type ThreadUpsertOne

type ThreadUpsertOne struct {
	// contains filtered or unexported fields
}

ThreadUpsertOne is the builder for "upsert"-ing

one Thread node.

func (*ThreadUpsertOne) AddMessageCount

func (u *ThreadUpsertOne) AddMessageCount(v int) *ThreadUpsertOne

AddMessageCount adds v to the "message_count" field.

func (*ThreadUpsertOne) ClearHistoryLoadedAt

func (u *ThreadUpsertOne) ClearHistoryLoadedAt() *ThreadUpsertOne

ClearHistoryLoadedAt clears the value of the "history_loaded_at" field.

func (*ThreadUpsertOne) ClearSnoozedUntil

func (u *ThreadUpsertOne) ClearSnoozedUntil() *ThreadUpsertOne

ClearSnoozedUntil clears the value of the "snoozed_until" field.

func (*ThreadUpsertOne) DoNothing

func (u *ThreadUpsertOne) DoNothing() *ThreadUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ThreadUpsertOne) Exec

func (u *ThreadUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ThreadUpsertOne) ExecX

func (u *ThreadUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThreadUpsertOne) ID

func (u *ThreadUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ThreadUpsertOne) IDX

func (u *ThreadUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ThreadUpsertOne) Ignore

func (u *ThreadUpsertOne) Ignore() *ThreadUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Thread.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ThreadUpsertOne) SetHasAttachments

func (u *ThreadUpsertOne) SetHasAttachments(v bool) *ThreadUpsertOne

SetHasAttachments sets the "has_attachments" field.

func (*ThreadUpsertOne) SetHistoryLoadedAt

func (u *ThreadUpsertOne) SetHistoryLoadedAt(v time.Time) *ThreadUpsertOne

SetHistoryLoadedAt sets the "history_loaded_at" field.

func (*ThreadUpsertOne) SetInInbox

func (u *ThreadUpsertOne) SetInInbox(v bool) *ThreadUpsertOne

SetInInbox sets the "in_inbox" field.

func (*ThreadUpsertOne) SetLabels

func (u *ThreadUpsertOne) SetLabels(v []string) *ThreadUpsertOne

SetLabels sets the "labels" field.

func (*ThreadUpsertOne) SetLastMessageAt

func (u *ThreadUpsertOne) SetLastMessageAt(v time.Time) *ThreadUpsertOne

SetLastMessageAt sets the "last_message_at" field.

func (*ThreadUpsertOne) SetMessageCount

func (u *ThreadUpsertOne) SetMessageCount(v int) *ThreadUpsertOne

SetMessageCount sets the "message_count" field.

func (*ThreadUpsertOne) SetParticipants

func (u *ThreadUpsertOne) SetParticipants(v []string) *ThreadUpsertOne

SetParticipants sets the "participants" field.

func (*ThreadUpsertOne) SetProviderThreadID

func (u *ThreadUpsertOne) SetProviderThreadID(v string) *ThreadUpsertOne

SetProviderThreadID sets the "provider_thread_id" field.

func (*ThreadUpsertOne) SetSnippet

func (u *ThreadUpsertOne) SetSnippet(v string) *ThreadUpsertOne

SetSnippet sets the "snippet" field.

func (*ThreadUpsertOne) SetSnoozedUntil

func (u *ThreadUpsertOne) SetSnoozedUntil(v time.Time) *ThreadUpsertOne

SetSnoozedUntil sets the "snoozed_until" field.

func (*ThreadUpsertOne) SetStarred

func (u *ThreadUpsertOne) SetStarred(v bool) *ThreadUpsertOne

SetStarred sets the "starred" field.

func (*ThreadUpsertOne) SetSubject

func (u *ThreadUpsertOne) SetSubject(v string) *ThreadUpsertOne

SetSubject sets the "subject" field.

func (*ThreadUpsertOne) SetUnread

func (u *ThreadUpsertOne) SetUnread(v bool) *ThreadUpsertOne

SetUnread sets the "unread" field.

func (*ThreadUpsertOne) Update

func (u *ThreadUpsertOne) Update(set func(*ThreadUpsert)) *ThreadUpsertOne

Update allows overriding fields `UPDATE` values. See the ThreadCreate.OnConflict documentation for more info.

func (*ThreadUpsertOne) UpdateHasAttachments

func (u *ThreadUpsertOne) UpdateHasAttachments() *ThreadUpsertOne

UpdateHasAttachments sets the "has_attachments" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateHistoryLoadedAt

func (u *ThreadUpsertOne) UpdateHistoryLoadedAt() *ThreadUpsertOne

UpdateHistoryLoadedAt sets the "history_loaded_at" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateInInbox

func (u *ThreadUpsertOne) UpdateInInbox() *ThreadUpsertOne

UpdateInInbox sets the "in_inbox" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateLabels

func (u *ThreadUpsertOne) UpdateLabels() *ThreadUpsertOne

UpdateLabels sets the "labels" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateLastMessageAt

func (u *ThreadUpsertOne) UpdateLastMessageAt() *ThreadUpsertOne

UpdateLastMessageAt sets the "last_message_at" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateMessageCount

func (u *ThreadUpsertOne) UpdateMessageCount() *ThreadUpsertOne

UpdateMessageCount sets the "message_count" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateNewValues

func (u *ThreadUpsertOne) UpdateNewValues() *ThreadUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Thread.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ThreadUpsertOne) UpdateParticipants

func (u *ThreadUpsertOne) UpdateParticipants() *ThreadUpsertOne

UpdateParticipants sets the "participants" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateProviderThreadID

func (u *ThreadUpsertOne) UpdateProviderThreadID() *ThreadUpsertOne

UpdateProviderThreadID sets the "provider_thread_id" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateSnippet

func (u *ThreadUpsertOne) UpdateSnippet() *ThreadUpsertOne

UpdateSnippet sets the "snippet" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateSnoozedUntil

func (u *ThreadUpsertOne) UpdateSnoozedUntil() *ThreadUpsertOne

UpdateSnoozedUntil sets the "snoozed_until" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateStarred

func (u *ThreadUpsertOne) UpdateStarred() *ThreadUpsertOne

UpdateStarred sets the "starred" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateSubject

func (u *ThreadUpsertOne) UpdateSubject() *ThreadUpsertOne

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*ThreadUpsertOne) UpdateUnread

func (u *ThreadUpsertOne) UpdateUnread() *ThreadUpsertOne

UpdateUnread sets the "unread" field to the value that was provided on create.

type Threads

type Threads []*Thread

Threads is a parsable slice of Thread.

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 {

	// Account is the client for interacting with the Account builders.
	Account *AccountClient
	// Contact is the client for interacting with the Contact builders.
	Contact *ContactClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// NotifyRule is the client for interacting with the NotifyRule builders.
	NotifyRule *NotifyRuleClient
	// PendingOp is the client for interacting with the PendingOp builders.
	PendingOp *PendingOpClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// Thread is the client for interacting with the Thread builders.
	Thread *ThreadClient
	// 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 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