ent

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 21 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.
	TypeEmailLog = "EmailLog"
	TypeSmsLog   = "SmsLog"
)

Variables

View Source
var DefaultEmailLogOrder = Desc(emaillog.FieldID)

DefaultEmailLogOrder is the default ordering of EmailLog.

View Source
var DefaultSmsLogOrder = Desc(smslog.FieldID)

DefaultSmsLogOrder is the default ordering of SmsLog.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// EmailLog is the client for interacting with the EmailLog builders.
	EmailLog *EmailLogClient
	// SmsLog is the client for interacting with the SmsLog builders.
	SmsLog *SmsLogClient
	// 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().
	EmailLog.
	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 EmailLog

type EmailLog struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The target email address | 目标邮箱地址
	Target string `json:"target,omitempty"`
	// The subject | 发送的标题
	Subject string `json:"subject,omitempty"`
	// The content | 发送的内容
	Content string `json:"content,omitempty"`
	// The send status, 0 unknown 1 success 2 failed | 发送的状态, 0 未知, 1 成功, 2 失败
	SendStatus uint8 `json:"send_status,omitempty"`
	// contains filtered or unexported fields
}

EmailLog is the model entity for the EmailLog schema.

func (*EmailLog) ExecContext

func (c *EmailLog) 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 (*EmailLog) QueryContext

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

func (el *EmailLog) String() string

String implements the fmt.Stringer.

func (*EmailLog) Unwrap

func (el *EmailLog) Unwrap() *EmailLog

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

func (el *EmailLog) Update() *EmailLogUpdateOne

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

func (*EmailLog) Value

func (el *EmailLog) Value(name string) (ent.Value, error)

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

type EmailLogClient

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

EmailLogClient is a client for the EmailLog schema.

func NewEmailLogClient

func NewEmailLogClient(c config) *EmailLogClient

NewEmailLogClient returns a client for the EmailLog from the given config.

func (*EmailLogClient) Create

func (c *EmailLogClient) Create() *EmailLogCreate

Create returns a builder for creating a EmailLog entity.

func (*EmailLogClient) CreateBulk

func (c *EmailLogClient) CreateBulk(builders ...*EmailLogCreate) *EmailLogCreateBulk

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

func (*EmailLogClient) Delete

func (c *EmailLogClient) Delete() *EmailLogDelete

Delete returns a delete builder for EmailLog.

func (*EmailLogClient) DeleteOne

func (c *EmailLogClient) DeleteOne(el *EmailLog) *EmailLogDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EmailLogClient) DeleteOneID

func (c *EmailLogClient) DeleteOneID(id uuid.UUID) *EmailLogDeleteOne

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

func (*EmailLogClient) ExecContext

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

func (c *EmailLogClient) Get(ctx context.Context, id uuid.UUID) (*EmailLog, error)

Get returns a EmailLog entity by its id.

func (*EmailLogClient) GetX

func (c *EmailLogClient) GetX(ctx context.Context, id uuid.UUID) *EmailLog

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

func (*EmailLogClient) Hooks

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

Hooks returns the client hooks.

func (*EmailLogClient) Intercept

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

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

func (*EmailLogClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EmailLogClient) Query

func (c *EmailLogClient) Query() *EmailLogQuery

Query returns a query builder for EmailLog.

func (*EmailLogClient) QueryContext

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

func (c *EmailLogClient) Update() *EmailLogUpdate

Update returns an update builder for EmailLog.

func (*EmailLogClient) UpdateOne

func (c *EmailLogClient) UpdateOne(el *EmailLog) *EmailLogUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EmailLogClient) UpdateOneID

func (c *EmailLogClient) UpdateOneID(id uuid.UUID) *EmailLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EmailLogClient) Use

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

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

type EmailLogCreate

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

EmailLogCreate is the builder for creating a EmailLog entity.

func (*EmailLogCreate) Exec

func (elc *EmailLogCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmailLogCreate) ExecContext

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

func (elc *EmailLogCreate) ExecX(ctx context.Context)

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

func (*EmailLogCreate) Mutation

func (elc *EmailLogCreate) Mutation() *EmailLogMutation

Mutation returns the EmailLogMutation object of the builder.

func (*EmailLogCreate) QueryContext

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

func (elc *EmailLogCreate) Save(ctx context.Context) (*EmailLog, error)

Save creates the EmailLog in the database.

func (*EmailLogCreate) SaveX

func (elc *EmailLogCreate) SaveX(ctx context.Context) *EmailLog

SaveX calls Save and panics if Save returns an error.

func (*EmailLogCreate) SetContent

func (elc *EmailLogCreate) SetContent(s string) *EmailLogCreate

SetContent sets the "content" field.

func (*EmailLogCreate) SetCreatedAt

func (elc *EmailLogCreate) SetCreatedAt(t time.Time) *EmailLogCreate

SetCreatedAt sets the "created_at" field.

func (*EmailLogCreate) SetID

func (elc *EmailLogCreate) SetID(u uuid.UUID) *EmailLogCreate

SetID sets the "id" field.

func (*EmailLogCreate) SetNillableCreatedAt

func (elc *EmailLogCreate) SetNillableCreatedAt(t *time.Time) *EmailLogCreate

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

func (*EmailLogCreate) SetNillableID

func (elc *EmailLogCreate) SetNillableID(u *uuid.UUID) *EmailLogCreate

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

func (*EmailLogCreate) SetNillableUpdatedAt

func (elc *EmailLogCreate) SetNillableUpdatedAt(t *time.Time) *EmailLogCreate

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

func (*EmailLogCreate) SetNotNilContent

func (el *EmailLogCreate) SetNotNilContent(value *string) *EmailLogCreate

set field if value's pointer is not nil.

func (*EmailLogCreate) SetNotNilSendStatus

func (el *EmailLogCreate) SetNotNilSendStatus(value *uint8) *EmailLogCreate

set field if value's pointer is not nil.

func (*EmailLogCreate) SetNotNilSubject

func (el *EmailLogCreate) SetNotNilSubject(value *string) *EmailLogCreate

set field if value's pointer is not nil.

func (*EmailLogCreate) SetNotNilTarget

func (el *EmailLogCreate) SetNotNilTarget(value *string) *EmailLogCreate

set field if value's pointer is not nil.

func (*EmailLogCreate) SetNotNilUpdatedAt

func (el *EmailLogCreate) SetNotNilUpdatedAt(value *time.Time) *EmailLogCreate

set field if value's pointer is not nil.

func (*EmailLogCreate) SetSendStatus

func (elc *EmailLogCreate) SetSendStatus(u uint8) *EmailLogCreate

SetSendStatus sets the "send_status" field.

func (*EmailLogCreate) SetSubject

func (elc *EmailLogCreate) SetSubject(s string) *EmailLogCreate

SetSubject sets the "subject" field.

func (*EmailLogCreate) SetTarget

func (elc *EmailLogCreate) SetTarget(s string) *EmailLogCreate

SetTarget sets the "target" field.

func (*EmailLogCreate) SetUpdatedAt

func (elc *EmailLogCreate) SetUpdatedAt(t time.Time) *EmailLogCreate

SetUpdatedAt sets the "updated_at" field.

type EmailLogCreateBulk

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

EmailLogCreateBulk is the builder for creating many EmailLog entities in bulk.

func (*EmailLogCreateBulk) Exec

func (elcb *EmailLogCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EmailLogCreateBulk) ExecContext

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

func (elcb *EmailLogCreateBulk) ExecX(ctx context.Context)

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

func (*EmailLogCreateBulk) QueryContext

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

func (elcb *EmailLogCreateBulk) Save(ctx context.Context) ([]*EmailLog, error)

Save creates the EmailLog entities in the database.

func (*EmailLogCreateBulk) SaveX

func (elcb *EmailLogCreateBulk) SaveX(ctx context.Context) []*EmailLog

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

type EmailLogDelete

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

EmailLogDelete is the builder for deleting a EmailLog entity.

func (*EmailLogDelete) Exec

func (eld *EmailLogDelete) Exec(ctx context.Context) (int, error)

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

func (*EmailLogDelete) ExecContext

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

func (eld *EmailLogDelete) ExecX(ctx context.Context) int

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

func (*EmailLogDelete) QueryContext

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

func (eld *EmailLogDelete) Where(ps ...predicate.EmailLog) *EmailLogDelete

Where appends a list predicates to the EmailLogDelete builder.

type EmailLogDeleteOne

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

EmailLogDeleteOne is the builder for deleting a single EmailLog entity.

func (*EmailLogDeleteOne) Exec

func (eldo *EmailLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EmailLogDeleteOne) ExecX

func (eldo *EmailLogDeleteOne) ExecX(ctx context.Context)

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

func (*EmailLogDeleteOne) Where

Where appends a list predicates to the EmailLogDelete builder.

type EmailLogGroupBy

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

EmailLogGroupBy is the group-by builder for EmailLog entities.

func (*EmailLogGroupBy) Aggregate

func (elgb *EmailLogGroupBy) Aggregate(fns ...AggregateFunc) *EmailLogGroupBy

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

func (*EmailLogGroupBy) Bool

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

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

func (*EmailLogGroupBy) BoolX

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

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

func (*EmailLogGroupBy) Bools

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

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

func (*EmailLogGroupBy) BoolsX

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

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

func (*EmailLogGroupBy) Float64

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

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

func (*EmailLogGroupBy) Float64X

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

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

func (*EmailLogGroupBy) Float64s

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

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

func (*EmailLogGroupBy) Float64sX

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

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

func (*EmailLogGroupBy) Int

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

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

func (*EmailLogGroupBy) IntX

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

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

func (*EmailLogGroupBy) Ints

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

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

func (*EmailLogGroupBy) IntsX

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

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

func (*EmailLogGroupBy) Scan

func (elgb *EmailLogGroupBy) Scan(ctx context.Context, v any) error

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

func (*EmailLogGroupBy) ScanX

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

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

func (*EmailLogGroupBy) String

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

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

func (*EmailLogGroupBy) StringX

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

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

func (*EmailLogGroupBy) Strings

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

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

func (*EmailLogGroupBy) StringsX

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

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

type EmailLogMutation

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

EmailLogMutation represents an operation that mutates the EmailLog nodes in the graph.

func (*EmailLogMutation) AddField

func (m *EmailLogMutation) 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 (*EmailLogMutation) AddSendStatus

func (m *EmailLogMutation) AddSendStatus(u int8)

AddSendStatus adds u to the "send_status" field.

func (*EmailLogMutation) AddedEdges

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

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

func (*EmailLogMutation) AddedField

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

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

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

func (*EmailLogMutation) AddedIDs

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

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

func (*EmailLogMutation) AddedSendStatus

func (m *EmailLogMutation) AddedSendStatus() (r int8, exists bool)

AddedSendStatus returns the value that was added to the "send_status" field in this mutation.

func (*EmailLogMutation) ClearEdge

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

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

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

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

func (*EmailLogMutation) ClearedFields

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

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

func (EmailLogMutation) Client

func (m EmailLogMutation) 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 (*EmailLogMutation) Content

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

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

func (*EmailLogMutation) CreatedAt

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

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

func (*EmailLogMutation) EdgeCleared

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

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

func (*EmailLogMutation) ExecContext

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

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

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

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

func (*EmailLogMutation) Fields

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

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

func (m *EmailLogMutation) 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 (*EmailLogMutation) OldContent

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

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

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

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

func (m *EmailLogMutation) 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 (*EmailLogMutation) OldSendStatus

func (m *EmailLogMutation) OldSendStatus(ctx context.Context) (v uint8, err error)

OldSendStatus returns the old "send_status" field's value of the EmailLog entity. If the EmailLog 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 (*EmailLogMutation) OldSubject

func (m *EmailLogMutation) OldSubject(ctx context.Context) (v string, err error)

OldSubject returns the old "subject" field's value of the EmailLog entity. If the EmailLog 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 (*EmailLogMutation) OldTarget

func (m *EmailLogMutation) OldTarget(ctx context.Context) (v string, err error)

OldTarget returns the old "target" field's value of the EmailLog entity. If the EmailLog 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 (*EmailLogMutation) OldUpdatedAt

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

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

func (m *EmailLogMutation) Op() Op

Op returns the operation name.

func (*EmailLogMutation) QueryContext

func (c *EmailLogMutation) 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 (*EmailLogMutation) RemovedEdges

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

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

func (*EmailLogMutation) RemovedIDs

func (m *EmailLogMutation) 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 (*EmailLogMutation) ResetContent

func (m *EmailLogMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*EmailLogMutation) ResetCreatedAt

func (m *EmailLogMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EmailLogMutation) ResetEdge

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

func (m *EmailLogMutation) 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 (*EmailLogMutation) ResetSendStatus

func (m *EmailLogMutation) ResetSendStatus()

ResetSendStatus resets all changes to the "send_status" field.

func (*EmailLogMutation) ResetSubject

func (m *EmailLogMutation) ResetSubject()

ResetSubject resets all changes to the "subject" field.

func (*EmailLogMutation) ResetTarget

func (m *EmailLogMutation) ResetTarget()

ResetTarget resets all changes to the "target" field.

func (*EmailLogMutation) ResetUpdatedAt

func (m *EmailLogMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*EmailLogMutation) SendStatus

func (m *EmailLogMutation) SendStatus() (r uint8, exists bool)

SendStatus returns the value of the "send_status" field in the mutation.

func (*EmailLogMutation) SetContent

func (m *EmailLogMutation) SetContent(s string)

SetContent sets the "content" field.

func (*EmailLogMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*EmailLogMutation) SetField

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

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

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

func (*EmailLogMutation) SetOp

func (m *EmailLogMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EmailLogMutation) SetSendStatus

func (m *EmailLogMutation) SetSendStatus(u uint8)

SetSendStatus sets the "send_status" field.

func (*EmailLogMutation) SetSubject

func (m *EmailLogMutation) SetSubject(s string)

SetSubject sets the "subject" field.

func (*EmailLogMutation) SetTarget

func (m *EmailLogMutation) SetTarget(s string)

SetTarget sets the "target" field.

func (*EmailLogMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*EmailLogMutation) Subject

func (m *EmailLogMutation) Subject() (r string, exists bool)

Subject returns the value of the "subject" field in the mutation.

func (*EmailLogMutation) Target

func (m *EmailLogMutation) Target() (r string, exists bool)

Target returns the value of the "target" field in the mutation.

func (EmailLogMutation) Tx

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

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

func (*EmailLogMutation) Type

func (m *EmailLogMutation) Type() string

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

func (*EmailLogMutation) UpdatedAt

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

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

func (*EmailLogMutation) Where

func (m *EmailLogMutation) Where(ps ...predicate.EmailLog)

Where appends a list predicates to the EmailLogMutation builder.

func (*EmailLogMutation) WhereP

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

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

type EmailLogPageList

type EmailLogPageList struct {
	List        []*EmailLog  `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

EmailLogPageList is EmailLog PageList result.

type EmailLogPager

type EmailLogPager struct {
	Order  emaillog.OrderOption
	Filter func(*EmailLogQuery) (*EmailLogQuery, error)
}

func (*EmailLogPager) ApplyFilter

func (p *EmailLogPager) ApplyFilter(query *EmailLogQuery) (*EmailLogQuery, error)

type EmailLogPaginateOption

type EmailLogPaginateOption func(*EmailLogPager)

EmailLogPaginateOption enables pagination customization.

type EmailLogQuery

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

EmailLogQuery is the builder for querying EmailLog entities.

func (*EmailLogQuery) Aggregate

func (elq *EmailLogQuery) Aggregate(fns ...AggregateFunc) *EmailLogSelect

Aggregate returns a EmailLogSelect configured with the given aggregations.

func (*EmailLogQuery) All

func (elq *EmailLogQuery) All(ctx context.Context) ([]*EmailLog, error)

All executes the query and returns a list of EmailLogs.

func (*EmailLogQuery) AllX

func (elq *EmailLogQuery) AllX(ctx context.Context) []*EmailLog

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

func (*EmailLogQuery) Clone

func (elq *EmailLogQuery) Clone() *EmailLogQuery

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

func (*EmailLogQuery) Count

func (elq *EmailLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EmailLogQuery) CountX

func (elq *EmailLogQuery) CountX(ctx context.Context) int

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

func (*EmailLogQuery) ExecContext

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

func (elq *EmailLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*EmailLogQuery) ExistX

func (elq *EmailLogQuery) ExistX(ctx context.Context) bool

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

func (*EmailLogQuery) First

func (elq *EmailLogQuery) First(ctx context.Context) (*EmailLog, error)

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

func (*EmailLogQuery) FirstID

func (elq *EmailLogQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EmailLogQuery) FirstIDX

func (elq *EmailLogQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*EmailLogQuery) FirstX

func (elq *EmailLogQuery) FirstX(ctx context.Context) *EmailLog

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

func (*EmailLogQuery) GroupBy

func (elq *EmailLogQuery) GroupBy(field string, fields ...string) *EmailLogGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EmailLog.Query().
	GroupBy(emaillog.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EmailLogQuery) IDs

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

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

func (*EmailLogQuery) IDsX

func (elq *EmailLogQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*EmailLogQuery) Limit

func (elq *EmailLogQuery) Limit(limit int) *EmailLogQuery

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

func (*EmailLogQuery) Offset

func (elq *EmailLogQuery) Offset(offset int) *EmailLogQuery

Offset to start from.

func (*EmailLogQuery) Only

func (elq *EmailLogQuery) Only(ctx context.Context) (*EmailLog, error)

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

func (*EmailLogQuery) OnlyID

func (elq *EmailLogQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EmailLogQuery) OnlyIDX

func (elq *EmailLogQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*EmailLogQuery) OnlyX

func (elq *EmailLogQuery) OnlyX(ctx context.Context) *EmailLog

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

func (*EmailLogQuery) Order

func (elq *EmailLogQuery) Order(o ...emaillog.OrderOption) *EmailLogQuery

Order specifies how the records should be ordered.

func (*EmailLogQuery) Page

func (el *EmailLogQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...EmailLogPaginateOption,
) (*EmailLogPageList, error)

func (*EmailLogQuery) QueryContext

func (c *EmailLogQuery) 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 (*EmailLogQuery) Select

func (elq *EmailLogQuery) Select(fields ...string) *EmailLogSelect

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.EmailLog.Query().
	Select(emaillog.FieldCreatedAt).
	Scan(ctx, &v)

func (*EmailLogQuery) Unique

func (elq *EmailLogQuery) Unique(unique bool) *EmailLogQuery

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

func (elq *EmailLogQuery) Where(ps ...predicate.EmailLog) *EmailLogQuery

Where adds a new predicate for the EmailLogQuery builder.

type EmailLogSelect

type EmailLogSelect struct {
	*EmailLogQuery
	// contains filtered or unexported fields
}

EmailLogSelect is the builder for selecting fields of EmailLog entities.

func (*EmailLogSelect) Aggregate

func (els *EmailLogSelect) Aggregate(fns ...AggregateFunc) *EmailLogSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EmailLogSelect) Bool

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

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

func (*EmailLogSelect) BoolX

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

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

func (*EmailLogSelect) Bools

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

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

func (*EmailLogSelect) BoolsX

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

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

func (EmailLogSelect) ExecContext

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

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

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

func (*EmailLogSelect) Float64X

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

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

func (*EmailLogSelect) Float64s

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

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

func (*EmailLogSelect) Float64sX

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

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

func (*EmailLogSelect) Int

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

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

func (*EmailLogSelect) IntX

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

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

func (*EmailLogSelect) Ints

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

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

func (*EmailLogSelect) IntsX

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

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

func (EmailLogSelect) QueryContext

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

func (els *EmailLogSelect) Scan(ctx context.Context, v any) error

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

func (*EmailLogSelect) ScanX

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

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

func (*EmailLogSelect) String

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

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

func (*EmailLogSelect) StringX

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

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

func (*EmailLogSelect) Strings

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

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

func (*EmailLogSelect) StringsX

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

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

type EmailLogUpdate

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

EmailLogUpdate is the builder for updating EmailLog entities.

func (*EmailLogUpdate) AddSendStatus

func (elu *EmailLogUpdate) AddSendStatus(u int8) *EmailLogUpdate

AddSendStatus adds u to the "send_status" field.

func (*EmailLogUpdate) Exec

func (elu *EmailLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmailLogUpdate) ExecContext

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

func (elu *EmailLogUpdate) ExecX(ctx context.Context)

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

func (*EmailLogUpdate) Mutation

func (elu *EmailLogUpdate) Mutation() *EmailLogMutation

Mutation returns the EmailLogMutation object of the builder.

func (*EmailLogUpdate) QueryContext

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

func (elu *EmailLogUpdate) Save(ctx context.Context) (int, error)

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

func (*EmailLogUpdate) SaveX

func (elu *EmailLogUpdate) SaveX(ctx context.Context) int

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

func (*EmailLogUpdate) SetContent

func (elu *EmailLogUpdate) SetContent(s string) *EmailLogUpdate

SetContent sets the "content" field.

func (*EmailLogUpdate) SetNotNilContent

func (el *EmailLogUpdate) SetNotNilContent(value *string) *EmailLogUpdate

set field if value's pointer is not nil.

func (*EmailLogUpdate) SetNotNilSendStatus

func (el *EmailLogUpdate) SetNotNilSendStatus(value *uint8) *EmailLogUpdate

set field if value's pointer is not nil.

func (*EmailLogUpdate) SetNotNilSubject

func (el *EmailLogUpdate) SetNotNilSubject(value *string) *EmailLogUpdate

set field if value's pointer is not nil.

func (*EmailLogUpdate) SetNotNilTarget

func (el *EmailLogUpdate) SetNotNilTarget(value *string) *EmailLogUpdate

set field if value's pointer is not nil.

func (*EmailLogUpdate) SetNotNilUpdatedAt

func (el *EmailLogUpdate) SetNotNilUpdatedAt(value *time.Time) *EmailLogUpdate

set field if value's pointer is not nil.

func (*EmailLogUpdate) SetSendStatus

func (elu *EmailLogUpdate) SetSendStatus(u uint8) *EmailLogUpdate

SetSendStatus sets the "send_status" field.

func (*EmailLogUpdate) SetSubject

func (elu *EmailLogUpdate) SetSubject(s string) *EmailLogUpdate

SetSubject sets the "subject" field.

func (*EmailLogUpdate) SetTarget

func (elu *EmailLogUpdate) SetTarget(s string) *EmailLogUpdate

SetTarget sets the "target" field.

func (*EmailLogUpdate) SetUpdatedAt

func (elu *EmailLogUpdate) SetUpdatedAt(t time.Time) *EmailLogUpdate

SetUpdatedAt sets the "updated_at" field.

func (*EmailLogUpdate) Where

func (elu *EmailLogUpdate) Where(ps ...predicate.EmailLog) *EmailLogUpdate

Where appends a list predicates to the EmailLogUpdate builder.

type EmailLogUpdateOne

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

EmailLogUpdateOne is the builder for updating a single EmailLog entity.

func (*EmailLogUpdateOne) AddSendStatus

func (eluo *EmailLogUpdateOne) AddSendStatus(u int8) *EmailLogUpdateOne

AddSendStatus adds u to the "send_status" field.

func (*EmailLogUpdateOne) Exec

func (eluo *EmailLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EmailLogUpdateOne) ExecContext

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

func (eluo *EmailLogUpdateOne) ExecX(ctx context.Context)

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

func (*EmailLogUpdateOne) Mutation

func (eluo *EmailLogUpdateOne) Mutation() *EmailLogMutation

Mutation returns the EmailLogMutation object of the builder.

func (*EmailLogUpdateOne) QueryContext

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

func (eluo *EmailLogUpdateOne) Save(ctx context.Context) (*EmailLog, error)

Save executes the query and returns the updated EmailLog entity.

func (*EmailLogUpdateOne) SaveX

func (eluo *EmailLogUpdateOne) SaveX(ctx context.Context) *EmailLog

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

func (*EmailLogUpdateOne) Select

func (eluo *EmailLogUpdateOne) Select(field string, fields ...string) *EmailLogUpdateOne

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

func (*EmailLogUpdateOne) SetContent

func (eluo *EmailLogUpdateOne) SetContent(s string) *EmailLogUpdateOne

SetContent sets the "content" field.

func (*EmailLogUpdateOne) SetNotNilContent

func (el *EmailLogUpdateOne) SetNotNilContent(value *string) *EmailLogUpdateOne

set field if value's pointer is not nil.

func (*EmailLogUpdateOne) SetNotNilSendStatus

func (el *EmailLogUpdateOne) SetNotNilSendStatus(value *uint8) *EmailLogUpdateOne

set field if value's pointer is not nil.

func (*EmailLogUpdateOne) SetNotNilSubject

func (el *EmailLogUpdateOne) SetNotNilSubject(value *string) *EmailLogUpdateOne

set field if value's pointer is not nil.

func (*EmailLogUpdateOne) SetNotNilTarget

func (el *EmailLogUpdateOne) SetNotNilTarget(value *string) *EmailLogUpdateOne

set field if value's pointer is not nil.

func (*EmailLogUpdateOne) SetNotNilUpdatedAt

func (el *EmailLogUpdateOne) SetNotNilUpdatedAt(value *time.Time) *EmailLogUpdateOne

set field if value's pointer is not nil.

func (*EmailLogUpdateOne) SetSendStatus

func (eluo *EmailLogUpdateOne) SetSendStatus(u uint8) *EmailLogUpdateOne

SetSendStatus sets the "send_status" field.

func (*EmailLogUpdateOne) SetSubject

func (eluo *EmailLogUpdateOne) SetSubject(s string) *EmailLogUpdateOne

SetSubject sets the "subject" field.

func (*EmailLogUpdateOne) SetTarget

func (eluo *EmailLogUpdateOne) SetTarget(s string) *EmailLogUpdateOne

SetTarget sets the "target" field.

func (*EmailLogUpdateOne) SetUpdatedAt

func (eluo *EmailLogUpdateOne) SetUpdatedAt(t time.Time) *EmailLogUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*EmailLogUpdateOne) Where

Where appends a list predicates to the EmailLogUpdate builder.

type EmailLogs

type EmailLogs []*EmailLog

EmailLogs is a parsable slice of EmailLog.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

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 PageDetails

type PageDetails struct {
	Page  uint64 `json:"page"`
	Size  uint64 `json:"size"`
	Total uint64 `json:"total"`
}

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 SmsLog

type SmsLog struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The target phone number | 目标电话
	PhoneNumber string `json:"phone_number,omitempty"`
	// The content | 发送的内容
	Content string `json:"content,omitempty"`
	// The send status, 0 unknown 1 success 2 failed | 发送的状态, 0 未知, 1 成功, 2 失败
	SendStatus uint8 `json:"send_status,omitempty"`
	// The sms service provider | 短信服务提供商
	Provider string `json:"provider,omitempty"`
	// contains filtered or unexported fields
}

SmsLog is the model entity for the SmsLog schema.

func (*SmsLog) ExecContext

func (c *SmsLog) 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 (*SmsLog) QueryContext

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

func (sl *SmsLog) String() string

String implements the fmt.Stringer.

func (*SmsLog) Unwrap

func (sl *SmsLog) Unwrap() *SmsLog

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

func (sl *SmsLog) Update() *SmsLogUpdateOne

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

func (*SmsLog) Value

func (sl *SmsLog) Value(name string) (ent.Value, error)

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

type SmsLogClient

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

SmsLogClient is a client for the SmsLog schema.

func NewSmsLogClient

func NewSmsLogClient(c config) *SmsLogClient

NewSmsLogClient returns a client for the SmsLog from the given config.

func (*SmsLogClient) Create

func (c *SmsLogClient) Create() *SmsLogCreate

Create returns a builder for creating a SmsLog entity.

func (*SmsLogClient) CreateBulk

func (c *SmsLogClient) CreateBulk(builders ...*SmsLogCreate) *SmsLogCreateBulk

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

func (*SmsLogClient) Delete

func (c *SmsLogClient) Delete() *SmsLogDelete

Delete returns a delete builder for SmsLog.

func (*SmsLogClient) DeleteOne

func (c *SmsLogClient) DeleteOne(sl *SmsLog) *SmsLogDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SmsLogClient) DeleteOneID

func (c *SmsLogClient) DeleteOneID(id uuid.UUID) *SmsLogDeleteOne

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

func (*SmsLogClient) ExecContext

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

func (c *SmsLogClient) Get(ctx context.Context, id uuid.UUID) (*SmsLog, error)

Get returns a SmsLog entity by its id.

func (*SmsLogClient) GetX

func (c *SmsLogClient) GetX(ctx context.Context, id uuid.UUID) *SmsLog

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

func (*SmsLogClient) Hooks

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

Hooks returns the client hooks.

func (*SmsLogClient) Intercept

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

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

func (*SmsLogClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SmsLogClient) Query

func (c *SmsLogClient) Query() *SmsLogQuery

Query returns a query builder for SmsLog.

func (*SmsLogClient) QueryContext

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

func (c *SmsLogClient) Update() *SmsLogUpdate

Update returns an update builder for SmsLog.

func (*SmsLogClient) UpdateOne

func (c *SmsLogClient) UpdateOne(sl *SmsLog) *SmsLogUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SmsLogClient) UpdateOneID

func (c *SmsLogClient) UpdateOneID(id uuid.UUID) *SmsLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SmsLogClient) Use

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

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

type SmsLogCreate

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

SmsLogCreate is the builder for creating a SmsLog entity.

func (*SmsLogCreate) Exec

func (slc *SmsLogCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SmsLogCreate) ExecContext

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

func (slc *SmsLogCreate) ExecX(ctx context.Context)

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

func (*SmsLogCreate) Mutation

func (slc *SmsLogCreate) Mutation() *SmsLogMutation

Mutation returns the SmsLogMutation object of the builder.

func (*SmsLogCreate) QueryContext

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

func (slc *SmsLogCreate) Save(ctx context.Context) (*SmsLog, error)

Save creates the SmsLog in the database.

func (*SmsLogCreate) SaveX

func (slc *SmsLogCreate) SaveX(ctx context.Context) *SmsLog

SaveX calls Save and panics if Save returns an error.

func (*SmsLogCreate) SetContent

func (slc *SmsLogCreate) SetContent(s string) *SmsLogCreate

SetContent sets the "content" field.

func (*SmsLogCreate) SetCreatedAt

func (slc *SmsLogCreate) SetCreatedAt(t time.Time) *SmsLogCreate

SetCreatedAt sets the "created_at" field.

func (*SmsLogCreate) SetID

func (slc *SmsLogCreate) SetID(u uuid.UUID) *SmsLogCreate

SetID sets the "id" field.

func (*SmsLogCreate) SetNillableCreatedAt

func (slc *SmsLogCreate) SetNillableCreatedAt(t *time.Time) *SmsLogCreate

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

func (*SmsLogCreate) SetNillableID

func (slc *SmsLogCreate) SetNillableID(u *uuid.UUID) *SmsLogCreate

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

func (*SmsLogCreate) SetNillableUpdatedAt

func (slc *SmsLogCreate) SetNillableUpdatedAt(t *time.Time) *SmsLogCreate

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

func (*SmsLogCreate) SetNotNilContent

func (sl *SmsLogCreate) SetNotNilContent(value *string) *SmsLogCreate

set field if value's pointer is not nil.

func (*SmsLogCreate) SetNotNilPhoneNumber

func (sl *SmsLogCreate) SetNotNilPhoneNumber(value *string) *SmsLogCreate

set field if value's pointer is not nil.

func (*SmsLogCreate) SetNotNilProvider

func (sl *SmsLogCreate) SetNotNilProvider(value *string) *SmsLogCreate

set field if value's pointer is not nil.

func (*SmsLogCreate) SetNotNilSendStatus

func (sl *SmsLogCreate) SetNotNilSendStatus(value *uint8) *SmsLogCreate

set field if value's pointer is not nil.

func (*SmsLogCreate) SetNotNilUpdatedAt

func (sl *SmsLogCreate) SetNotNilUpdatedAt(value *time.Time) *SmsLogCreate

set field if value's pointer is not nil.

func (*SmsLogCreate) SetPhoneNumber

func (slc *SmsLogCreate) SetPhoneNumber(s string) *SmsLogCreate

SetPhoneNumber sets the "phone_number" field.

func (*SmsLogCreate) SetProvider

func (slc *SmsLogCreate) SetProvider(s string) *SmsLogCreate

SetProvider sets the "provider" field.

func (*SmsLogCreate) SetSendStatus

func (slc *SmsLogCreate) SetSendStatus(u uint8) *SmsLogCreate

SetSendStatus sets the "send_status" field.

func (*SmsLogCreate) SetUpdatedAt

func (slc *SmsLogCreate) SetUpdatedAt(t time.Time) *SmsLogCreate

SetUpdatedAt sets the "updated_at" field.

type SmsLogCreateBulk

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

SmsLogCreateBulk is the builder for creating many SmsLog entities in bulk.

func (*SmsLogCreateBulk) Exec

func (slcb *SmsLogCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SmsLogCreateBulk) ExecContext

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

func (slcb *SmsLogCreateBulk) ExecX(ctx context.Context)

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

func (*SmsLogCreateBulk) QueryContext

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

func (slcb *SmsLogCreateBulk) Save(ctx context.Context) ([]*SmsLog, error)

Save creates the SmsLog entities in the database.

func (*SmsLogCreateBulk) SaveX

func (slcb *SmsLogCreateBulk) SaveX(ctx context.Context) []*SmsLog

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

type SmsLogDelete

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

SmsLogDelete is the builder for deleting a SmsLog entity.

func (*SmsLogDelete) Exec

func (sld *SmsLogDelete) Exec(ctx context.Context) (int, error)

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

func (*SmsLogDelete) ExecContext

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

func (sld *SmsLogDelete) ExecX(ctx context.Context) int

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

func (*SmsLogDelete) QueryContext

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

func (sld *SmsLogDelete) Where(ps ...predicate.SmsLog) *SmsLogDelete

Where appends a list predicates to the SmsLogDelete builder.

type SmsLogDeleteOne

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

SmsLogDeleteOne is the builder for deleting a single SmsLog entity.

func (*SmsLogDeleteOne) Exec

func (sldo *SmsLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SmsLogDeleteOne) ExecX

func (sldo *SmsLogDeleteOne) ExecX(ctx context.Context)

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

func (*SmsLogDeleteOne) Where

func (sldo *SmsLogDeleteOne) Where(ps ...predicate.SmsLog) *SmsLogDeleteOne

Where appends a list predicates to the SmsLogDelete builder.

type SmsLogGroupBy

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

SmsLogGroupBy is the group-by builder for SmsLog entities.

func (*SmsLogGroupBy) Aggregate

func (slgb *SmsLogGroupBy) Aggregate(fns ...AggregateFunc) *SmsLogGroupBy

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

func (*SmsLogGroupBy) Bool

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

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

func (*SmsLogGroupBy) BoolX

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

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

func (*SmsLogGroupBy) Bools

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

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

func (*SmsLogGroupBy) BoolsX

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

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

func (*SmsLogGroupBy) Float64

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

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

func (*SmsLogGroupBy) Float64X

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

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

func (*SmsLogGroupBy) Float64s

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

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

func (*SmsLogGroupBy) Float64sX

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

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

func (*SmsLogGroupBy) Int

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

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

func (*SmsLogGroupBy) IntX

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

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

func (*SmsLogGroupBy) Ints

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

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

func (*SmsLogGroupBy) IntsX

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

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

func (*SmsLogGroupBy) Scan

func (slgb *SmsLogGroupBy) Scan(ctx context.Context, v any) error

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

func (*SmsLogGroupBy) ScanX

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

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

func (*SmsLogGroupBy) String

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

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

func (*SmsLogGroupBy) StringX

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

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

func (*SmsLogGroupBy) Strings

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

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

func (*SmsLogGroupBy) StringsX

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

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

type SmsLogMutation

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

SmsLogMutation represents an operation that mutates the SmsLog nodes in the graph.

func (*SmsLogMutation) AddField

func (m *SmsLogMutation) 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 (*SmsLogMutation) AddSendStatus

func (m *SmsLogMutation) AddSendStatus(u int8)

AddSendStatus adds u to the "send_status" field.

func (*SmsLogMutation) AddedEdges

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

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

func (*SmsLogMutation) AddedField

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

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

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

func (*SmsLogMutation) AddedIDs

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

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

func (*SmsLogMutation) AddedSendStatus

func (m *SmsLogMutation) AddedSendStatus() (r int8, exists bool)

AddedSendStatus returns the value that was added to the "send_status" field in this mutation.

func (*SmsLogMutation) ClearEdge

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

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

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

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

func (*SmsLogMutation) ClearedFields

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

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

func (SmsLogMutation) Client

func (m SmsLogMutation) 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 (*SmsLogMutation) Content

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

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

func (*SmsLogMutation) CreatedAt

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

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

func (*SmsLogMutation) EdgeCleared

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

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

func (*SmsLogMutation) ExecContext

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

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

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

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

func (*SmsLogMutation) Fields

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

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

func (m *SmsLogMutation) 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 (*SmsLogMutation) OldContent

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

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

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

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

func (m *SmsLogMutation) 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 (*SmsLogMutation) OldPhoneNumber

func (m *SmsLogMutation) OldPhoneNumber(ctx context.Context) (v string, err error)

OldPhoneNumber returns the old "phone_number" field's value of the SmsLog entity. If the SmsLog 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 (*SmsLogMutation) OldProvider

func (m *SmsLogMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the SmsLog entity. If the SmsLog 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 (*SmsLogMutation) OldSendStatus

func (m *SmsLogMutation) OldSendStatus(ctx context.Context) (v uint8, err error)

OldSendStatus returns the old "send_status" field's value of the SmsLog entity. If the SmsLog 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 (*SmsLogMutation) OldUpdatedAt

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

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

func (m *SmsLogMutation) Op() Op

Op returns the operation name.

func (*SmsLogMutation) PhoneNumber

func (m *SmsLogMutation) PhoneNumber() (r string, exists bool)

PhoneNumber returns the value of the "phone_number" field in the mutation.

func (*SmsLogMutation) Provider

func (m *SmsLogMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*SmsLogMutation) QueryContext

func (c *SmsLogMutation) 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 (*SmsLogMutation) RemovedEdges

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

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

func (*SmsLogMutation) RemovedIDs

func (m *SmsLogMutation) 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 (*SmsLogMutation) ResetContent

func (m *SmsLogMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*SmsLogMutation) ResetCreatedAt

func (m *SmsLogMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SmsLogMutation) ResetEdge

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

func (m *SmsLogMutation) 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 (*SmsLogMutation) ResetPhoneNumber

func (m *SmsLogMutation) ResetPhoneNumber()

ResetPhoneNumber resets all changes to the "phone_number" field.

func (*SmsLogMutation) ResetProvider

func (m *SmsLogMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*SmsLogMutation) ResetSendStatus

func (m *SmsLogMutation) ResetSendStatus()

ResetSendStatus resets all changes to the "send_status" field.

func (*SmsLogMutation) ResetUpdatedAt

func (m *SmsLogMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SmsLogMutation) SendStatus

func (m *SmsLogMutation) SendStatus() (r uint8, exists bool)

SendStatus returns the value of the "send_status" field in the mutation.

func (*SmsLogMutation) SetContent

func (m *SmsLogMutation) SetContent(s string)

SetContent sets the "content" field.

func (*SmsLogMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SmsLogMutation) SetField

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

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

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

func (*SmsLogMutation) SetOp

func (m *SmsLogMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SmsLogMutation) SetPhoneNumber

func (m *SmsLogMutation) SetPhoneNumber(s string)

SetPhoneNumber sets the "phone_number" field.

func (*SmsLogMutation) SetProvider

func (m *SmsLogMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*SmsLogMutation) SetSendStatus

func (m *SmsLogMutation) SetSendStatus(u uint8)

SetSendStatus sets the "send_status" field.

func (*SmsLogMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (SmsLogMutation) Tx

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

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

func (*SmsLogMutation) Type

func (m *SmsLogMutation) Type() string

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

func (*SmsLogMutation) UpdatedAt

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

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

func (*SmsLogMutation) Where

func (m *SmsLogMutation) Where(ps ...predicate.SmsLog)

Where appends a list predicates to the SmsLogMutation builder.

func (*SmsLogMutation) WhereP

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

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

type SmsLogPageList

type SmsLogPageList struct {
	List        []*SmsLog    `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

SmsLogPageList is SmsLog PageList result.

type SmsLogPager

type SmsLogPager struct {
	Order  smslog.OrderOption
	Filter func(*SmsLogQuery) (*SmsLogQuery, error)
}

func (*SmsLogPager) ApplyFilter

func (p *SmsLogPager) ApplyFilter(query *SmsLogQuery) (*SmsLogQuery, error)

type SmsLogPaginateOption

type SmsLogPaginateOption func(*SmsLogPager)

SmsLogPaginateOption enables pagination customization.

type SmsLogQuery

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

SmsLogQuery is the builder for querying SmsLog entities.

func (*SmsLogQuery) Aggregate

func (slq *SmsLogQuery) Aggregate(fns ...AggregateFunc) *SmsLogSelect

Aggregate returns a SmsLogSelect configured with the given aggregations.

func (*SmsLogQuery) All

func (slq *SmsLogQuery) All(ctx context.Context) ([]*SmsLog, error)

All executes the query and returns a list of SmsLogs.

func (*SmsLogQuery) AllX

func (slq *SmsLogQuery) AllX(ctx context.Context) []*SmsLog

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

func (*SmsLogQuery) Clone

func (slq *SmsLogQuery) Clone() *SmsLogQuery

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

func (*SmsLogQuery) Count

func (slq *SmsLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SmsLogQuery) CountX

func (slq *SmsLogQuery) CountX(ctx context.Context) int

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

func (*SmsLogQuery) ExecContext

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

func (slq *SmsLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*SmsLogQuery) ExistX

func (slq *SmsLogQuery) ExistX(ctx context.Context) bool

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

func (*SmsLogQuery) First

func (slq *SmsLogQuery) First(ctx context.Context) (*SmsLog, error)

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

func (*SmsLogQuery) FirstID

func (slq *SmsLogQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SmsLogQuery) FirstIDX

func (slq *SmsLogQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SmsLogQuery) FirstX

func (slq *SmsLogQuery) FirstX(ctx context.Context) *SmsLog

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

func (*SmsLogQuery) GroupBy

func (slq *SmsLogQuery) GroupBy(field string, fields ...string) *SmsLogGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SmsLog.Query().
	GroupBy(smslog.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SmsLogQuery) IDs

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

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

func (*SmsLogQuery) IDsX

func (slq *SmsLogQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SmsLogQuery) Limit

func (slq *SmsLogQuery) Limit(limit int) *SmsLogQuery

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

func (*SmsLogQuery) Offset

func (slq *SmsLogQuery) Offset(offset int) *SmsLogQuery

Offset to start from.

func (*SmsLogQuery) Only

func (slq *SmsLogQuery) Only(ctx context.Context) (*SmsLog, error)

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

func (*SmsLogQuery) OnlyID

func (slq *SmsLogQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SmsLogQuery) OnlyIDX

func (slq *SmsLogQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SmsLogQuery) OnlyX

func (slq *SmsLogQuery) OnlyX(ctx context.Context) *SmsLog

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

func (*SmsLogQuery) Order

func (slq *SmsLogQuery) Order(o ...smslog.OrderOption) *SmsLogQuery

Order specifies how the records should be ordered.

func (*SmsLogQuery) Page

func (sl *SmsLogQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...SmsLogPaginateOption,
) (*SmsLogPageList, error)

func (*SmsLogQuery) QueryContext

func (c *SmsLogQuery) 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 (*SmsLogQuery) Select

func (slq *SmsLogQuery) Select(fields ...string) *SmsLogSelect

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.SmsLog.Query().
	Select(smslog.FieldCreatedAt).
	Scan(ctx, &v)

func (*SmsLogQuery) Unique

func (slq *SmsLogQuery) Unique(unique bool) *SmsLogQuery

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

func (slq *SmsLogQuery) Where(ps ...predicate.SmsLog) *SmsLogQuery

Where adds a new predicate for the SmsLogQuery builder.

type SmsLogSelect

type SmsLogSelect struct {
	*SmsLogQuery
	// contains filtered or unexported fields
}

SmsLogSelect is the builder for selecting fields of SmsLog entities.

func (*SmsLogSelect) Aggregate

func (sls *SmsLogSelect) Aggregate(fns ...AggregateFunc) *SmsLogSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SmsLogSelect) Bool

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

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

func (*SmsLogSelect) BoolX

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

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

func (*SmsLogSelect) Bools

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

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

func (*SmsLogSelect) BoolsX

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

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

func (SmsLogSelect) ExecContext

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

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

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

func (*SmsLogSelect) Float64X

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

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

func (*SmsLogSelect) Float64s

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

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

func (*SmsLogSelect) Float64sX

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

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

func (*SmsLogSelect) Int

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

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

func (*SmsLogSelect) IntX

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

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

func (*SmsLogSelect) Ints

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

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

func (*SmsLogSelect) IntsX

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

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

func (SmsLogSelect) QueryContext

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

func (sls *SmsLogSelect) Scan(ctx context.Context, v any) error

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

func (*SmsLogSelect) ScanX

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

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

func (*SmsLogSelect) String

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

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

func (*SmsLogSelect) StringX

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

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

func (*SmsLogSelect) Strings

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

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

func (*SmsLogSelect) StringsX

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

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

type SmsLogUpdate

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

SmsLogUpdate is the builder for updating SmsLog entities.

func (*SmsLogUpdate) AddSendStatus

func (slu *SmsLogUpdate) AddSendStatus(u int8) *SmsLogUpdate

AddSendStatus adds u to the "send_status" field.

func (*SmsLogUpdate) Exec

func (slu *SmsLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SmsLogUpdate) ExecContext

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

func (slu *SmsLogUpdate) ExecX(ctx context.Context)

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

func (*SmsLogUpdate) Mutation

func (slu *SmsLogUpdate) Mutation() *SmsLogMutation

Mutation returns the SmsLogMutation object of the builder.

func (*SmsLogUpdate) QueryContext

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

func (slu *SmsLogUpdate) Save(ctx context.Context) (int, error)

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

func (*SmsLogUpdate) SaveX

func (slu *SmsLogUpdate) SaveX(ctx context.Context) int

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

func (*SmsLogUpdate) SetContent

func (slu *SmsLogUpdate) SetContent(s string) *SmsLogUpdate

SetContent sets the "content" field.

func (*SmsLogUpdate) SetNotNilContent

func (sl *SmsLogUpdate) SetNotNilContent(value *string) *SmsLogUpdate

set field if value's pointer is not nil.

func (*SmsLogUpdate) SetNotNilPhoneNumber

func (sl *SmsLogUpdate) SetNotNilPhoneNumber(value *string) *SmsLogUpdate

set field if value's pointer is not nil.

func (*SmsLogUpdate) SetNotNilProvider

func (sl *SmsLogUpdate) SetNotNilProvider(value *string) *SmsLogUpdate

set field if value's pointer is not nil.

func (*SmsLogUpdate) SetNotNilSendStatus

func (sl *SmsLogUpdate) SetNotNilSendStatus(value *uint8) *SmsLogUpdate

set field if value's pointer is not nil.

func (*SmsLogUpdate) SetNotNilUpdatedAt

func (sl *SmsLogUpdate) SetNotNilUpdatedAt(value *time.Time) *SmsLogUpdate

set field if value's pointer is not nil.

func (*SmsLogUpdate) SetPhoneNumber

func (slu *SmsLogUpdate) SetPhoneNumber(s string) *SmsLogUpdate

SetPhoneNumber sets the "phone_number" field.

func (*SmsLogUpdate) SetProvider

func (slu *SmsLogUpdate) SetProvider(s string) *SmsLogUpdate

SetProvider sets the "provider" field.

func (*SmsLogUpdate) SetSendStatus

func (slu *SmsLogUpdate) SetSendStatus(u uint8) *SmsLogUpdate

SetSendStatus sets the "send_status" field.

func (*SmsLogUpdate) SetUpdatedAt

func (slu *SmsLogUpdate) SetUpdatedAt(t time.Time) *SmsLogUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SmsLogUpdate) Where

func (slu *SmsLogUpdate) Where(ps ...predicate.SmsLog) *SmsLogUpdate

Where appends a list predicates to the SmsLogUpdate builder.

type SmsLogUpdateOne

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

SmsLogUpdateOne is the builder for updating a single SmsLog entity.

func (*SmsLogUpdateOne) AddSendStatus

func (sluo *SmsLogUpdateOne) AddSendStatus(u int8) *SmsLogUpdateOne

AddSendStatus adds u to the "send_status" field.

func (*SmsLogUpdateOne) Exec

func (sluo *SmsLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SmsLogUpdateOne) ExecContext

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

func (sluo *SmsLogUpdateOne) ExecX(ctx context.Context)

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

func (*SmsLogUpdateOne) Mutation

func (sluo *SmsLogUpdateOne) Mutation() *SmsLogMutation

Mutation returns the SmsLogMutation object of the builder.

func (*SmsLogUpdateOne) QueryContext

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

func (sluo *SmsLogUpdateOne) Save(ctx context.Context) (*SmsLog, error)

Save executes the query and returns the updated SmsLog entity.

func (*SmsLogUpdateOne) SaveX

func (sluo *SmsLogUpdateOne) SaveX(ctx context.Context) *SmsLog

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

func (*SmsLogUpdateOne) Select

func (sluo *SmsLogUpdateOne) Select(field string, fields ...string) *SmsLogUpdateOne

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

func (*SmsLogUpdateOne) SetContent

func (sluo *SmsLogUpdateOne) SetContent(s string) *SmsLogUpdateOne

SetContent sets the "content" field.

func (*SmsLogUpdateOne) SetNotNilContent

func (sl *SmsLogUpdateOne) SetNotNilContent(value *string) *SmsLogUpdateOne

set field if value's pointer is not nil.

func (*SmsLogUpdateOne) SetNotNilPhoneNumber

func (sl *SmsLogUpdateOne) SetNotNilPhoneNumber(value *string) *SmsLogUpdateOne

set field if value's pointer is not nil.

func (*SmsLogUpdateOne) SetNotNilProvider

func (sl *SmsLogUpdateOne) SetNotNilProvider(value *string) *SmsLogUpdateOne

set field if value's pointer is not nil.

func (*SmsLogUpdateOne) SetNotNilSendStatus

func (sl *SmsLogUpdateOne) SetNotNilSendStatus(value *uint8) *SmsLogUpdateOne

set field if value's pointer is not nil.

func (*SmsLogUpdateOne) SetNotNilUpdatedAt

func (sl *SmsLogUpdateOne) SetNotNilUpdatedAt(value *time.Time) *SmsLogUpdateOne

set field if value's pointer is not nil.

func (*SmsLogUpdateOne) SetPhoneNumber

func (sluo *SmsLogUpdateOne) SetPhoneNumber(s string) *SmsLogUpdateOne

SetPhoneNumber sets the "phone_number" field.

func (*SmsLogUpdateOne) SetProvider

func (sluo *SmsLogUpdateOne) SetProvider(s string) *SmsLogUpdateOne

SetProvider sets the "provider" field.

func (*SmsLogUpdateOne) SetSendStatus

func (sluo *SmsLogUpdateOne) SetSendStatus(u uint8) *SmsLogUpdateOne

SetSendStatus sets the "send_status" field.

func (*SmsLogUpdateOne) SetUpdatedAt

func (sluo *SmsLogUpdateOne) SetUpdatedAt(t time.Time) *SmsLogUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SmsLogUpdateOne) Where

func (sluo *SmsLogUpdateOne) Where(ps ...predicate.SmsLog) *SmsLogUpdateOne

Where appends a list predicates to the SmsLogUpdate builder.

type SmsLogs

type SmsLogs []*SmsLog

SmsLogs is a parsable slice of SmsLog.

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 {

	// EmailLog is the client for interacting with the EmailLog builders.
	EmailLog *EmailLogClient
	// SmsLog is the client for interacting with the SmsLog builders.
	SmsLog *SmsLogClient
	// 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