ent

package
v0.0.0-...-a88cfdc Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 18 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.
	TypeUserPlatformTokens = "UserPlatformTokens"
	TypeUserPushToken      = "UserPushToken"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validaton 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
	// UserPlatformTokens is the client for interacting with the UserPlatformTokens builders.
	UserPlatformTokens *UserPlatformTokensClient
	// UserPushToken is the client for interacting with the UserPushToken builders.
	UserPushToken *UserPushTokenClient
	// 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().
	UserPlatformTokens.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(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 Committer method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type 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(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 Rollbacker method.

type Tx

type Tx struct {

	// UserPlatformTokens is the client for interacting with the UserPlatformTokens builders.
	UserPlatformTokens *UserPlatformTokensClient
	// UserPushToken is the client for interacting with the UserPushToken builders.
	UserPushToken *UserPushTokenClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type UserPlatformTokens

type UserPlatformTokens struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type uint8 `json:"type,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// DeviceID holds the value of the "device_id" field.
	DeviceID string `json:"device_id,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID string `json:"app_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"`
	// contains filtered or unexported fields
}

UserPlatformTokens is the model entity for the UserPlatformTokens schema.

func (*UserPlatformTokens) String

func (upt *UserPlatformTokens) String() string

String implements the fmt.Stringer.

func (*UserPlatformTokens) Unwrap

func (upt *UserPlatformTokens) Unwrap() *UserPlatformTokens

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

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

type UserPlatformTokensClient

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

UserPlatformTokensClient is a client for the UserPlatformTokens schema.

func NewUserPlatformTokensClient

func NewUserPlatformTokensClient(c config) *UserPlatformTokensClient

NewUserPlatformTokensClient returns a client for the UserPlatformTokens from the given config.

func (*UserPlatformTokensClient) Create

Create returns a create builder for UserPlatformTokens.

func (*UserPlatformTokensClient) CreateBulk

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

func (*UserPlatformTokensClient) Delete

Delete returns a delete builder for UserPlatformTokens.

func (*UserPlatformTokensClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserPlatformTokensClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*UserPlatformTokensClient) Get

Get returns a UserPlatformTokens entity by its id.

func (*UserPlatformTokensClient) GetX

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

func (*UserPlatformTokensClient) Hooks

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

Hooks returns the client hooks.

func (*UserPlatformTokensClient) Query

Query returns a query builder for UserPlatformTokens.

func (*UserPlatformTokensClient) Update

Update returns an update builder for UserPlatformTokens.

func (*UserPlatformTokensClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserPlatformTokensClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*UserPlatformTokensClient) Use

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

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

type UserPlatformTokensCreate

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

UserPlatformTokensCreate is the builder for creating a UserPlatformTokens entity.

func (*UserPlatformTokensCreate) Mutation

Mutation returns the UserPlatformTokensMutation object of the builder.

func (*UserPlatformTokensCreate) Save

Save creates the UserPlatformTokens in the database.

func (*UserPlatformTokensCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserPlatformTokensCreate) SetAppID

SetAppID sets the "app_id" field.

func (*UserPlatformTokensCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*UserPlatformTokensCreate) SetDeviceID

SetDeviceID sets the "device_id" field.

func (*UserPlatformTokensCreate) SetToken

SetToken sets the "token" field.

func (*UserPlatformTokensCreate) SetType

SetType sets the "type" field.

func (*UserPlatformTokensCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserPlatformTokensCreate) SetUserID

SetUserID sets the "user_id" field.

type UserPlatformTokensCreateBulk

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

UserPlatformTokensCreateBulk is the builder for creating many UserPlatformTokens entities in bulk.

func (*UserPlatformTokensCreateBulk) Save

Save creates the UserPlatformTokens entities in the database.

func (*UserPlatformTokensCreateBulk) SaveX

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

type UserPlatformTokensDelete

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

UserPlatformTokensDelete is the builder for deleting a UserPlatformTokens entity.

func (*UserPlatformTokensDelete) Exec

func (uptd *UserPlatformTokensDelete) Exec(ctx context.Context) (int, error)

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

func (*UserPlatformTokensDelete) ExecX

func (uptd *UserPlatformTokensDelete) ExecX(ctx context.Context) int

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

func (*UserPlatformTokensDelete) Where

Where adds a new predicate to the UserPlatformTokensDelete builder.

type UserPlatformTokensDeleteOne

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

UserPlatformTokensDeleteOne is the builder for deleting a single UserPlatformTokens entity.

func (*UserPlatformTokensDeleteOne) Exec

Exec executes the deletion query.

func (*UserPlatformTokensDeleteOne) ExecX

func (uptdo *UserPlatformTokensDeleteOne) ExecX(ctx context.Context)

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

type UserPlatformTokensGroupBy

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

UserPlatformTokensGroupBy is the group-by builder for UserPlatformTokens entities.

func (*UserPlatformTokensGroupBy) Aggregate

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

func (*UserPlatformTokensGroupBy) Bool

func (uptgb *UserPlatformTokensGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) BoolX

func (uptgb *UserPlatformTokensGroupBy) BoolX(ctx context.Context) bool

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

func (*UserPlatformTokensGroupBy) Bools

func (uptgb *UserPlatformTokensGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) BoolsX

func (uptgb *UserPlatformTokensGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserPlatformTokensGroupBy) Float64

func (uptgb *UserPlatformTokensGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) Float64X

func (uptgb *UserPlatformTokensGroupBy) Float64X(ctx context.Context) float64

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

func (*UserPlatformTokensGroupBy) Float64s

func (uptgb *UserPlatformTokensGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) Float64sX

func (uptgb *UserPlatformTokensGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserPlatformTokensGroupBy) Int

func (uptgb *UserPlatformTokensGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) IntX

func (uptgb *UserPlatformTokensGroupBy) IntX(ctx context.Context) int

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

func (*UserPlatformTokensGroupBy) Ints

func (uptgb *UserPlatformTokensGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) IntsX

func (uptgb *UserPlatformTokensGroupBy) IntsX(ctx context.Context) []int

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

func (*UserPlatformTokensGroupBy) Scan

func (uptgb *UserPlatformTokensGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserPlatformTokensGroupBy) ScanX

func (uptgb *UserPlatformTokensGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserPlatformTokensGroupBy) String

func (uptgb *UserPlatformTokensGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) StringX

func (uptgb *UserPlatformTokensGroupBy) StringX(ctx context.Context) string

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

func (*UserPlatformTokensGroupBy) Strings

func (uptgb *UserPlatformTokensGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPlatformTokensGroupBy) StringsX

func (uptgb *UserPlatformTokensGroupBy) StringsX(ctx context.Context) []string

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

type UserPlatformTokensMutation

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

UserPlatformTokensMutation represents an operation that mutates the UserPlatformTokens nodes in the graph.

func (*UserPlatformTokensMutation) AddField

func (m *UserPlatformTokensMutation) 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 (*UserPlatformTokensMutation) AddType

func (m *UserPlatformTokensMutation) AddType(u uint8)

AddType adds u to the "type" field.

func (*UserPlatformTokensMutation) AddedEdges

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

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

func (*UserPlatformTokensMutation) AddedField

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

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

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

func (*UserPlatformTokensMutation) AddedIDs

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

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

func (*UserPlatformTokensMutation) AddedType

func (m *UserPlatformTokensMutation) AddedType() (r uint8, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*UserPlatformTokensMutation) AppID

func (m *UserPlatformTokensMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*UserPlatformTokensMutation) ClearEdge

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

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

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

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

func (*UserPlatformTokensMutation) ClearedFields

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

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

func (UserPlatformTokensMutation) Client

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

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

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

func (*UserPlatformTokensMutation) DeviceID

func (m *UserPlatformTokensMutation) DeviceID() (r string, exists bool)

DeviceID returns the value of the "device_id" field in the mutation.

func (*UserPlatformTokensMutation) EdgeCleared

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

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

func (*UserPlatformTokensMutation) Field

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

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

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

func (*UserPlatformTokensMutation) Fields

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

func (m *UserPlatformTokensMutation) GetType() (r uint8, exists bool)

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

func (*UserPlatformTokensMutation) ID

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

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*UserPlatformTokensMutation) OldAppID

func (m *UserPlatformTokensMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the UserPlatformTokens entity. If the UserPlatformTokens 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 (*UserPlatformTokensMutation) OldCreatedAt

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

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

func (m *UserPlatformTokensMutation) OldDeviceID(ctx context.Context) (v string, err error)

OldDeviceID returns the old "device_id" field's value of the UserPlatformTokens entity. If the UserPlatformTokens 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 (*UserPlatformTokensMutation) OldField

func (m *UserPlatformTokensMutation) 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 (*UserPlatformTokensMutation) OldToken

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

OldToken returns the old "token" field's value of the UserPlatformTokens entity. If the UserPlatformTokens 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 (*UserPlatformTokensMutation) OldType

func (m *UserPlatformTokensMutation) OldType(ctx context.Context) (v uint8, err error)

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

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

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

func (m *UserPlatformTokensMutation) OldUserID(ctx context.Context) (v string, err error)

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

Op returns the operation name.

func (*UserPlatformTokensMutation) RemovedEdges

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

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

func (*UserPlatformTokensMutation) RemovedIDs

func (m *UserPlatformTokensMutation) 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 (*UserPlatformTokensMutation) ResetAppID

func (m *UserPlatformTokensMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*UserPlatformTokensMutation) ResetCreatedAt

func (m *UserPlatformTokensMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserPlatformTokensMutation) ResetDeviceID

func (m *UserPlatformTokensMutation) ResetDeviceID()

ResetDeviceID resets all changes to the "device_id" field.

func (*UserPlatformTokensMutation) ResetEdge

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

func (m *UserPlatformTokensMutation) 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 (*UserPlatformTokensMutation) ResetToken

func (m *UserPlatformTokensMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*UserPlatformTokensMutation) ResetType

func (m *UserPlatformTokensMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*UserPlatformTokensMutation) ResetUpdatedAt

func (m *UserPlatformTokensMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserPlatformTokensMutation) ResetUserID

func (m *UserPlatformTokensMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserPlatformTokensMutation) SetAppID

func (m *UserPlatformTokensMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*UserPlatformTokensMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserPlatformTokensMutation) SetDeviceID

func (m *UserPlatformTokensMutation) SetDeviceID(s string)

SetDeviceID sets the "device_id" field.

func (*UserPlatformTokensMutation) SetField

func (m *UserPlatformTokensMutation) 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 (*UserPlatformTokensMutation) SetToken

func (m *UserPlatformTokensMutation) SetToken(s string)

SetToken sets the "token" field.

func (*UserPlatformTokensMutation) SetType

func (m *UserPlatformTokensMutation) SetType(u uint8)

SetType sets the "type" field.

func (*UserPlatformTokensMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserPlatformTokensMutation) SetUserID

func (m *UserPlatformTokensMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*UserPlatformTokensMutation) Token

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

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

func (UserPlatformTokensMutation) Tx

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

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

func (*UserPlatformTokensMutation) Type

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

func (*UserPlatformTokensMutation) UpdatedAt

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

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

func (*UserPlatformTokensMutation) UserID

func (m *UserPlatformTokensMutation) UserID() (r string, exists bool)

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

type UserPlatformTokensQuery

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

UserPlatformTokensQuery is the builder for querying UserPlatformTokens entities.

func (*UserPlatformTokensQuery) All

All executes the query and returns a list of UserPlatformTokensSlice.

func (*UserPlatformTokensQuery) AllX

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

func (*UserPlatformTokensQuery) Clone

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

func (*UserPlatformTokensQuery) Count

func (uptq *UserPlatformTokensQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserPlatformTokensQuery) CountX

func (uptq *UserPlatformTokensQuery) CountX(ctx context.Context) int

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

func (*UserPlatformTokensQuery) Exist

func (uptq *UserPlatformTokensQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserPlatformTokensQuery) ExistX

func (uptq *UserPlatformTokensQuery) ExistX(ctx context.Context) bool

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

func (*UserPlatformTokensQuery) First

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

func (*UserPlatformTokensQuery) FirstID

func (uptq *UserPlatformTokensQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserPlatformTokensQuery) FirstIDX

func (uptq *UserPlatformTokensQuery) FirstIDX(ctx context.Context) int

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

func (*UserPlatformTokensQuery) FirstX

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

func (*UserPlatformTokensQuery) GroupBy

func (uptq *UserPlatformTokensQuery) GroupBy(field string, fields ...string) *UserPlatformTokensGroupBy

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

Example:

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

client.UserPlatformTokens.Query().
	GroupBy(userplatformtokens.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserPlatformTokensQuery) IDs

func (uptq *UserPlatformTokensQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserPlatformTokensQuery) IDsX

func (uptq *UserPlatformTokensQuery) IDsX(ctx context.Context) []int

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

func (*UserPlatformTokensQuery) Limit

Limit adds a limit step to the query.

func (*UserPlatformTokensQuery) Offset

func (uptq *UserPlatformTokensQuery) Offset(offset int) *UserPlatformTokensQuery

Offset adds an offset step to the query.

func (*UserPlatformTokensQuery) Only

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

func (*UserPlatformTokensQuery) OnlyID

func (uptq *UserPlatformTokensQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserPlatformTokensQuery) OnlyIDX

func (uptq *UserPlatformTokensQuery) OnlyIDX(ctx context.Context) int

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

func (*UserPlatformTokensQuery) OnlyX

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

func (*UserPlatformTokensQuery) Order

Order adds an order step to the query.

func (*UserPlatformTokensQuery) Select

func (uptq *UserPlatformTokensQuery) Select(field string, fields ...string) *UserPlatformTokensSelect

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

Example:

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

client.UserPlatformTokens.Query().
	Select(userplatformtokens.FieldType).
	Scan(ctx, &v)

func (*UserPlatformTokensQuery) Unique

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

func (*UserPlatformTokensQuery) Where

Where adds a new predicate for the UserPlatformTokensQuery builder.

type UserPlatformTokensSelect

type UserPlatformTokensSelect struct {
	*UserPlatformTokensQuery
	// contains filtered or unexported fields
}

UserPlatformTokensSelect is the builder for selecting fields of UserPlatformTokens entities.

func (*UserPlatformTokensSelect) Bool

func (upts *UserPlatformTokensSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserPlatformTokensSelect) BoolX

func (upts *UserPlatformTokensSelect) BoolX(ctx context.Context) bool

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

func (*UserPlatformTokensSelect) Bools

func (upts *UserPlatformTokensSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserPlatformTokensSelect) BoolsX

func (upts *UserPlatformTokensSelect) BoolsX(ctx context.Context) []bool

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

func (*UserPlatformTokensSelect) Float64

func (upts *UserPlatformTokensSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserPlatformTokensSelect) Float64X

func (upts *UserPlatformTokensSelect) Float64X(ctx context.Context) float64

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

func (*UserPlatformTokensSelect) Float64s

func (upts *UserPlatformTokensSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserPlatformTokensSelect) Float64sX

func (upts *UserPlatformTokensSelect) Float64sX(ctx context.Context) []float64

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

func (*UserPlatformTokensSelect) Int

func (upts *UserPlatformTokensSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserPlatformTokensSelect) IntX

func (upts *UserPlatformTokensSelect) IntX(ctx context.Context) int

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

func (*UserPlatformTokensSelect) Ints

func (upts *UserPlatformTokensSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserPlatformTokensSelect) IntsX

func (upts *UserPlatformTokensSelect) IntsX(ctx context.Context) []int

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

func (*UserPlatformTokensSelect) Scan

func (upts *UserPlatformTokensSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserPlatformTokensSelect) ScanX

func (upts *UserPlatformTokensSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserPlatformTokensSelect) String

func (upts *UserPlatformTokensSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserPlatformTokensSelect) StringX

func (upts *UserPlatformTokensSelect) StringX(ctx context.Context) string

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

func (*UserPlatformTokensSelect) Strings

func (upts *UserPlatformTokensSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserPlatformTokensSelect) StringsX

func (upts *UserPlatformTokensSelect) StringsX(ctx context.Context) []string

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

type UserPlatformTokensSlice

type UserPlatformTokensSlice []*UserPlatformTokens

UserPlatformTokensSlice is a parsable slice of UserPlatformTokens.

type UserPlatformTokensUpdate

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

UserPlatformTokensUpdate is the builder for updating UserPlatformTokens entities.

func (*UserPlatformTokensUpdate) AddType

AddType adds u to the "type" field.

func (*UserPlatformTokensUpdate) Exec

Exec executes the query.

func (*UserPlatformTokensUpdate) ExecX

func (uptu *UserPlatformTokensUpdate) ExecX(ctx context.Context)

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

func (*UserPlatformTokensUpdate) Mutation

Mutation returns the UserPlatformTokensMutation object of the builder.

func (*UserPlatformTokensUpdate) Save

func (uptu *UserPlatformTokensUpdate) Save(ctx context.Context) (int, error)

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

func (*UserPlatformTokensUpdate) SaveX

func (uptu *UserPlatformTokensUpdate) SaveX(ctx context.Context) int

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

func (*UserPlatformTokensUpdate) SetAppID

SetAppID sets the "app_id" field.

func (*UserPlatformTokensUpdate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*UserPlatformTokensUpdate) SetDeviceID

SetDeviceID sets the "device_id" field.

func (*UserPlatformTokensUpdate) SetToken

SetToken sets the "token" field.

func (*UserPlatformTokensUpdate) SetType

SetType sets the "type" field.

func (*UserPlatformTokensUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserPlatformTokensUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*UserPlatformTokensUpdate) Where

Where adds a new predicate for the UserPlatformTokensUpdate builder.

type UserPlatformTokensUpdateOne

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

UserPlatformTokensUpdateOne is the builder for updating a single UserPlatformTokens entity.

func (*UserPlatformTokensUpdateOne) AddType

AddType adds u to the "type" field.

func (*UserPlatformTokensUpdateOne) Exec

Exec executes the query on the entity.

func (*UserPlatformTokensUpdateOne) ExecX

func (uptuo *UserPlatformTokensUpdateOne) ExecX(ctx context.Context)

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

func (*UserPlatformTokensUpdateOne) Mutation

Mutation returns the UserPlatformTokensMutation object of the builder.

func (*UserPlatformTokensUpdateOne) Save

Save executes the query and returns the updated UserPlatformTokens entity.

func (*UserPlatformTokensUpdateOne) SaveX

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

func (*UserPlatformTokensUpdateOne) Select

func (uptuo *UserPlatformTokensUpdateOne) Select(field string, fields ...string) *UserPlatformTokensUpdateOne

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

func (*UserPlatformTokensUpdateOne) SetAppID

SetAppID sets the "app_id" field.

func (*UserPlatformTokensUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*UserPlatformTokensUpdateOne) SetDeviceID

SetDeviceID sets the "device_id" field.

func (*UserPlatformTokensUpdateOne) SetToken

SetToken sets the "token" field.

func (*UserPlatformTokensUpdateOne) SetType

SetType sets the "type" field.

func (*UserPlatformTokensUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserPlatformTokensUpdateOne) SetUserID

SetUserID sets the "user_id" field.

type UserPushToken

type UserPushToken struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID string `json:"app_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"`
	// contains filtered or unexported fields
}

UserPushToken is the model entity for the UserPushToken schema.

func (*UserPushToken) String

func (upt *UserPushToken) String() string

String implements the fmt.Stringer.

func (*UserPushToken) Unwrap

func (upt *UserPushToken) Unwrap() *UserPushToken

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

func (upt *UserPushToken) Update() *UserPushTokenUpdateOne

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

type UserPushTokenClient

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

UserPushTokenClient is a client for the UserPushToken schema.

func NewUserPushTokenClient

func NewUserPushTokenClient(c config) *UserPushTokenClient

NewUserPushTokenClient returns a client for the UserPushToken from the given config.

func (*UserPushTokenClient) Create

Create returns a create builder for UserPushToken.

func (*UserPushTokenClient) CreateBulk

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

func (*UserPushTokenClient) Delete

Delete returns a delete builder for UserPushToken.

func (*UserPushTokenClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserPushTokenClient) DeleteOneID

func (c *UserPushTokenClient) DeleteOneID(id int) *UserPushTokenDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserPushTokenClient) Get

Get returns a UserPushToken entity by its id.

func (*UserPushTokenClient) GetX

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

func (*UserPushTokenClient) Hooks

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

Hooks returns the client hooks.

func (*UserPushTokenClient) Query

Query returns a query builder for UserPushToken.

func (*UserPushTokenClient) Update

Update returns an update builder for UserPushToken.

func (*UserPushTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserPushTokenClient) UpdateOneID

func (c *UserPushTokenClient) UpdateOneID(id int) *UserPushTokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserPushTokenClient) Use

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

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

type UserPushTokenCreate

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

UserPushTokenCreate is the builder for creating a UserPushToken entity.

func (*UserPushTokenCreate) Mutation

func (uptc *UserPushTokenCreate) Mutation() *UserPushTokenMutation

Mutation returns the UserPushTokenMutation object of the builder.

func (*UserPushTokenCreate) Save

Save creates the UserPushToken in the database.

func (*UserPushTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserPushTokenCreate) SetAppID

func (uptc *UserPushTokenCreate) SetAppID(s string) *UserPushTokenCreate

SetAppID sets the "app_id" field.

func (*UserPushTokenCreate) SetCreatedAt

func (uptc *UserPushTokenCreate) SetCreatedAt(t time.Time) *UserPushTokenCreate

SetCreatedAt sets the "created_at" field.

func (*UserPushTokenCreate) SetNillableCreatedAt

func (uptc *UserPushTokenCreate) SetNillableCreatedAt(t *time.Time) *UserPushTokenCreate

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

func (*UserPushTokenCreate) SetNillableUpdatedAt

func (uptc *UserPushTokenCreate) SetNillableUpdatedAt(t *time.Time) *UserPushTokenCreate

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

func (*UserPushTokenCreate) SetToken

func (uptc *UserPushTokenCreate) SetToken(s string) *UserPushTokenCreate

SetToken sets the "token" field.

func (*UserPushTokenCreate) SetUpdatedAt

func (uptc *UserPushTokenCreate) SetUpdatedAt(t time.Time) *UserPushTokenCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserPushTokenCreate) SetUserID

func (uptc *UserPushTokenCreate) SetUserID(s string) *UserPushTokenCreate

SetUserID sets the "user_id" field.

type UserPushTokenCreateBulk

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

UserPushTokenCreateBulk is the builder for creating many UserPushToken entities in bulk.

func (*UserPushTokenCreateBulk) Save

Save creates the UserPushToken entities in the database.

func (*UserPushTokenCreateBulk) SaveX

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

type UserPushTokenDelete

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

UserPushTokenDelete is the builder for deleting a UserPushToken entity.

func (*UserPushTokenDelete) Exec

func (uptd *UserPushTokenDelete) Exec(ctx context.Context) (int, error)

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

func (*UserPushTokenDelete) ExecX

func (uptd *UserPushTokenDelete) ExecX(ctx context.Context) int

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

func (*UserPushTokenDelete) Where

Where adds a new predicate to the UserPushTokenDelete builder.

type UserPushTokenDeleteOne

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

UserPushTokenDeleteOne is the builder for deleting a single UserPushToken entity.

func (*UserPushTokenDeleteOne) Exec

func (uptdo *UserPushTokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserPushTokenDeleteOne) ExecX

func (uptdo *UserPushTokenDeleteOne) ExecX(ctx context.Context)

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

type UserPushTokenGroupBy

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

UserPushTokenGroupBy is the group-by builder for UserPushToken entities.

func (*UserPushTokenGroupBy) Aggregate

func (uptgb *UserPushTokenGroupBy) Aggregate(fns ...AggregateFunc) *UserPushTokenGroupBy

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

func (*UserPushTokenGroupBy) Bool

func (uptgb *UserPushTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) BoolX

func (uptgb *UserPushTokenGroupBy) BoolX(ctx context.Context) bool

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

func (*UserPushTokenGroupBy) Bools

func (uptgb *UserPushTokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) BoolsX

func (uptgb *UserPushTokenGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserPushTokenGroupBy) Float64

func (uptgb *UserPushTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) Float64X

func (uptgb *UserPushTokenGroupBy) Float64X(ctx context.Context) float64

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

func (*UserPushTokenGroupBy) Float64s

func (uptgb *UserPushTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) Float64sX

func (uptgb *UserPushTokenGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserPushTokenGroupBy) Int

func (uptgb *UserPushTokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) IntX

func (uptgb *UserPushTokenGroupBy) IntX(ctx context.Context) int

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

func (*UserPushTokenGroupBy) Ints

func (uptgb *UserPushTokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) IntsX

func (uptgb *UserPushTokenGroupBy) IntsX(ctx context.Context) []int

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

func (*UserPushTokenGroupBy) Scan

func (uptgb *UserPushTokenGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserPushTokenGroupBy) ScanX

func (uptgb *UserPushTokenGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserPushTokenGroupBy) String

func (uptgb *UserPushTokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) StringX

func (uptgb *UserPushTokenGroupBy) StringX(ctx context.Context) string

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

func (*UserPushTokenGroupBy) Strings

func (uptgb *UserPushTokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserPushTokenGroupBy) StringsX

func (uptgb *UserPushTokenGroupBy) StringsX(ctx context.Context) []string

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

type UserPushTokenMutation

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

UserPushTokenMutation represents an operation that mutates the UserPushToken nodes in the graph.

func (*UserPushTokenMutation) AddField

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

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

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

func (*UserPushTokenMutation) AddedField

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

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

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

func (*UserPushTokenMutation) AddedIDs

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

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

func (*UserPushTokenMutation) AppID

func (m *UserPushTokenMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*UserPushTokenMutation) ClearEdge

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

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

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

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

func (*UserPushTokenMutation) ClearedFields

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

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

func (UserPushTokenMutation) Client

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

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

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

func (*UserPushTokenMutation) EdgeCleared

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

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

func (*UserPushTokenMutation) Field

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

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

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

func (*UserPushTokenMutation) Fields

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

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

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*UserPushTokenMutation) OldAppID

func (m *UserPushTokenMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the UserPushToken entity. If the UserPushToken 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 (*UserPushTokenMutation) OldCreatedAt

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

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

func (m *UserPushTokenMutation) 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 (*UserPushTokenMutation) OldToken

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

OldToken returns the old "token" field's value of the UserPushToken entity. If the UserPushToken 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 (*UserPushTokenMutation) OldUpdatedAt

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

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

func (m *UserPushTokenMutation) OldUserID(ctx context.Context) (v string, err error)

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

func (m *UserPushTokenMutation) Op() Op

Op returns the operation name.

func (*UserPushTokenMutation) RemovedEdges

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

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

func (*UserPushTokenMutation) RemovedIDs

func (m *UserPushTokenMutation) 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 (*UserPushTokenMutation) ResetAppID

func (m *UserPushTokenMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*UserPushTokenMutation) ResetCreatedAt

func (m *UserPushTokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserPushTokenMutation) ResetEdge

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

func (m *UserPushTokenMutation) 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 (*UserPushTokenMutation) ResetToken

func (m *UserPushTokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*UserPushTokenMutation) ResetUpdatedAt

func (m *UserPushTokenMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserPushTokenMutation) ResetUserID

func (m *UserPushTokenMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserPushTokenMutation) SetAppID

func (m *UserPushTokenMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*UserPushTokenMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserPushTokenMutation) SetField

func (m *UserPushTokenMutation) 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 (*UserPushTokenMutation) SetToken

func (m *UserPushTokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*UserPushTokenMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserPushTokenMutation) SetUserID

func (m *UserPushTokenMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*UserPushTokenMutation) Token

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

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

func (UserPushTokenMutation) Tx

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

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

func (*UserPushTokenMutation) Type

func (m *UserPushTokenMutation) Type() string

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

func (*UserPushTokenMutation) UpdatedAt

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

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

func (*UserPushTokenMutation) UserID

func (m *UserPushTokenMutation) UserID() (r string, exists bool)

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

type UserPushTokenQuery

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

UserPushTokenQuery is the builder for querying UserPushToken entities.

func (*UserPushTokenQuery) All

func (uptq *UserPushTokenQuery) All(ctx context.Context) ([]*UserPushToken, error)

All executes the query and returns a list of UserPushTokens.

func (*UserPushTokenQuery) AllX

func (uptq *UserPushTokenQuery) AllX(ctx context.Context) []*UserPushToken

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

func (*UserPushTokenQuery) Clone

func (uptq *UserPushTokenQuery) Clone() *UserPushTokenQuery

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

func (*UserPushTokenQuery) Count

func (uptq *UserPushTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserPushTokenQuery) CountX

func (uptq *UserPushTokenQuery) CountX(ctx context.Context) int

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

func (*UserPushTokenQuery) Exist

func (uptq *UserPushTokenQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserPushTokenQuery) ExistX

func (uptq *UserPushTokenQuery) ExistX(ctx context.Context) bool

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

func (*UserPushTokenQuery) First

func (uptq *UserPushTokenQuery) First(ctx context.Context) (*UserPushToken, error)

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

func (*UserPushTokenQuery) FirstID

func (uptq *UserPushTokenQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserPushTokenQuery) FirstIDX

func (uptq *UserPushTokenQuery) FirstIDX(ctx context.Context) int

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

func (*UserPushTokenQuery) FirstX

func (uptq *UserPushTokenQuery) FirstX(ctx context.Context) *UserPushToken

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

func (*UserPushTokenQuery) GroupBy

func (uptq *UserPushTokenQuery) GroupBy(field string, fields ...string) *UserPushTokenGroupBy

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

Example:

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

client.UserPushToken.Query().
	GroupBy(userpushtoken.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserPushTokenQuery) IDs

func (uptq *UserPushTokenQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserPushTokenQuery) IDsX

func (uptq *UserPushTokenQuery) IDsX(ctx context.Context) []int

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

func (*UserPushTokenQuery) Limit

func (uptq *UserPushTokenQuery) Limit(limit int) *UserPushTokenQuery

Limit adds a limit step to the query.

func (*UserPushTokenQuery) Offset

func (uptq *UserPushTokenQuery) Offset(offset int) *UserPushTokenQuery

Offset adds an offset step to the query.

func (*UserPushTokenQuery) Only

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

func (*UserPushTokenQuery) OnlyID

func (uptq *UserPushTokenQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserPushTokenQuery) OnlyIDX

func (uptq *UserPushTokenQuery) OnlyIDX(ctx context.Context) int

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

func (*UserPushTokenQuery) OnlyX

func (uptq *UserPushTokenQuery) OnlyX(ctx context.Context) *UserPushToken

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

func (*UserPushTokenQuery) Order

func (uptq *UserPushTokenQuery) Order(o ...OrderFunc) *UserPushTokenQuery

Order adds an order step to the query.

func (*UserPushTokenQuery) Select

func (uptq *UserPushTokenQuery) Select(field string, fields ...string) *UserPushTokenSelect

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

Example:

var v []struct {
	UserID string `json:"user_id,omitempty"`
}

client.UserPushToken.Query().
	Select(userpushtoken.FieldUserID).
	Scan(ctx, &v)

func (*UserPushTokenQuery) Unique

func (uptq *UserPushTokenQuery) Unique(unique bool) *UserPushTokenQuery

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

Where adds a new predicate for the UserPushTokenQuery builder.

type UserPushTokenSelect

type UserPushTokenSelect struct {
	*UserPushTokenQuery
	// contains filtered or unexported fields
}

UserPushTokenSelect is the builder for selecting fields of UserPushToken entities.

func (*UserPushTokenSelect) Bool

func (upts *UserPushTokenSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserPushTokenSelect) BoolX

func (upts *UserPushTokenSelect) BoolX(ctx context.Context) bool

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

func (*UserPushTokenSelect) Bools

func (upts *UserPushTokenSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserPushTokenSelect) BoolsX

func (upts *UserPushTokenSelect) BoolsX(ctx context.Context) []bool

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

func (*UserPushTokenSelect) Float64

func (upts *UserPushTokenSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserPushTokenSelect) Float64X

func (upts *UserPushTokenSelect) Float64X(ctx context.Context) float64

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

func (*UserPushTokenSelect) Float64s

func (upts *UserPushTokenSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserPushTokenSelect) Float64sX

func (upts *UserPushTokenSelect) Float64sX(ctx context.Context) []float64

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

func (*UserPushTokenSelect) Int

func (upts *UserPushTokenSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserPushTokenSelect) IntX

func (upts *UserPushTokenSelect) IntX(ctx context.Context) int

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

func (*UserPushTokenSelect) Ints

func (upts *UserPushTokenSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserPushTokenSelect) IntsX

func (upts *UserPushTokenSelect) IntsX(ctx context.Context) []int

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

func (*UserPushTokenSelect) Scan

func (upts *UserPushTokenSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserPushTokenSelect) ScanX

func (upts *UserPushTokenSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserPushTokenSelect) String

func (upts *UserPushTokenSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserPushTokenSelect) StringX

func (upts *UserPushTokenSelect) StringX(ctx context.Context) string

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

func (*UserPushTokenSelect) Strings

func (upts *UserPushTokenSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserPushTokenSelect) StringsX

func (upts *UserPushTokenSelect) StringsX(ctx context.Context) []string

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

type UserPushTokenUpdate

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

UserPushTokenUpdate is the builder for updating UserPushToken entities.

func (*UserPushTokenUpdate) Exec

func (uptu *UserPushTokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserPushTokenUpdate) ExecX

func (uptu *UserPushTokenUpdate) ExecX(ctx context.Context)

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

func (*UserPushTokenUpdate) Mutation

func (uptu *UserPushTokenUpdate) Mutation() *UserPushTokenMutation

Mutation returns the UserPushTokenMutation object of the builder.

func (*UserPushTokenUpdate) Save

func (uptu *UserPushTokenUpdate) Save(ctx context.Context) (int, error)

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

func (*UserPushTokenUpdate) SaveX

func (uptu *UserPushTokenUpdate) SaveX(ctx context.Context) int

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

func (*UserPushTokenUpdate) SetAppID

func (uptu *UserPushTokenUpdate) SetAppID(s string) *UserPushTokenUpdate

SetAppID sets the "app_id" field.

func (*UserPushTokenUpdate) SetCreatedAt

func (uptu *UserPushTokenUpdate) SetCreatedAt(t time.Time) *UserPushTokenUpdate

SetCreatedAt sets the "created_at" field.

func (*UserPushTokenUpdate) SetNillableCreatedAt

func (uptu *UserPushTokenUpdate) SetNillableCreatedAt(t *time.Time) *UserPushTokenUpdate

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

func (*UserPushTokenUpdate) SetToken

func (uptu *UserPushTokenUpdate) SetToken(s string) *UserPushTokenUpdate

SetToken sets the "token" field.

func (*UserPushTokenUpdate) SetUpdatedAt

func (uptu *UserPushTokenUpdate) SetUpdatedAt(t time.Time) *UserPushTokenUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserPushTokenUpdate) SetUserID

func (uptu *UserPushTokenUpdate) SetUserID(s string) *UserPushTokenUpdate

SetUserID sets the "user_id" field.

func (*UserPushTokenUpdate) Where

Where adds a new predicate for the UserPushTokenUpdate builder.

type UserPushTokenUpdateOne

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

UserPushTokenUpdateOne is the builder for updating a single UserPushToken entity.

func (*UserPushTokenUpdateOne) Exec

func (uptuo *UserPushTokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserPushTokenUpdateOne) ExecX

func (uptuo *UserPushTokenUpdateOne) ExecX(ctx context.Context)

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

func (*UserPushTokenUpdateOne) Mutation

func (uptuo *UserPushTokenUpdateOne) Mutation() *UserPushTokenMutation

Mutation returns the UserPushTokenMutation object of the builder.

func (*UserPushTokenUpdateOne) Save

Save executes the query and returns the updated UserPushToken entity.

func (*UserPushTokenUpdateOne) SaveX

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

func (*UserPushTokenUpdateOne) Select

func (uptuo *UserPushTokenUpdateOne) Select(field string, fields ...string) *UserPushTokenUpdateOne

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

func (*UserPushTokenUpdateOne) SetAppID

SetAppID sets the "app_id" field.

func (*UserPushTokenUpdateOne) SetCreatedAt

func (uptuo *UserPushTokenUpdateOne) SetCreatedAt(t time.Time) *UserPushTokenUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserPushTokenUpdateOne) SetNillableCreatedAt

func (uptuo *UserPushTokenUpdateOne) SetNillableCreatedAt(t *time.Time) *UserPushTokenUpdateOne

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

func (*UserPushTokenUpdateOne) SetToken

SetToken sets the "token" field.

func (*UserPushTokenUpdateOne) SetUpdatedAt

func (uptuo *UserPushTokenUpdateOne) SetUpdatedAt(t time.Time) *UserPushTokenUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserPushTokenUpdateOne) SetUserID

SetUserID sets the "user_id" field.

type UserPushTokens

type UserPushTokens []*UserPushToken

UserPushTokens is a parsable slice of UserPushToken.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field 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