entschema

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 19 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.
	TypeTest = "Test"
)

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 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(entschema.As(entschema.Sum(field1), "sum_field1"), (entschema.As(entschema.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
	// Test is the client for interacting with the Test builders.
	Test *TestClient
	// 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().
	Test.
	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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

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(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 Test

type Test struct {

	// ID of the ent.
	// 门店id
	ID int `json:"id,omitempty"`
	// UID holds the value of the "uid" field.
	UID string `json:"uid,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"`
	// DeactivatedAt holds the value of the "deactivated_at" field.
	DeactivatedAt *time.Time `json:"deactivated_at,omitempty"`
	// 门店名称
	Name string `json:"name,omitempty"`
	// 是否开启外卖
	EnableTakeaway bool `json:"enable_takeaway,omitempty"`
	// 手机号
	Phone string `json:"phone,omitempty"`
	// 门店公告
	Announcement string `json:"announcement,omitempty"`
	// 是否开启自动接单
	EnableAutoAccept bool `json:"enable_auto_accept,omitempty"`
	// 外卖配置
	DeliveryConfigs schema.DeliveryConfig `json:"delivery_configs,omitempty"`
	// 支付配置
	PayConfigs schema.PayConfig `json:"pay_configs,omitempty"`
	// 打印次数
	PrintTimes *int `json:"print_times,omitempty"`
	// 铃声配置
	RingConfigs schema.RingConfig `json:"ring_configs,omitempty"`
	// 商户id
	BusinessGroupID int `json:"business_group_id,omitempty"`
	// 商户uid
	BusinessGroupUID string `json:"business_group_uid,omitempty"`
	// 菜品品类
	DishCategories []string `json:"dish_categories,omitempty"`
	// 外卖订购有效期
	EndOfTakeaway time.Time `json:"end_of_takeaway,omitempty"`
	// 可选模式
	Mode int `json:"mode,omitempty"`
	// 自取配置
	SelfPickupConfigs schema.SelfPickupConfig `json:"self_pickup_configs,omitempty"`
	// shiva的门店 ID
	ServerID int `json:"server_id,omitempty"`
	// 门店图片
	Image string `json:"image,omitempty"`
	// 门店地址
	Address string `json:"address,omitempty"`
	// 纬度
	Latitude string `json:"latitude,omitempty"`
	// 经度
	Longitude string `json:"longitude,omitempty"`
	// 门店广告位
	Banners schema.Banners `json:"banners,omitempty"`
	// 自定义排序
	Sort int `json:"sort,omitempty"`
	// 支付模式
	PayMode string `json:"pay_mode,omitempty"`
	// 堂食配置
	DineInConfigs schema.DineInConfigs `json:"dine_in_configs,omitempty"`
	// 套餐配置
	DealsConfig schema.DealsConfig `json:"deals_config,omitempty"`
	// 小票打印相关字段
	PrintConfig schema.PrintConfig `json:"print_config,omitempty"`
	// contains filtered or unexported fields
}

Test is the model entity for the Test schema.

func (*Test) String

func (t *Test) String() string

String implements the fmt.Stringer.

func (*Test) Unwrap

func (t *Test) Unwrap() *Test

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

func (t *Test) Update() *TestUpdateOne

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

type TestClient

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

TestClient is a client for the Test schema.

func NewTestClient

func NewTestClient(c config) *TestClient

NewTestClient returns a client for the Test from the given config.

func (*TestClient) Create

func (c *TestClient) Create() *TestCreate

Create returns a builder for creating a Test entity.

func (*TestClient) CreateBulk

func (c *TestClient) CreateBulk(builders ...*TestCreate) *TestCreateBulk

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

func (*TestClient) Delete

func (c *TestClient) Delete() *TestDelete

Delete returns a delete builder for Test.

func (*TestClient) DeleteOne

func (c *TestClient) DeleteOne(t *Test) *TestDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TestClient) DeleteOneID

func (c *TestClient) DeleteOneID(id int) *TestDeleteOne

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

func (*TestClient) Get

func (c *TestClient) Get(ctx context.Context, id int) (*Test, error)

Get returns a Test entity by its id.

func (*TestClient) GetX

func (c *TestClient) GetX(ctx context.Context, id int) *Test

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

func (*TestClient) Hooks

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

Hooks returns the client hooks.

func (*TestClient) Query

func (c *TestClient) Query() *TestQuery

Query returns a query builder for Test.

func (*TestClient) Update

func (c *TestClient) Update() *TestUpdate

Update returns an update builder for Test.

func (*TestClient) UpdateOne

func (c *TestClient) UpdateOne(t *Test) *TestUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TestClient) UpdateOneID

func (c *TestClient) UpdateOneID(id int) *TestUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TestClient) Use

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

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

type TestCreate

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

TestCreate is the builder for creating a Test entity.

func (*TestCreate) Exec

func (tc *TestCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestCreate) ExecX

func (tc *TestCreate) ExecX(ctx context.Context)

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

func (*TestCreate) Mutation

func (tc *TestCreate) Mutation() *TestMutation

Mutation returns the TestMutation object of the builder.

func (*TestCreate) OnConflict

func (tc *TestCreate) OnConflict(opts ...sql.ConflictOption) *TestUpsertOne

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

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

func (*TestCreate) OnConflictColumns

func (tc *TestCreate) OnConflictColumns(columns ...string) *TestUpsertOne

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

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

func (*TestCreate) Save

func (tc *TestCreate) Save(ctx context.Context) (*Test, error)

Save creates the Test in the database.

func (*TestCreate) SaveX

func (tc *TestCreate) SaveX(ctx context.Context) *Test

SaveX calls Save and panics if Save returns an error.

func (*TestCreate) SetAddress

func (tc *TestCreate) SetAddress(s string) *TestCreate

SetAddress sets the "address" field.

func (*TestCreate) SetAnnouncement

func (tc *TestCreate) SetAnnouncement(s string) *TestCreate

SetAnnouncement sets the "announcement" field.

func (*TestCreate) SetBanners

func (tc *TestCreate) SetBanners(s schema.Banners) *TestCreate

SetBanners sets the "banners" field.

func (*TestCreate) SetBusinessGroupID

func (tc *TestCreate) SetBusinessGroupID(i int) *TestCreate

SetBusinessGroupID sets the "business_group_id" field.

func (*TestCreate) SetBusinessGroupUID

func (tc *TestCreate) SetBusinessGroupUID(s string) *TestCreate

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestCreate) SetCreatedAt

func (tc *TestCreate) SetCreatedAt(t time.Time) *TestCreate

SetCreatedAt sets the "created_at" field.

func (*TestCreate) SetDeactivatedAt

func (tc *TestCreate) SetDeactivatedAt(t time.Time) *TestCreate

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestCreate) SetDealsConfig

func (tc *TestCreate) SetDealsConfig(sc schema.DealsConfig) *TestCreate

SetDealsConfig sets the "deals_config" field.

func (*TestCreate) SetDeliveryConfigs

func (tc *TestCreate) SetDeliveryConfigs(sc schema.DeliveryConfig) *TestCreate

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestCreate) SetDineInConfigs

func (tc *TestCreate) SetDineInConfigs(sic schema.DineInConfigs) *TestCreate

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestCreate) SetDishCategories

func (tc *TestCreate) SetDishCategories(s []string) *TestCreate

SetDishCategories sets the "dish_categories" field.

func (*TestCreate) SetEnableAutoAccept

func (tc *TestCreate) SetEnableAutoAccept(b bool) *TestCreate

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestCreate) SetEnableTakeaway

func (tc *TestCreate) SetEnableTakeaway(b bool) *TestCreate

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestCreate) SetEndOfTakeaway

func (tc *TestCreate) SetEndOfTakeaway(t time.Time) *TestCreate

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestCreate) SetID

func (tc *TestCreate) SetID(i int) *TestCreate

SetID sets the "id" field.

func (*TestCreate) SetImage

func (tc *TestCreate) SetImage(s string) *TestCreate

SetImage sets the "image" field.

func (*TestCreate) SetLatitude

func (tc *TestCreate) SetLatitude(s string) *TestCreate

SetLatitude sets the "latitude" field.

func (*TestCreate) SetLongitude

func (tc *TestCreate) SetLongitude(s string) *TestCreate

SetLongitude sets the "longitude" field.

func (*TestCreate) SetMode

func (tc *TestCreate) SetMode(i int) *TestCreate

SetMode sets the "mode" field.

func (*TestCreate) SetName

func (tc *TestCreate) SetName(s string) *TestCreate

SetName sets the "name" field.

func (*TestCreate) SetNillableCreatedAt

func (tc *TestCreate) SetNillableCreatedAt(t *time.Time) *TestCreate

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

func (*TestCreate) SetNillableDeactivatedAt

func (tc *TestCreate) SetNillableDeactivatedAt(t *time.Time) *TestCreate

SetNillableDeactivatedAt sets the "deactivated_at" field if the given value is not nil.

func (*TestCreate) SetNillableDealsConfig

func (tc *TestCreate) SetNillableDealsConfig(sc *schema.DealsConfig) *TestCreate

SetNillableDealsConfig sets the "deals_config" field if the given value is not nil.

func (*TestCreate) SetNillableDineInConfigs

func (tc *TestCreate) SetNillableDineInConfigs(sic *schema.DineInConfigs) *TestCreate

SetNillableDineInConfigs sets the "dine_in_configs" field if the given value is not nil.

func (*TestCreate) SetNillableEnableAutoAccept

func (tc *TestCreate) SetNillableEnableAutoAccept(b *bool) *TestCreate

SetNillableEnableAutoAccept sets the "enable_auto_accept" field if the given value is not nil.

func (*TestCreate) SetNillableEnableTakeaway

func (tc *TestCreate) SetNillableEnableTakeaway(b *bool) *TestCreate

SetNillableEnableTakeaway sets the "enable_takeaway" field if the given value is not nil.

func (*TestCreate) SetNillableEndOfTakeaway

func (tc *TestCreate) SetNillableEndOfTakeaway(t *time.Time) *TestCreate

SetNillableEndOfTakeaway sets the "end_of_takeaway" field if the given value is not nil.

func (*TestCreate) SetNillableMode

func (tc *TestCreate) SetNillableMode(i *int) *TestCreate

SetNillableMode sets the "mode" field if the given value is not nil.

func (*TestCreate) SetNillablePayMode

func (tc *TestCreate) SetNillablePayMode(s *string) *TestCreate

SetNillablePayMode sets the "pay_mode" field if the given value is not nil.

func (*TestCreate) SetNillablePrintConfig

func (tc *TestCreate) SetNillablePrintConfig(sc *schema.PrintConfig) *TestCreate

SetNillablePrintConfig sets the "print_config" field if the given value is not nil.

func (*TestCreate) SetNillablePrintTimes added in v0.1.2

func (tc *TestCreate) SetNillablePrintTimes(i *int) *TestCreate

SetNillablePrintTimes sets the "print_times" field if the given value is not nil.

func (*TestCreate) SetNillableSort

func (tc *TestCreate) SetNillableSort(i *int) *TestCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*TestCreate) SetNillableUID

func (tc *TestCreate) SetNillableUID(s *string) *TestCreate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*TestCreate) SetNillableUpdatedAt

func (tc *TestCreate) SetNillableUpdatedAt(t *time.Time) *TestCreate

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

func (*TestCreate) SetPayConfigs

func (tc *TestCreate) SetPayConfigs(sc schema.PayConfig) *TestCreate

SetPayConfigs sets the "pay_configs" field.

func (*TestCreate) SetPayMode

func (tc *TestCreate) SetPayMode(s string) *TestCreate

SetPayMode sets the "pay_mode" field.

func (*TestCreate) SetPhone

func (tc *TestCreate) SetPhone(s string) *TestCreate

SetPhone sets the "phone" field.

func (*TestCreate) SetPrintConfig

func (tc *TestCreate) SetPrintConfig(sc schema.PrintConfig) *TestCreate

SetPrintConfig sets the "print_config" field.

func (*TestCreate) SetPrintTimes

func (tc *TestCreate) SetPrintTimes(i int) *TestCreate

SetPrintTimes sets the "print_times" field.

func (*TestCreate) SetRingConfigs

func (tc *TestCreate) SetRingConfigs(sc schema.RingConfig) *TestCreate

SetRingConfigs sets the "ring_configs" field.

func (*TestCreate) SetSelfPickupConfigs

func (tc *TestCreate) SetSelfPickupConfigs(spc schema.SelfPickupConfig) *TestCreate

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestCreate) SetServerID

func (tc *TestCreate) SetServerID(i int) *TestCreate

SetServerID sets the "server_id" field.

func (*TestCreate) SetSort

func (tc *TestCreate) SetSort(i int) *TestCreate

SetSort sets the "sort" field.

func (*TestCreate) SetUID

func (tc *TestCreate) SetUID(s string) *TestCreate

SetUID sets the "uid" field.

func (*TestCreate) SetUpdatedAt

func (tc *TestCreate) SetUpdatedAt(t time.Time) *TestCreate

SetUpdatedAt sets the "updated_at" field.

type TestCreateBulk

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

TestCreateBulk is the builder for creating many Test entities in bulk.

func (*TestCreateBulk) Exec

func (tcb *TestCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TestCreateBulk) ExecX

func (tcb *TestCreateBulk) ExecX(ctx context.Context)

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

func (*TestCreateBulk) OnConflict

func (tcb *TestCreateBulk) OnConflict(opts ...sql.ConflictOption) *TestUpsertBulk

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

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

func (*TestCreateBulk) OnConflictColumns

func (tcb *TestCreateBulk) OnConflictColumns(columns ...string) *TestUpsertBulk

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

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

func (*TestCreateBulk) Save

func (tcb *TestCreateBulk) Save(ctx context.Context) ([]*Test, error)

Save creates the Test entities in the database.

func (*TestCreateBulk) SaveX

func (tcb *TestCreateBulk) SaveX(ctx context.Context) []*Test

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

type TestDelete

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

TestDelete is the builder for deleting a Test entity.

func (*TestDelete) Exec

func (td *TestDelete) Exec(ctx context.Context) (int, error)

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

func (*TestDelete) ExecX

func (td *TestDelete) ExecX(ctx context.Context) int

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

func (*TestDelete) Where

func (td *TestDelete) Where(ps ...predicate.Test) *TestDelete

Where appends a list predicates to the TestDelete builder.

type TestDeleteOne

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

TestDeleteOne is the builder for deleting a single Test entity.

func (*TestDeleteOne) Exec

func (tdo *TestDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TestDeleteOne) ExecX

func (tdo *TestDeleteOne) ExecX(ctx context.Context)

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

type TestGroupBy

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

TestGroupBy is the group-by builder for Test entities.

func (*TestGroupBy) Aggregate

func (tgb *TestGroupBy) Aggregate(fns ...AggregateFunc) *TestGroupBy

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

func (*TestGroupBy) Bool

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

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

func (*TestGroupBy) BoolX

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

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

func (*TestGroupBy) Bools

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

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

func (*TestGroupBy) BoolsX

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

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

func (*TestGroupBy) Float64

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

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

func (*TestGroupBy) Float64X

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

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

func (*TestGroupBy) Float64s

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

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

func (*TestGroupBy) Float64sX

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

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

func (*TestGroupBy) Int

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

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

func (*TestGroupBy) IntX

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

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

func (*TestGroupBy) Ints

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

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

func (*TestGroupBy) IntsX

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

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

func (*TestGroupBy) Scan

func (tgb *TestGroupBy) Scan(ctx context.Context, v any) error

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

func (*TestGroupBy) ScanX

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

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

func (*TestGroupBy) String

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

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

func (*TestGroupBy) StringX

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

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

func (*TestGroupBy) Strings

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

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

func (*TestGroupBy) StringsX

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

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

type TestMutation

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

TestMutation represents an operation that mutates the Test nodes in the graph.

func (*TestMutation) AddBusinessGroupID

func (m *TestMutation) AddBusinessGroupID(i int)

AddBusinessGroupID adds i to the "business_group_id" field.

func (*TestMutation) AddField

func (m *TestMutation) 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 (*TestMutation) AddMode

func (m *TestMutation) AddMode(i int)

AddMode adds i to the "mode" field.

func (*TestMutation) AddPrintTimes

func (m *TestMutation) AddPrintTimes(i int)

AddPrintTimes adds i to the "print_times" field.

func (*TestMutation) AddServerID

func (m *TestMutation) AddServerID(i int)

AddServerID adds i to the "server_id" field.

func (*TestMutation) AddSort

func (m *TestMutation) AddSort(i int)

AddSort adds i to the "sort" field.

func (*TestMutation) AddedBusinessGroupID

func (m *TestMutation) AddedBusinessGroupID() (r int, exists bool)

AddedBusinessGroupID returns the value that was added to the "business_group_id" field in this mutation.

func (*TestMutation) AddedEdges

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

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

func (*TestMutation) AddedField

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

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

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

func (*TestMutation) AddedIDs

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

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

func (*TestMutation) AddedMode

func (m *TestMutation) AddedMode() (r int, exists bool)

AddedMode returns the value that was added to the "mode" field in this mutation.

func (*TestMutation) AddedPrintTimes

func (m *TestMutation) AddedPrintTimes() (r int, exists bool)

AddedPrintTimes returns the value that was added to the "print_times" field in this mutation.

func (*TestMutation) AddedServerID

func (m *TestMutation) AddedServerID() (r int, exists bool)

AddedServerID returns the value that was added to the "server_id" field in this mutation.

func (*TestMutation) AddedSort

func (m *TestMutation) AddedSort() (r int, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*TestMutation) Address

func (m *TestMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*TestMutation) Announcement

func (m *TestMutation) Announcement() (r string, exists bool)

Announcement returns the value of the "announcement" field in the mutation.

func (*TestMutation) AppendDishCategories

func (m *TestMutation) AppendDishCategories(s []string)

AppendDishCategories adds s to the "dish_categories" field.

func (*TestMutation) AppendedDishCategories

func (m *TestMutation) AppendedDishCategories() ([]string, bool)

AppendedDishCategories returns the list of values that were appended to the "dish_categories" field in this mutation.

func (*TestMutation) Banners

func (m *TestMutation) Banners() (r schema.Banners, exists bool)

Banners returns the value of the "banners" field in the mutation.

func (*TestMutation) BusinessGroupID

func (m *TestMutation) BusinessGroupID() (r int, exists bool)

BusinessGroupID returns the value of the "business_group_id" field in the mutation.

func (*TestMutation) BusinessGroupUID

func (m *TestMutation) BusinessGroupUID() (r string, exists bool)

BusinessGroupUID returns the value of the "business_group_uid" field in the mutation.

func (*TestMutation) ClearDeactivatedAt

func (m *TestMutation) ClearDeactivatedAt()

ClearDeactivatedAt clears the value of the "deactivated_at" field.

func (*TestMutation) ClearDealsConfig

func (m *TestMutation) ClearDealsConfig()

ClearDealsConfig clears the value of the "deals_config" field.

func (*TestMutation) ClearDineInConfigs

func (m *TestMutation) ClearDineInConfigs()

ClearDineInConfigs clears the value of the "dine_in_configs" field.

func (*TestMutation) ClearEdge

func (m *TestMutation) 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 (*TestMutation) ClearEndOfTakeaway

func (m *TestMutation) ClearEndOfTakeaway()

ClearEndOfTakeaway clears the value of the "end_of_takeaway" field.

func (*TestMutation) ClearField

func (m *TestMutation) 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 (*TestMutation) ClearPrintConfig

func (m *TestMutation) ClearPrintConfig()

ClearPrintConfig clears the value of the "print_config" field.

func (*TestMutation) ClearPrintTimes added in v0.1.2

func (m *TestMutation) ClearPrintTimes()

ClearPrintTimes clears the value of the "print_times" field.

func (*TestMutation) ClearedEdges

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

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

func (*TestMutation) ClearedFields

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

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

func (TestMutation) Client

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

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

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

func (*TestMutation) DeactivatedAt

func (m *TestMutation) DeactivatedAt() (r time.Time, exists bool)

DeactivatedAt returns the value of the "deactivated_at" field in the mutation.

func (*TestMutation) DeactivatedAtCleared

func (m *TestMutation) DeactivatedAtCleared() bool

DeactivatedAtCleared returns if the "deactivated_at" field was cleared in this mutation.

func (*TestMutation) DealsConfig

func (m *TestMutation) DealsConfig() (r schema.DealsConfig, exists bool)

DealsConfig returns the value of the "deals_config" field in the mutation.

func (*TestMutation) DealsConfigCleared

func (m *TestMutation) DealsConfigCleared() bool

DealsConfigCleared returns if the "deals_config" field was cleared in this mutation.

func (*TestMutation) DeliveryConfigs

func (m *TestMutation) DeliveryConfigs() (r schema.DeliveryConfig, exists bool)

DeliveryConfigs returns the value of the "delivery_configs" field in the mutation.

func (*TestMutation) DineInConfigs

func (m *TestMutation) DineInConfigs() (r schema.DineInConfigs, exists bool)

DineInConfigs returns the value of the "dine_in_configs" field in the mutation.

func (*TestMutation) DineInConfigsCleared

func (m *TestMutation) DineInConfigsCleared() bool

DineInConfigsCleared returns if the "dine_in_configs" field was cleared in this mutation.

func (*TestMutation) DishCategories

func (m *TestMutation) DishCategories() (r []string, exists bool)

DishCategories returns the value of the "dish_categories" field in the mutation.

func (*TestMutation) EdgeCleared

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

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

func (*TestMutation) EnableAutoAccept

func (m *TestMutation) EnableAutoAccept() (r bool, exists bool)

EnableAutoAccept returns the value of the "enable_auto_accept" field in the mutation.

func (*TestMutation) EnableTakeaway

func (m *TestMutation) EnableTakeaway() (r bool, exists bool)

EnableTakeaway returns the value of the "enable_takeaway" field in the mutation.

func (*TestMutation) EndOfTakeaway

func (m *TestMutation) EndOfTakeaway() (r time.Time, exists bool)

EndOfTakeaway returns the value of the "end_of_takeaway" field in the mutation.

func (*TestMutation) EndOfTakeawayCleared

func (m *TestMutation) EndOfTakeawayCleared() bool

EndOfTakeawayCleared returns if the "end_of_takeaway" field was cleared in this mutation.

func (*TestMutation) Field

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

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

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

func (*TestMutation) Fields

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

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

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

func (*TestMutation) IDs

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

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

func (*TestMutation) Image

func (m *TestMutation) Image() (r string, exists bool)

Image returns the value of the "image" field in the mutation.

func (*TestMutation) Latitude

func (m *TestMutation) Latitude() (r string, exists bool)

Latitude returns the value of the "latitude" field in the mutation.

func (*TestMutation) Longitude

func (m *TestMutation) Longitude() (r string, exists bool)

Longitude returns the value of the "longitude" field in the mutation.

func (*TestMutation) Mode

func (m *TestMutation) Mode() (r int, exists bool)

Mode returns the value of the "mode" field in the mutation.

func (*TestMutation) Name

func (m *TestMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*TestMutation) OldAddress

func (m *TestMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Test entity. If the Test 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 (*TestMutation) OldAnnouncement

func (m *TestMutation) OldAnnouncement(ctx context.Context) (v string, err error)

OldAnnouncement returns the old "announcement" field's value of the Test entity. If the Test 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 (*TestMutation) OldBanners

func (m *TestMutation) OldBanners(ctx context.Context) (v schema.Banners, err error)

OldBanners returns the old "banners" field's value of the Test entity. If the Test 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 (*TestMutation) OldBusinessGroupID

func (m *TestMutation) OldBusinessGroupID(ctx context.Context) (v int, err error)

OldBusinessGroupID returns the old "business_group_id" field's value of the Test entity. If the Test 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 (*TestMutation) OldBusinessGroupUID

func (m *TestMutation) OldBusinessGroupUID(ctx context.Context) (v string, err error)

OldBusinessGroupUID returns the old "business_group_uid" field's value of the Test entity. If the Test 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 (*TestMutation) OldCreatedAt

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

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

func (m *TestMutation) OldDeactivatedAt(ctx context.Context) (v *time.Time, err error)

OldDeactivatedAt returns the old "deactivated_at" field's value of the Test entity. If the Test 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 (*TestMutation) OldDealsConfig

func (m *TestMutation) OldDealsConfig(ctx context.Context) (v schema.DealsConfig, err error)

OldDealsConfig returns the old "deals_config" field's value of the Test entity. If the Test 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 (*TestMutation) OldDeliveryConfigs

func (m *TestMutation) OldDeliveryConfigs(ctx context.Context) (v schema.DeliveryConfig, err error)

OldDeliveryConfigs returns the old "delivery_configs" field's value of the Test entity. If the Test 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 (*TestMutation) OldDineInConfigs

func (m *TestMutation) OldDineInConfigs(ctx context.Context) (v schema.DineInConfigs, err error)

OldDineInConfigs returns the old "dine_in_configs" field's value of the Test entity. If the Test 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 (*TestMutation) OldDishCategories

func (m *TestMutation) OldDishCategories(ctx context.Context) (v []string, err error)

OldDishCategories returns the old "dish_categories" field's value of the Test entity. If the Test 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 (*TestMutation) OldEnableAutoAccept

func (m *TestMutation) OldEnableAutoAccept(ctx context.Context) (v bool, err error)

OldEnableAutoAccept returns the old "enable_auto_accept" field's value of the Test entity. If the Test 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 (*TestMutation) OldEnableTakeaway

func (m *TestMutation) OldEnableTakeaway(ctx context.Context) (v bool, err error)

OldEnableTakeaway returns the old "enable_takeaway" field's value of the Test entity. If the Test 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 (*TestMutation) OldEndOfTakeaway

func (m *TestMutation) OldEndOfTakeaway(ctx context.Context) (v time.Time, err error)

OldEndOfTakeaway returns the old "end_of_takeaway" field's value of the Test entity. If the Test 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 (*TestMutation) OldField

func (m *TestMutation) 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 (*TestMutation) OldImage

func (m *TestMutation) OldImage(ctx context.Context) (v string, err error)

OldImage returns the old "image" field's value of the Test entity. If the Test 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 (*TestMutation) OldLatitude

func (m *TestMutation) OldLatitude(ctx context.Context) (v string, err error)

OldLatitude returns the old "latitude" field's value of the Test entity. If the Test 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 (*TestMutation) OldLongitude

func (m *TestMutation) OldLongitude(ctx context.Context) (v string, err error)

OldLongitude returns the old "longitude" field's value of the Test entity. If the Test 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 (*TestMutation) OldMode

func (m *TestMutation) OldMode(ctx context.Context) (v int, err error)

OldMode returns the old "mode" field's value of the Test entity. If the Test 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 (*TestMutation) OldName

func (m *TestMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Test entity. If the Test 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 (*TestMutation) OldPayConfigs

func (m *TestMutation) OldPayConfigs(ctx context.Context) (v schema.PayConfig, err error)

OldPayConfigs returns the old "pay_configs" field's value of the Test entity. If the Test 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 (*TestMutation) OldPayMode

func (m *TestMutation) OldPayMode(ctx context.Context) (v string, err error)

OldPayMode returns the old "pay_mode" field's value of the Test entity. If the Test 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 (*TestMutation) OldPhone

func (m *TestMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Test entity. If the Test 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 (*TestMutation) OldPrintConfig

func (m *TestMutation) OldPrintConfig(ctx context.Context) (v schema.PrintConfig, err error)

OldPrintConfig returns the old "print_config" field's value of the Test entity. If the Test 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 (*TestMutation) OldPrintTimes

func (m *TestMutation) OldPrintTimes(ctx context.Context) (v *int, err error)

OldPrintTimes returns the old "print_times" field's value of the Test entity. If the Test 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 (*TestMutation) OldRingConfigs

func (m *TestMutation) OldRingConfigs(ctx context.Context) (v schema.RingConfig, err error)

OldRingConfigs returns the old "ring_configs" field's value of the Test entity. If the Test 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 (*TestMutation) OldSelfPickupConfigs

func (m *TestMutation) OldSelfPickupConfigs(ctx context.Context) (v schema.SelfPickupConfig, err error)

OldSelfPickupConfigs returns the old "self_pickup_configs" field's value of the Test entity. If the Test 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 (*TestMutation) OldServerID

func (m *TestMutation) OldServerID(ctx context.Context) (v int, err error)

OldServerID returns the old "server_id" field's value of the Test entity. If the Test 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 (*TestMutation) OldSort

func (m *TestMutation) OldSort(ctx context.Context) (v int, err error)

OldSort returns the old "sort" field's value of the Test entity. If the Test 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 (*TestMutation) OldUID

func (m *TestMutation) OldUID(ctx context.Context) (v string, err error)

OldUID returns the old "uid" field's value of the Test entity. If the Test 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 (*TestMutation) OldUpdatedAt

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

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

func (m *TestMutation) Op() Op

Op returns the operation name.

func (*TestMutation) PayConfigs

func (m *TestMutation) PayConfigs() (r schema.PayConfig, exists bool)

PayConfigs returns the value of the "pay_configs" field in the mutation.

func (*TestMutation) PayMode

func (m *TestMutation) PayMode() (r string, exists bool)

PayMode returns the value of the "pay_mode" field in the mutation.

func (*TestMutation) Phone

func (m *TestMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*TestMutation) PrintConfig

func (m *TestMutation) PrintConfig() (r schema.PrintConfig, exists bool)

PrintConfig returns the value of the "print_config" field in the mutation.

func (*TestMutation) PrintConfigCleared

func (m *TestMutation) PrintConfigCleared() bool

PrintConfigCleared returns if the "print_config" field was cleared in this mutation.

func (*TestMutation) PrintTimes

func (m *TestMutation) PrintTimes() (r int, exists bool)

PrintTimes returns the value of the "print_times" field in the mutation.

func (*TestMutation) PrintTimesCleared added in v0.1.2

func (m *TestMutation) PrintTimesCleared() bool

PrintTimesCleared returns if the "print_times" field was cleared in this mutation.

func (*TestMutation) RemovedEdges

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

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

func (*TestMutation) RemovedIDs

func (m *TestMutation) 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 (*TestMutation) ResetAddress

func (m *TestMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*TestMutation) ResetAnnouncement

func (m *TestMutation) ResetAnnouncement()

ResetAnnouncement resets all changes to the "announcement" field.

func (*TestMutation) ResetBanners

func (m *TestMutation) ResetBanners()

ResetBanners resets all changes to the "banners" field.

func (*TestMutation) ResetBusinessGroupID

func (m *TestMutation) ResetBusinessGroupID()

ResetBusinessGroupID resets all changes to the "business_group_id" field.

func (*TestMutation) ResetBusinessGroupUID

func (m *TestMutation) ResetBusinessGroupUID()

ResetBusinessGroupUID resets all changes to the "business_group_uid" field.

func (*TestMutation) ResetCreatedAt

func (m *TestMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TestMutation) ResetDeactivatedAt

func (m *TestMutation) ResetDeactivatedAt()

ResetDeactivatedAt resets all changes to the "deactivated_at" field.

func (*TestMutation) ResetDealsConfig

func (m *TestMutation) ResetDealsConfig()

ResetDealsConfig resets all changes to the "deals_config" field.

func (*TestMutation) ResetDeliveryConfigs

func (m *TestMutation) ResetDeliveryConfigs()

ResetDeliveryConfigs resets all changes to the "delivery_configs" field.

func (*TestMutation) ResetDineInConfigs

func (m *TestMutation) ResetDineInConfigs()

ResetDineInConfigs resets all changes to the "dine_in_configs" field.

func (*TestMutation) ResetDishCategories

func (m *TestMutation) ResetDishCategories()

ResetDishCategories resets all changes to the "dish_categories" field.

func (*TestMutation) ResetEdge

func (m *TestMutation) 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 (*TestMutation) ResetEnableAutoAccept

func (m *TestMutation) ResetEnableAutoAccept()

ResetEnableAutoAccept resets all changes to the "enable_auto_accept" field.

func (*TestMutation) ResetEnableTakeaway

func (m *TestMutation) ResetEnableTakeaway()

ResetEnableTakeaway resets all changes to the "enable_takeaway" field.

func (*TestMutation) ResetEndOfTakeaway

func (m *TestMutation) ResetEndOfTakeaway()

ResetEndOfTakeaway resets all changes to the "end_of_takeaway" field.

func (*TestMutation) ResetField

func (m *TestMutation) 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 (*TestMutation) ResetImage

func (m *TestMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*TestMutation) ResetLatitude

func (m *TestMutation) ResetLatitude()

ResetLatitude resets all changes to the "latitude" field.

func (*TestMutation) ResetLongitude

func (m *TestMutation) ResetLongitude()

ResetLongitude resets all changes to the "longitude" field.

func (*TestMutation) ResetMode

func (m *TestMutation) ResetMode()

ResetMode resets all changes to the "mode" field.

func (*TestMutation) ResetName

func (m *TestMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TestMutation) ResetPayConfigs

func (m *TestMutation) ResetPayConfigs()

ResetPayConfigs resets all changes to the "pay_configs" field.

func (*TestMutation) ResetPayMode

func (m *TestMutation) ResetPayMode()

ResetPayMode resets all changes to the "pay_mode" field.

func (*TestMutation) ResetPhone

func (m *TestMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*TestMutation) ResetPrintConfig

func (m *TestMutation) ResetPrintConfig()

ResetPrintConfig resets all changes to the "print_config" field.

func (*TestMutation) ResetPrintTimes

func (m *TestMutation) ResetPrintTimes()

ResetPrintTimes resets all changes to the "print_times" field.

func (*TestMutation) ResetRingConfigs

func (m *TestMutation) ResetRingConfigs()

ResetRingConfigs resets all changes to the "ring_configs" field.

func (*TestMutation) ResetSelfPickupConfigs

func (m *TestMutation) ResetSelfPickupConfigs()

ResetSelfPickupConfigs resets all changes to the "self_pickup_configs" field.

func (*TestMutation) ResetServerID

func (m *TestMutation) ResetServerID()

ResetServerID resets all changes to the "server_id" field.

func (*TestMutation) ResetSort

func (m *TestMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*TestMutation) ResetUID

func (m *TestMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*TestMutation) ResetUpdatedAt

func (m *TestMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TestMutation) RingConfigs

func (m *TestMutation) RingConfigs() (r schema.RingConfig, exists bool)

RingConfigs returns the value of the "ring_configs" field in the mutation.

func (*TestMutation) SelfPickupConfigs

func (m *TestMutation) SelfPickupConfigs() (r schema.SelfPickupConfig, exists bool)

SelfPickupConfigs returns the value of the "self_pickup_configs" field in the mutation.

func (*TestMutation) ServerID

func (m *TestMutation) ServerID() (r int, exists bool)

ServerID returns the value of the "server_id" field in the mutation.

func (*TestMutation) SetAddress

func (m *TestMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*TestMutation) SetAnnouncement

func (m *TestMutation) SetAnnouncement(s string)

SetAnnouncement sets the "announcement" field.

func (*TestMutation) SetBanners

func (m *TestMutation) SetBanners(s schema.Banners)

SetBanners sets the "banners" field.

func (*TestMutation) SetBusinessGroupID

func (m *TestMutation) SetBusinessGroupID(i int)

SetBusinessGroupID sets the "business_group_id" field.

func (*TestMutation) SetBusinessGroupUID

func (m *TestMutation) SetBusinessGroupUID(s string)

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TestMutation) SetDeactivatedAt

func (m *TestMutation) SetDeactivatedAt(t time.Time)

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestMutation) SetDealsConfig

func (m *TestMutation) SetDealsConfig(sc schema.DealsConfig)

SetDealsConfig sets the "deals_config" field.

func (*TestMutation) SetDeliveryConfigs

func (m *TestMutation) SetDeliveryConfigs(sc schema.DeliveryConfig)

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestMutation) SetDineInConfigs

func (m *TestMutation) SetDineInConfigs(sic schema.DineInConfigs)

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestMutation) SetDishCategories

func (m *TestMutation) SetDishCategories(s []string)

SetDishCategories sets the "dish_categories" field.

func (*TestMutation) SetEnableAutoAccept

func (m *TestMutation) SetEnableAutoAccept(b bool)

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestMutation) SetEnableTakeaway

func (m *TestMutation) SetEnableTakeaway(b bool)

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestMutation) SetEndOfTakeaway

func (m *TestMutation) SetEndOfTakeaway(t time.Time)

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestMutation) SetField

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

func (m *TestMutation) SetID(id int)

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

func (*TestMutation) SetImage

func (m *TestMutation) SetImage(s string)

SetImage sets the "image" field.

func (*TestMutation) SetLatitude

func (m *TestMutation) SetLatitude(s string)

SetLatitude sets the "latitude" field.

func (*TestMutation) SetLongitude

func (m *TestMutation) SetLongitude(s string)

SetLongitude sets the "longitude" field.

func (*TestMutation) SetMode

func (m *TestMutation) SetMode(i int)

SetMode sets the "mode" field.

func (*TestMutation) SetName

func (m *TestMutation) SetName(s string)

SetName sets the "name" field.

func (*TestMutation) SetPayConfigs

func (m *TestMutation) SetPayConfigs(sc schema.PayConfig)

SetPayConfigs sets the "pay_configs" field.

func (*TestMutation) SetPayMode

func (m *TestMutation) SetPayMode(s string)

SetPayMode sets the "pay_mode" field.

func (*TestMutation) SetPhone

func (m *TestMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*TestMutation) SetPrintConfig

func (m *TestMutation) SetPrintConfig(sc schema.PrintConfig)

SetPrintConfig sets the "print_config" field.

func (*TestMutation) SetPrintTimes

func (m *TestMutation) SetPrintTimes(i int)

SetPrintTimes sets the "print_times" field.

func (*TestMutation) SetRingConfigs

func (m *TestMutation) SetRingConfigs(sc schema.RingConfig)

SetRingConfigs sets the "ring_configs" field.

func (*TestMutation) SetSelfPickupConfigs

func (m *TestMutation) SetSelfPickupConfigs(spc schema.SelfPickupConfig)

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestMutation) SetServerID

func (m *TestMutation) SetServerID(i int)

SetServerID sets the "server_id" field.

func (*TestMutation) SetSort

func (m *TestMutation) SetSort(i int)

SetSort sets the "sort" field.

func (*TestMutation) SetUID

func (m *TestMutation) SetUID(s string)

SetUID sets the "uid" field.

func (*TestMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*TestMutation) Sort

func (m *TestMutation) Sort() (r int, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (TestMutation) Tx

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

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

func (*TestMutation) Type

func (m *TestMutation) Type() string

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

func (*TestMutation) UID

func (m *TestMutation) UID() (r string, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*TestMutation) UpdatedAt

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

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

func (*TestMutation) Where

func (m *TestMutation) Where(ps ...predicate.Test)

Where appends a list predicates to the TestMutation builder.

type TestQuery

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

TestQuery is the builder for querying Test entities.

func (*TestQuery) Aggregate

func (tq *TestQuery) Aggregate(fns ...AggregateFunc) *TestSelect

Aggregate returns a TestSelect configured with the given aggregations.

func (*TestQuery) All

func (tq *TestQuery) All(ctx context.Context) ([]*Test, error)

All executes the query and returns a list of Tests.

func (*TestQuery) AllX

func (tq *TestQuery) AllX(ctx context.Context) []*Test

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

func (*TestQuery) Clone

func (tq *TestQuery) Clone() *TestQuery

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

func (*TestQuery) Count

func (tq *TestQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TestQuery) CountX

func (tq *TestQuery) CountX(ctx context.Context) int

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

func (*TestQuery) Exist

func (tq *TestQuery) Exist(ctx context.Context) (bool, error)

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

func (*TestQuery) ExistX

func (tq *TestQuery) ExistX(ctx context.Context) bool

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

func (*TestQuery) First

func (tq *TestQuery) First(ctx context.Context) (*Test, error)

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

func (*TestQuery) FirstID

func (tq *TestQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TestQuery) FirstIDX

func (tq *TestQuery) FirstIDX(ctx context.Context) int

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

func (*TestQuery) FirstX

func (tq *TestQuery) FirstX(ctx context.Context) *Test

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

func (*TestQuery) GroupBy

func (tq *TestQuery) GroupBy(field string, fields ...string) *TestGroupBy

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 {
	UID string `json:"uid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Test.Query().
	GroupBy(test.FieldUID).
	Aggregate(entschema.Count()).
	Scan(ctx, &v)

func (*TestQuery) IDs

func (tq *TestQuery) IDs(ctx context.Context) ([]int, error)

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

func (*TestQuery) IDsX

func (tq *TestQuery) IDsX(ctx context.Context) []int

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

func (*TestQuery) Limit

func (tq *TestQuery) Limit(limit int) *TestQuery

Limit adds a limit step to the query.

func (*TestQuery) Offset

func (tq *TestQuery) Offset(offset int) *TestQuery

Offset adds an offset step to the query.

func (*TestQuery) Only

func (tq *TestQuery) Only(ctx context.Context) (*Test, error)

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

func (*TestQuery) OnlyID

func (tq *TestQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TestQuery) OnlyIDX

func (tq *TestQuery) OnlyIDX(ctx context.Context) int

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

func (*TestQuery) OnlyX

func (tq *TestQuery) OnlyX(ctx context.Context) *Test

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

func (*TestQuery) Order

func (tq *TestQuery) Order(o ...OrderFunc) *TestQuery

Order adds an order step to the query.

func (*TestQuery) Select

func (tq *TestQuery) Select(fields ...string) *TestSelect

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 {
	UID string `json:"uid,omitempty"`
}

client.Test.Query().
	Select(test.FieldUID).
	Scan(ctx, &v)

func (*TestQuery) Unique

func (tq *TestQuery) Unique(unique bool) *TestQuery

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

func (tq *TestQuery) Where(ps ...predicate.Test) *TestQuery

Where adds a new predicate for the TestQuery builder.

type TestSelect

type TestSelect struct {
	*TestQuery
	// contains filtered or unexported fields
}

TestSelect is the builder for selecting fields of Test entities.

func (*TestSelect) Aggregate

func (ts *TestSelect) Aggregate(fns ...AggregateFunc) *TestSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TestSelect) Bool

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

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

func (*TestSelect) BoolX

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

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

func (*TestSelect) Bools

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

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

func (*TestSelect) BoolsX

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

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

func (*TestSelect) Float64

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

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

func (*TestSelect) Float64X

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

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

func (*TestSelect) Float64s

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

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

func (*TestSelect) Float64sX

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

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

func (*TestSelect) Int

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

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

func (*TestSelect) IntX

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

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

func (*TestSelect) Ints

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

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

func (*TestSelect) IntsX

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

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

func (*TestSelect) Scan

func (ts *TestSelect) Scan(ctx context.Context, v any) error

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

func (*TestSelect) ScanX

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

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

func (*TestSelect) String

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

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

func (*TestSelect) StringX

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

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

func (*TestSelect) Strings

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

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

func (*TestSelect) StringsX

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

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

type TestUpdate

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

TestUpdate is the builder for updating Test entities.

func (*TestUpdate) AddBusinessGroupID

func (tu *TestUpdate) AddBusinessGroupID(i int) *TestUpdate

AddBusinessGroupID adds i to the "business_group_id" field.

func (*TestUpdate) AddMode

func (tu *TestUpdate) AddMode(i int) *TestUpdate

AddMode adds i to the "mode" field.

func (*TestUpdate) AddPrintTimes

func (tu *TestUpdate) AddPrintTimes(i int) *TestUpdate

AddPrintTimes adds i to the "print_times" field.

func (*TestUpdate) AddServerID

func (tu *TestUpdate) AddServerID(i int) *TestUpdate

AddServerID adds i to the "server_id" field.

func (*TestUpdate) AddSort

func (tu *TestUpdate) AddSort(i int) *TestUpdate

AddSort adds i to the "sort" field.

func (*TestUpdate) AppendDishCategories

func (tu *TestUpdate) AppendDishCategories(s []string) *TestUpdate

AppendDishCategories appends s to the "dish_categories" field.

func (*TestUpdate) ClearDeactivatedAt

func (tu *TestUpdate) ClearDeactivatedAt() *TestUpdate

ClearDeactivatedAt clears the value of the "deactivated_at" field.

func (*TestUpdate) ClearDealsConfig

func (tu *TestUpdate) ClearDealsConfig() *TestUpdate

ClearDealsConfig clears the value of the "deals_config" field.

func (*TestUpdate) ClearDineInConfigs

func (tu *TestUpdate) ClearDineInConfigs() *TestUpdate

ClearDineInConfigs clears the value of the "dine_in_configs" field.

func (*TestUpdate) ClearEndOfTakeaway

func (tu *TestUpdate) ClearEndOfTakeaway() *TestUpdate

ClearEndOfTakeaway clears the value of the "end_of_takeaway" field.

func (*TestUpdate) ClearPrintConfig

func (tu *TestUpdate) ClearPrintConfig() *TestUpdate

ClearPrintConfig clears the value of the "print_config" field.

func (*TestUpdate) ClearPrintTimes added in v0.1.2

func (tu *TestUpdate) ClearPrintTimes() *TestUpdate

ClearPrintTimes clears the value of the "print_times" field.

func (*TestUpdate) Exec

func (tu *TestUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestUpdate) ExecX

func (tu *TestUpdate) ExecX(ctx context.Context)

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

func (*TestUpdate) Mutation

func (tu *TestUpdate) Mutation() *TestMutation

Mutation returns the TestMutation object of the builder.

func (*TestUpdate) Save

func (tu *TestUpdate) Save(ctx context.Context) (int, error)

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

func (*TestUpdate) SaveX

func (tu *TestUpdate) SaveX(ctx context.Context) int

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

func (*TestUpdate) SetAddress

func (tu *TestUpdate) SetAddress(s string) *TestUpdate

SetAddress sets the "address" field.

func (*TestUpdate) SetAnnouncement

func (tu *TestUpdate) SetAnnouncement(s string) *TestUpdate

SetAnnouncement sets the "announcement" field.

func (*TestUpdate) SetBanners

func (tu *TestUpdate) SetBanners(s schema.Banners) *TestUpdate

SetBanners sets the "banners" field.

func (*TestUpdate) SetBusinessGroupID

func (tu *TestUpdate) SetBusinessGroupID(i int) *TestUpdate

SetBusinessGroupID sets the "business_group_id" field.

func (*TestUpdate) SetBusinessGroupUID

func (tu *TestUpdate) SetBusinessGroupUID(s string) *TestUpdate

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestUpdate) SetDeactivatedAt

func (tu *TestUpdate) SetDeactivatedAt(t time.Time) *TestUpdate

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestUpdate) SetDealsConfig

func (tu *TestUpdate) SetDealsConfig(sc schema.DealsConfig) *TestUpdate

SetDealsConfig sets the "deals_config" field.

func (*TestUpdate) SetDeliveryConfigs

func (tu *TestUpdate) SetDeliveryConfigs(sc schema.DeliveryConfig) *TestUpdate

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestUpdate) SetDineInConfigs

func (tu *TestUpdate) SetDineInConfigs(sic schema.DineInConfigs) *TestUpdate

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestUpdate) SetDishCategories

func (tu *TestUpdate) SetDishCategories(s []string) *TestUpdate

SetDishCategories sets the "dish_categories" field.

func (*TestUpdate) SetEnableAutoAccept

func (tu *TestUpdate) SetEnableAutoAccept(b bool) *TestUpdate

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestUpdate) SetEnableTakeaway

func (tu *TestUpdate) SetEnableTakeaway(b bool) *TestUpdate

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestUpdate) SetEndOfTakeaway

func (tu *TestUpdate) SetEndOfTakeaway(t time.Time) *TestUpdate

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestUpdate) SetImage

func (tu *TestUpdate) SetImage(s string) *TestUpdate

SetImage sets the "image" field.

func (*TestUpdate) SetLatitude

func (tu *TestUpdate) SetLatitude(s string) *TestUpdate

SetLatitude sets the "latitude" field.

func (*TestUpdate) SetLongitude

func (tu *TestUpdate) SetLongitude(s string) *TestUpdate

SetLongitude sets the "longitude" field.

func (*TestUpdate) SetMode

func (tu *TestUpdate) SetMode(i int) *TestUpdate

SetMode sets the "mode" field.

func (*TestUpdate) SetName

func (tu *TestUpdate) SetName(s string) *TestUpdate

SetName sets the "name" field.

func (*TestUpdate) SetNillableDeactivatedAt

func (tu *TestUpdate) SetNillableDeactivatedAt(t *time.Time) *TestUpdate

SetNillableDeactivatedAt sets the "deactivated_at" field if the given value is not nil.

func (*TestUpdate) SetNillableDealsConfig

func (tu *TestUpdate) SetNillableDealsConfig(sc *schema.DealsConfig) *TestUpdate

SetNillableDealsConfig sets the "deals_config" field if the given value is not nil.

func (*TestUpdate) SetNillableDineInConfigs

func (tu *TestUpdate) SetNillableDineInConfigs(sic *schema.DineInConfigs) *TestUpdate

SetNillableDineInConfigs sets the "dine_in_configs" field if the given value is not nil.

func (*TestUpdate) SetNillableEnableAutoAccept

func (tu *TestUpdate) SetNillableEnableAutoAccept(b *bool) *TestUpdate

SetNillableEnableAutoAccept sets the "enable_auto_accept" field if the given value is not nil.

func (*TestUpdate) SetNillableEnableTakeaway

func (tu *TestUpdate) SetNillableEnableTakeaway(b *bool) *TestUpdate

SetNillableEnableTakeaway sets the "enable_takeaway" field if the given value is not nil.

func (*TestUpdate) SetNillableEndOfTakeaway

func (tu *TestUpdate) SetNillableEndOfTakeaway(t *time.Time) *TestUpdate

SetNillableEndOfTakeaway sets the "end_of_takeaway" field if the given value is not nil.

func (*TestUpdate) SetNillableMode

func (tu *TestUpdate) SetNillableMode(i *int) *TestUpdate

SetNillableMode sets the "mode" field if the given value is not nil.

func (*TestUpdate) SetNillablePayMode

func (tu *TestUpdate) SetNillablePayMode(s *string) *TestUpdate

SetNillablePayMode sets the "pay_mode" field if the given value is not nil.

func (*TestUpdate) SetNillablePrintConfig

func (tu *TestUpdate) SetNillablePrintConfig(sc *schema.PrintConfig) *TestUpdate

SetNillablePrintConfig sets the "print_config" field if the given value is not nil.

func (*TestUpdate) SetNillablePrintTimes added in v0.1.2

func (tu *TestUpdate) SetNillablePrintTimes(i *int) *TestUpdate

SetNillablePrintTimes sets the "print_times" field if the given value is not nil.

func (*TestUpdate) SetNillableSort

func (tu *TestUpdate) SetNillableSort(i *int) *TestUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*TestUpdate) SetPayConfigs

func (tu *TestUpdate) SetPayConfigs(sc schema.PayConfig) *TestUpdate

SetPayConfigs sets the "pay_configs" field.

func (*TestUpdate) SetPayMode

func (tu *TestUpdate) SetPayMode(s string) *TestUpdate

SetPayMode sets the "pay_mode" field.

func (*TestUpdate) SetPhone

func (tu *TestUpdate) SetPhone(s string) *TestUpdate

SetPhone sets the "phone" field.

func (*TestUpdate) SetPrintConfig

func (tu *TestUpdate) SetPrintConfig(sc schema.PrintConfig) *TestUpdate

SetPrintConfig sets the "print_config" field.

func (*TestUpdate) SetPrintTimes

func (tu *TestUpdate) SetPrintTimes(i int) *TestUpdate

SetPrintTimes sets the "print_times" field.

func (*TestUpdate) SetRingConfigs

func (tu *TestUpdate) SetRingConfigs(sc schema.RingConfig) *TestUpdate

SetRingConfigs sets the "ring_configs" field.

func (*TestUpdate) SetSelfPickupConfigs

func (tu *TestUpdate) SetSelfPickupConfigs(spc schema.SelfPickupConfig) *TestUpdate

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestUpdate) SetServerID

func (tu *TestUpdate) SetServerID(i int) *TestUpdate

SetServerID sets the "server_id" field.

func (*TestUpdate) SetSort

func (tu *TestUpdate) SetSort(i int) *TestUpdate

SetSort sets the "sort" field.

func (*TestUpdate) SetUpdatedAt

func (tu *TestUpdate) SetUpdatedAt(t time.Time) *TestUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TestUpdate) Where

func (tu *TestUpdate) Where(ps ...predicate.Test) *TestUpdate

Where appends a list predicates to the TestUpdate builder.

type TestUpdateOne

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

TestUpdateOne is the builder for updating a single Test entity.

func (*TestUpdateOne) AddBusinessGroupID

func (tuo *TestUpdateOne) AddBusinessGroupID(i int) *TestUpdateOne

AddBusinessGroupID adds i to the "business_group_id" field.

func (*TestUpdateOne) AddMode

func (tuo *TestUpdateOne) AddMode(i int) *TestUpdateOne

AddMode adds i to the "mode" field.

func (*TestUpdateOne) AddPrintTimes

func (tuo *TestUpdateOne) AddPrintTimes(i int) *TestUpdateOne

AddPrintTimes adds i to the "print_times" field.

func (*TestUpdateOne) AddServerID

func (tuo *TestUpdateOne) AddServerID(i int) *TestUpdateOne

AddServerID adds i to the "server_id" field.

func (*TestUpdateOne) AddSort

func (tuo *TestUpdateOne) AddSort(i int) *TestUpdateOne

AddSort adds i to the "sort" field.

func (*TestUpdateOne) AppendDishCategories

func (tuo *TestUpdateOne) AppendDishCategories(s []string) *TestUpdateOne

AppendDishCategories appends s to the "dish_categories" field.

func (*TestUpdateOne) ClearDeactivatedAt

func (tuo *TestUpdateOne) ClearDeactivatedAt() *TestUpdateOne

ClearDeactivatedAt clears the value of the "deactivated_at" field.

func (*TestUpdateOne) ClearDealsConfig

func (tuo *TestUpdateOne) ClearDealsConfig() *TestUpdateOne

ClearDealsConfig clears the value of the "deals_config" field.

func (*TestUpdateOne) ClearDineInConfigs

func (tuo *TestUpdateOne) ClearDineInConfigs() *TestUpdateOne

ClearDineInConfigs clears the value of the "dine_in_configs" field.

func (*TestUpdateOne) ClearEndOfTakeaway

func (tuo *TestUpdateOne) ClearEndOfTakeaway() *TestUpdateOne

ClearEndOfTakeaway clears the value of the "end_of_takeaway" field.

func (*TestUpdateOne) ClearPrintConfig

func (tuo *TestUpdateOne) ClearPrintConfig() *TestUpdateOne

ClearPrintConfig clears the value of the "print_config" field.

func (*TestUpdateOne) ClearPrintTimes added in v0.1.2

func (tuo *TestUpdateOne) ClearPrintTimes() *TestUpdateOne

ClearPrintTimes clears the value of the "print_times" field.

func (*TestUpdateOne) Exec

func (tuo *TestUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TestUpdateOne) ExecX

func (tuo *TestUpdateOne) ExecX(ctx context.Context)

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

func (*TestUpdateOne) Mutation

func (tuo *TestUpdateOne) Mutation() *TestMutation

Mutation returns the TestMutation object of the builder.

func (*TestUpdateOne) Save

func (tuo *TestUpdateOne) Save(ctx context.Context) (*Test, error)

Save executes the query and returns the updated Test entity.

func (*TestUpdateOne) SaveX

func (tuo *TestUpdateOne) SaveX(ctx context.Context) *Test

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

func (*TestUpdateOne) Select

func (tuo *TestUpdateOne) Select(field string, fields ...string) *TestUpdateOne

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

func (*TestUpdateOne) SetAddress

func (tuo *TestUpdateOne) SetAddress(s string) *TestUpdateOne

SetAddress sets the "address" field.

func (*TestUpdateOne) SetAnnouncement

func (tuo *TestUpdateOne) SetAnnouncement(s string) *TestUpdateOne

SetAnnouncement sets the "announcement" field.

func (*TestUpdateOne) SetBanners

func (tuo *TestUpdateOne) SetBanners(s schema.Banners) *TestUpdateOne

SetBanners sets the "banners" field.

func (*TestUpdateOne) SetBusinessGroupID

func (tuo *TestUpdateOne) SetBusinessGroupID(i int) *TestUpdateOne

SetBusinessGroupID sets the "business_group_id" field.

func (*TestUpdateOne) SetBusinessGroupUID

func (tuo *TestUpdateOne) SetBusinessGroupUID(s string) *TestUpdateOne

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestUpdateOne) SetDeactivatedAt

func (tuo *TestUpdateOne) SetDeactivatedAt(t time.Time) *TestUpdateOne

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestUpdateOne) SetDealsConfig

func (tuo *TestUpdateOne) SetDealsConfig(sc schema.DealsConfig) *TestUpdateOne

SetDealsConfig sets the "deals_config" field.

func (*TestUpdateOne) SetDeliveryConfigs

func (tuo *TestUpdateOne) SetDeliveryConfigs(sc schema.DeliveryConfig) *TestUpdateOne

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestUpdateOne) SetDineInConfigs

func (tuo *TestUpdateOne) SetDineInConfigs(sic schema.DineInConfigs) *TestUpdateOne

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestUpdateOne) SetDishCategories

func (tuo *TestUpdateOne) SetDishCategories(s []string) *TestUpdateOne

SetDishCategories sets the "dish_categories" field.

func (*TestUpdateOne) SetEnableAutoAccept

func (tuo *TestUpdateOne) SetEnableAutoAccept(b bool) *TestUpdateOne

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestUpdateOne) SetEnableTakeaway

func (tuo *TestUpdateOne) SetEnableTakeaway(b bool) *TestUpdateOne

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestUpdateOne) SetEndOfTakeaway

func (tuo *TestUpdateOne) SetEndOfTakeaway(t time.Time) *TestUpdateOne

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestUpdateOne) SetImage

func (tuo *TestUpdateOne) SetImage(s string) *TestUpdateOne

SetImage sets the "image" field.

func (*TestUpdateOne) SetLatitude

func (tuo *TestUpdateOne) SetLatitude(s string) *TestUpdateOne

SetLatitude sets the "latitude" field.

func (*TestUpdateOne) SetLongitude

func (tuo *TestUpdateOne) SetLongitude(s string) *TestUpdateOne

SetLongitude sets the "longitude" field.

func (*TestUpdateOne) SetMode

func (tuo *TestUpdateOne) SetMode(i int) *TestUpdateOne

SetMode sets the "mode" field.

func (*TestUpdateOne) SetName

func (tuo *TestUpdateOne) SetName(s string) *TestUpdateOne

SetName sets the "name" field.

func (*TestUpdateOne) SetNillableDeactivatedAt

func (tuo *TestUpdateOne) SetNillableDeactivatedAt(t *time.Time) *TestUpdateOne

SetNillableDeactivatedAt sets the "deactivated_at" field if the given value is not nil.

func (*TestUpdateOne) SetNillableDealsConfig

func (tuo *TestUpdateOne) SetNillableDealsConfig(sc *schema.DealsConfig) *TestUpdateOne

SetNillableDealsConfig sets the "deals_config" field if the given value is not nil.

func (*TestUpdateOne) SetNillableDineInConfigs

func (tuo *TestUpdateOne) SetNillableDineInConfigs(sic *schema.DineInConfigs) *TestUpdateOne

SetNillableDineInConfigs sets the "dine_in_configs" field if the given value is not nil.

func (*TestUpdateOne) SetNillableEnableAutoAccept

func (tuo *TestUpdateOne) SetNillableEnableAutoAccept(b *bool) *TestUpdateOne

SetNillableEnableAutoAccept sets the "enable_auto_accept" field if the given value is not nil.

func (*TestUpdateOne) SetNillableEnableTakeaway

func (tuo *TestUpdateOne) SetNillableEnableTakeaway(b *bool) *TestUpdateOne

SetNillableEnableTakeaway sets the "enable_takeaway" field if the given value is not nil.

func (*TestUpdateOne) SetNillableEndOfTakeaway

func (tuo *TestUpdateOne) SetNillableEndOfTakeaway(t *time.Time) *TestUpdateOne

SetNillableEndOfTakeaway sets the "end_of_takeaway" field if the given value is not nil.

func (*TestUpdateOne) SetNillableMode

func (tuo *TestUpdateOne) SetNillableMode(i *int) *TestUpdateOne

SetNillableMode sets the "mode" field if the given value is not nil.

func (*TestUpdateOne) SetNillablePayMode

func (tuo *TestUpdateOne) SetNillablePayMode(s *string) *TestUpdateOne

SetNillablePayMode sets the "pay_mode" field if the given value is not nil.

func (*TestUpdateOne) SetNillablePrintConfig

func (tuo *TestUpdateOne) SetNillablePrintConfig(sc *schema.PrintConfig) *TestUpdateOne

SetNillablePrintConfig sets the "print_config" field if the given value is not nil.

func (*TestUpdateOne) SetNillablePrintTimes added in v0.1.2

func (tuo *TestUpdateOne) SetNillablePrintTimes(i *int) *TestUpdateOne

SetNillablePrintTimes sets the "print_times" field if the given value is not nil.

func (*TestUpdateOne) SetNillableSort

func (tuo *TestUpdateOne) SetNillableSort(i *int) *TestUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*TestUpdateOne) SetPayConfigs

func (tuo *TestUpdateOne) SetPayConfigs(sc schema.PayConfig) *TestUpdateOne

SetPayConfigs sets the "pay_configs" field.

func (*TestUpdateOne) SetPayMode

func (tuo *TestUpdateOne) SetPayMode(s string) *TestUpdateOne

SetPayMode sets the "pay_mode" field.

func (*TestUpdateOne) SetPhone

func (tuo *TestUpdateOne) SetPhone(s string) *TestUpdateOne

SetPhone sets the "phone" field.

func (*TestUpdateOne) SetPrintConfig

func (tuo *TestUpdateOne) SetPrintConfig(sc schema.PrintConfig) *TestUpdateOne

SetPrintConfig sets the "print_config" field.

func (*TestUpdateOne) SetPrintTimes

func (tuo *TestUpdateOne) SetPrintTimes(i int) *TestUpdateOne

SetPrintTimes sets the "print_times" field.

func (*TestUpdateOne) SetRingConfigs

func (tuo *TestUpdateOne) SetRingConfigs(sc schema.RingConfig) *TestUpdateOne

SetRingConfigs sets the "ring_configs" field.

func (*TestUpdateOne) SetSelfPickupConfigs

func (tuo *TestUpdateOne) SetSelfPickupConfigs(spc schema.SelfPickupConfig) *TestUpdateOne

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestUpdateOne) SetServerID

func (tuo *TestUpdateOne) SetServerID(i int) *TestUpdateOne

SetServerID sets the "server_id" field.

func (*TestUpdateOne) SetSort

func (tuo *TestUpdateOne) SetSort(i int) *TestUpdateOne

SetSort sets the "sort" field.

func (*TestUpdateOne) SetUpdatedAt

func (tuo *TestUpdateOne) SetUpdatedAt(t time.Time) *TestUpdateOne

SetUpdatedAt sets the "updated_at" field.

type TestUpsert

type TestUpsert struct {
	*sql.UpdateSet
}

TestUpsert is the "OnConflict" setter.

func (*TestUpsert) AddBusinessGroupID

func (u *TestUpsert) AddBusinessGroupID(v int) *TestUpsert

AddBusinessGroupID adds v to the "business_group_id" field.

func (*TestUpsert) AddMode

func (u *TestUpsert) AddMode(v int) *TestUpsert

AddMode adds v to the "mode" field.

func (*TestUpsert) AddPrintTimes

func (u *TestUpsert) AddPrintTimes(v int) *TestUpsert

AddPrintTimes adds v to the "print_times" field.

func (*TestUpsert) AddServerID

func (u *TestUpsert) AddServerID(v int) *TestUpsert

AddServerID adds v to the "server_id" field.

func (*TestUpsert) AddSort

func (u *TestUpsert) AddSort(v int) *TestUpsert

AddSort adds v to the "sort" field.

func (*TestUpsert) ClearDeactivatedAt

func (u *TestUpsert) ClearDeactivatedAt() *TestUpsert

ClearDeactivatedAt clears the value of the "deactivated_at" field.

func (*TestUpsert) ClearDealsConfig

func (u *TestUpsert) ClearDealsConfig() *TestUpsert

ClearDealsConfig clears the value of the "deals_config" field.

func (*TestUpsert) ClearDineInConfigs

func (u *TestUpsert) ClearDineInConfigs() *TestUpsert

ClearDineInConfigs clears the value of the "dine_in_configs" field.

func (*TestUpsert) ClearEndOfTakeaway

func (u *TestUpsert) ClearEndOfTakeaway() *TestUpsert

ClearEndOfTakeaway clears the value of the "end_of_takeaway" field.

func (*TestUpsert) ClearPrintConfig

func (u *TestUpsert) ClearPrintConfig() *TestUpsert

ClearPrintConfig clears the value of the "print_config" field.

func (*TestUpsert) ClearPrintTimes added in v0.1.2

func (u *TestUpsert) ClearPrintTimes() *TestUpsert

ClearPrintTimes clears the value of the "print_times" field.

func (*TestUpsert) SetAddress

func (u *TestUpsert) SetAddress(v string) *TestUpsert

SetAddress sets the "address" field.

func (*TestUpsert) SetAnnouncement

func (u *TestUpsert) SetAnnouncement(v string) *TestUpsert

SetAnnouncement sets the "announcement" field.

func (*TestUpsert) SetBanners

func (u *TestUpsert) SetBanners(v schema.Banners) *TestUpsert

SetBanners sets the "banners" field.

func (*TestUpsert) SetBusinessGroupID

func (u *TestUpsert) SetBusinessGroupID(v int) *TestUpsert

SetBusinessGroupID sets the "business_group_id" field.

func (*TestUpsert) SetBusinessGroupUID

func (u *TestUpsert) SetBusinessGroupUID(v string) *TestUpsert

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestUpsert) SetDeactivatedAt

func (u *TestUpsert) SetDeactivatedAt(v time.Time) *TestUpsert

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestUpsert) SetDealsConfig

func (u *TestUpsert) SetDealsConfig(v schema.DealsConfig) *TestUpsert

SetDealsConfig sets the "deals_config" field.

func (*TestUpsert) SetDeliveryConfigs

func (u *TestUpsert) SetDeliveryConfigs(v schema.DeliveryConfig) *TestUpsert

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestUpsert) SetDineInConfigs

func (u *TestUpsert) SetDineInConfigs(v schema.DineInConfigs) *TestUpsert

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestUpsert) SetDishCategories

func (u *TestUpsert) SetDishCategories(v []string) *TestUpsert

SetDishCategories sets the "dish_categories" field.

func (*TestUpsert) SetEnableAutoAccept

func (u *TestUpsert) SetEnableAutoAccept(v bool) *TestUpsert

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestUpsert) SetEnableTakeaway

func (u *TestUpsert) SetEnableTakeaway(v bool) *TestUpsert

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestUpsert) SetEndOfTakeaway

func (u *TestUpsert) SetEndOfTakeaway(v time.Time) *TestUpsert

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestUpsert) SetImage

func (u *TestUpsert) SetImage(v string) *TestUpsert

SetImage sets the "image" field.

func (*TestUpsert) SetLatitude

func (u *TestUpsert) SetLatitude(v string) *TestUpsert

SetLatitude sets the "latitude" field.

func (*TestUpsert) SetLongitude

func (u *TestUpsert) SetLongitude(v string) *TestUpsert

SetLongitude sets the "longitude" field.

func (*TestUpsert) SetMode

func (u *TestUpsert) SetMode(v int) *TestUpsert

SetMode sets the "mode" field.

func (*TestUpsert) SetName

func (u *TestUpsert) SetName(v string) *TestUpsert

SetName sets the "name" field.

func (*TestUpsert) SetPayConfigs

func (u *TestUpsert) SetPayConfigs(v schema.PayConfig) *TestUpsert

SetPayConfigs sets the "pay_configs" field.

func (*TestUpsert) SetPayMode

func (u *TestUpsert) SetPayMode(v string) *TestUpsert

SetPayMode sets the "pay_mode" field.

func (*TestUpsert) SetPhone

func (u *TestUpsert) SetPhone(v string) *TestUpsert

SetPhone sets the "phone" field.

func (*TestUpsert) SetPrintConfig

func (u *TestUpsert) SetPrintConfig(v schema.PrintConfig) *TestUpsert

SetPrintConfig sets the "print_config" field.

func (*TestUpsert) SetPrintTimes

func (u *TestUpsert) SetPrintTimes(v int) *TestUpsert

SetPrintTimes sets the "print_times" field.

func (*TestUpsert) SetRingConfigs

func (u *TestUpsert) SetRingConfigs(v schema.RingConfig) *TestUpsert

SetRingConfigs sets the "ring_configs" field.

func (*TestUpsert) SetSelfPickupConfigs

func (u *TestUpsert) SetSelfPickupConfigs(v schema.SelfPickupConfig) *TestUpsert

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestUpsert) SetServerID

func (u *TestUpsert) SetServerID(v int) *TestUpsert

SetServerID sets the "server_id" field.

func (*TestUpsert) SetSort

func (u *TestUpsert) SetSort(v int) *TestUpsert

SetSort sets the "sort" field.

func (*TestUpsert) SetUpdatedAt

func (u *TestUpsert) SetUpdatedAt(v time.Time) *TestUpsert

SetUpdatedAt sets the "updated_at" field.

func (*TestUpsert) UpdateAddress

func (u *TestUpsert) UpdateAddress() *TestUpsert

UpdateAddress sets the "address" field to the value that was provided on create.

func (*TestUpsert) UpdateAnnouncement

func (u *TestUpsert) UpdateAnnouncement() *TestUpsert

UpdateAnnouncement sets the "announcement" field to the value that was provided on create.

func (*TestUpsert) UpdateBanners

func (u *TestUpsert) UpdateBanners() *TestUpsert

UpdateBanners sets the "banners" field to the value that was provided on create.

func (*TestUpsert) UpdateBusinessGroupID

func (u *TestUpsert) UpdateBusinessGroupID() *TestUpsert

UpdateBusinessGroupID sets the "business_group_id" field to the value that was provided on create.

func (*TestUpsert) UpdateBusinessGroupUID

func (u *TestUpsert) UpdateBusinessGroupUID() *TestUpsert

UpdateBusinessGroupUID sets the "business_group_uid" field to the value that was provided on create.

func (*TestUpsert) UpdateDeactivatedAt

func (u *TestUpsert) UpdateDeactivatedAt() *TestUpsert

UpdateDeactivatedAt sets the "deactivated_at" field to the value that was provided on create.

func (*TestUpsert) UpdateDealsConfig

func (u *TestUpsert) UpdateDealsConfig() *TestUpsert

UpdateDealsConfig sets the "deals_config" field to the value that was provided on create.

func (*TestUpsert) UpdateDeliveryConfigs

func (u *TestUpsert) UpdateDeliveryConfigs() *TestUpsert

UpdateDeliveryConfigs sets the "delivery_configs" field to the value that was provided on create.

func (*TestUpsert) UpdateDineInConfigs

func (u *TestUpsert) UpdateDineInConfigs() *TestUpsert

UpdateDineInConfigs sets the "dine_in_configs" field to the value that was provided on create.

func (*TestUpsert) UpdateDishCategories

func (u *TestUpsert) UpdateDishCategories() *TestUpsert

UpdateDishCategories sets the "dish_categories" field to the value that was provided on create.

func (*TestUpsert) UpdateEnableAutoAccept

func (u *TestUpsert) UpdateEnableAutoAccept() *TestUpsert

UpdateEnableAutoAccept sets the "enable_auto_accept" field to the value that was provided on create.

func (*TestUpsert) UpdateEnableTakeaway

func (u *TestUpsert) UpdateEnableTakeaway() *TestUpsert

UpdateEnableTakeaway sets the "enable_takeaway" field to the value that was provided on create.

func (*TestUpsert) UpdateEndOfTakeaway

func (u *TestUpsert) UpdateEndOfTakeaway() *TestUpsert

UpdateEndOfTakeaway sets the "end_of_takeaway" field to the value that was provided on create.

func (*TestUpsert) UpdateImage

func (u *TestUpsert) UpdateImage() *TestUpsert

UpdateImage sets the "image" field to the value that was provided on create.

func (*TestUpsert) UpdateLatitude

func (u *TestUpsert) UpdateLatitude() *TestUpsert

UpdateLatitude sets the "latitude" field to the value that was provided on create.

func (*TestUpsert) UpdateLongitude

func (u *TestUpsert) UpdateLongitude() *TestUpsert

UpdateLongitude sets the "longitude" field to the value that was provided on create.

func (*TestUpsert) UpdateMode

func (u *TestUpsert) UpdateMode() *TestUpsert

UpdateMode sets the "mode" field to the value that was provided on create.

func (*TestUpsert) UpdateName

func (u *TestUpsert) UpdateName() *TestUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*TestUpsert) UpdatePayConfigs

func (u *TestUpsert) UpdatePayConfigs() *TestUpsert

UpdatePayConfigs sets the "pay_configs" field to the value that was provided on create.

func (*TestUpsert) UpdatePayMode

func (u *TestUpsert) UpdatePayMode() *TestUpsert

UpdatePayMode sets the "pay_mode" field to the value that was provided on create.

func (*TestUpsert) UpdatePhone

func (u *TestUpsert) UpdatePhone() *TestUpsert

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*TestUpsert) UpdatePrintConfig

func (u *TestUpsert) UpdatePrintConfig() *TestUpsert

UpdatePrintConfig sets the "print_config" field to the value that was provided on create.

func (*TestUpsert) UpdatePrintTimes

func (u *TestUpsert) UpdatePrintTimes() *TestUpsert

UpdatePrintTimes sets the "print_times" field to the value that was provided on create.

func (*TestUpsert) UpdateRingConfigs

func (u *TestUpsert) UpdateRingConfigs() *TestUpsert

UpdateRingConfigs sets the "ring_configs" field to the value that was provided on create.

func (*TestUpsert) UpdateSelfPickupConfigs

func (u *TestUpsert) UpdateSelfPickupConfigs() *TestUpsert

UpdateSelfPickupConfigs sets the "self_pickup_configs" field to the value that was provided on create.

func (*TestUpsert) UpdateServerID

func (u *TestUpsert) UpdateServerID() *TestUpsert

UpdateServerID sets the "server_id" field to the value that was provided on create.

func (*TestUpsert) UpdateSort

func (u *TestUpsert) UpdateSort() *TestUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*TestUpsert) UpdateUpdatedAt

func (u *TestUpsert) UpdateUpdatedAt() *TestUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TestUpsertBulk

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

TestUpsertBulk is the builder for "upsert"-ing a bulk of Test nodes.

func (*TestUpsertBulk) AddBusinessGroupID

func (u *TestUpsertBulk) AddBusinessGroupID(v int) *TestUpsertBulk

AddBusinessGroupID adds v to the "business_group_id" field.

func (*TestUpsertBulk) AddMode

func (u *TestUpsertBulk) AddMode(v int) *TestUpsertBulk

AddMode adds v to the "mode" field.

func (*TestUpsertBulk) AddPrintTimes

func (u *TestUpsertBulk) AddPrintTimes(v int) *TestUpsertBulk

AddPrintTimes adds v to the "print_times" field.

func (*TestUpsertBulk) AddServerID

func (u *TestUpsertBulk) AddServerID(v int) *TestUpsertBulk

AddServerID adds v to the "server_id" field.

func (*TestUpsertBulk) AddSort

func (u *TestUpsertBulk) AddSort(v int) *TestUpsertBulk

AddSort adds v to the "sort" field.

func (*TestUpsertBulk) ClearDeactivatedAt

func (u *TestUpsertBulk) ClearDeactivatedAt() *TestUpsertBulk

ClearDeactivatedAt clears the value of the "deactivated_at" field.

func (*TestUpsertBulk) ClearDealsConfig

func (u *TestUpsertBulk) ClearDealsConfig() *TestUpsertBulk

ClearDealsConfig clears the value of the "deals_config" field.

func (*TestUpsertBulk) ClearDineInConfigs

func (u *TestUpsertBulk) ClearDineInConfigs() *TestUpsertBulk

ClearDineInConfigs clears the value of the "dine_in_configs" field.

func (*TestUpsertBulk) ClearEndOfTakeaway

func (u *TestUpsertBulk) ClearEndOfTakeaway() *TestUpsertBulk

ClearEndOfTakeaway clears the value of the "end_of_takeaway" field.

func (*TestUpsertBulk) ClearPrintConfig

func (u *TestUpsertBulk) ClearPrintConfig() *TestUpsertBulk

ClearPrintConfig clears the value of the "print_config" field.

func (*TestUpsertBulk) ClearPrintTimes added in v0.1.2

func (u *TestUpsertBulk) ClearPrintTimes() *TestUpsertBulk

ClearPrintTimes clears the value of the "print_times" field.

func (*TestUpsertBulk) DoNothing

func (u *TestUpsertBulk) DoNothing() *TestUpsertBulk

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

func (*TestUpsertBulk) Exec

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

Exec executes the query.

func (*TestUpsertBulk) ExecX

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

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

func (*TestUpsertBulk) Ignore

func (u *TestUpsertBulk) Ignore() *TestUpsertBulk

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

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

func (*TestUpsertBulk) SetAddress

func (u *TestUpsertBulk) SetAddress(v string) *TestUpsertBulk

SetAddress sets the "address" field.

func (*TestUpsertBulk) SetAnnouncement

func (u *TestUpsertBulk) SetAnnouncement(v string) *TestUpsertBulk

SetAnnouncement sets the "announcement" field.

func (*TestUpsertBulk) SetBanners

func (u *TestUpsertBulk) SetBanners(v schema.Banners) *TestUpsertBulk

SetBanners sets the "banners" field.

func (*TestUpsertBulk) SetBusinessGroupID

func (u *TestUpsertBulk) SetBusinessGroupID(v int) *TestUpsertBulk

SetBusinessGroupID sets the "business_group_id" field.

func (*TestUpsertBulk) SetBusinessGroupUID

func (u *TestUpsertBulk) SetBusinessGroupUID(v string) *TestUpsertBulk

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestUpsertBulk) SetDeactivatedAt

func (u *TestUpsertBulk) SetDeactivatedAt(v time.Time) *TestUpsertBulk

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestUpsertBulk) SetDealsConfig

func (u *TestUpsertBulk) SetDealsConfig(v schema.DealsConfig) *TestUpsertBulk

SetDealsConfig sets the "deals_config" field.

func (*TestUpsertBulk) SetDeliveryConfigs

func (u *TestUpsertBulk) SetDeliveryConfigs(v schema.DeliveryConfig) *TestUpsertBulk

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestUpsertBulk) SetDineInConfigs

func (u *TestUpsertBulk) SetDineInConfigs(v schema.DineInConfigs) *TestUpsertBulk

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestUpsertBulk) SetDishCategories

func (u *TestUpsertBulk) SetDishCategories(v []string) *TestUpsertBulk

SetDishCategories sets the "dish_categories" field.

func (*TestUpsertBulk) SetEnableAutoAccept

func (u *TestUpsertBulk) SetEnableAutoAccept(v bool) *TestUpsertBulk

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestUpsertBulk) SetEnableTakeaway

func (u *TestUpsertBulk) SetEnableTakeaway(v bool) *TestUpsertBulk

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestUpsertBulk) SetEndOfTakeaway

func (u *TestUpsertBulk) SetEndOfTakeaway(v time.Time) *TestUpsertBulk

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestUpsertBulk) SetImage

func (u *TestUpsertBulk) SetImage(v string) *TestUpsertBulk

SetImage sets the "image" field.

func (*TestUpsertBulk) SetLatitude

func (u *TestUpsertBulk) SetLatitude(v string) *TestUpsertBulk

SetLatitude sets the "latitude" field.

func (*TestUpsertBulk) SetLongitude

func (u *TestUpsertBulk) SetLongitude(v string) *TestUpsertBulk

SetLongitude sets the "longitude" field.

func (*TestUpsertBulk) SetMode

func (u *TestUpsertBulk) SetMode(v int) *TestUpsertBulk

SetMode sets the "mode" field.

func (*TestUpsertBulk) SetName

func (u *TestUpsertBulk) SetName(v string) *TestUpsertBulk

SetName sets the "name" field.

func (*TestUpsertBulk) SetPayConfigs

func (u *TestUpsertBulk) SetPayConfigs(v schema.PayConfig) *TestUpsertBulk

SetPayConfigs sets the "pay_configs" field.

func (*TestUpsertBulk) SetPayMode

func (u *TestUpsertBulk) SetPayMode(v string) *TestUpsertBulk

SetPayMode sets the "pay_mode" field.

func (*TestUpsertBulk) SetPhone

func (u *TestUpsertBulk) SetPhone(v string) *TestUpsertBulk

SetPhone sets the "phone" field.

func (*TestUpsertBulk) SetPrintConfig

func (u *TestUpsertBulk) SetPrintConfig(v schema.PrintConfig) *TestUpsertBulk

SetPrintConfig sets the "print_config" field.

func (*TestUpsertBulk) SetPrintTimes

func (u *TestUpsertBulk) SetPrintTimes(v int) *TestUpsertBulk

SetPrintTimes sets the "print_times" field.

func (*TestUpsertBulk) SetRingConfigs

func (u *TestUpsertBulk) SetRingConfigs(v schema.RingConfig) *TestUpsertBulk

SetRingConfigs sets the "ring_configs" field.

func (*TestUpsertBulk) SetSelfPickupConfigs

func (u *TestUpsertBulk) SetSelfPickupConfigs(v schema.SelfPickupConfig) *TestUpsertBulk

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestUpsertBulk) SetServerID

func (u *TestUpsertBulk) SetServerID(v int) *TestUpsertBulk

SetServerID sets the "server_id" field.

func (*TestUpsertBulk) SetSort

func (u *TestUpsertBulk) SetSort(v int) *TestUpsertBulk

SetSort sets the "sort" field.

func (*TestUpsertBulk) SetUpdatedAt

func (u *TestUpsertBulk) SetUpdatedAt(v time.Time) *TestUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*TestUpsertBulk) Update

func (u *TestUpsertBulk) Update(set func(*TestUpsert)) *TestUpsertBulk

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

func (*TestUpsertBulk) UpdateAddress

func (u *TestUpsertBulk) UpdateAddress() *TestUpsertBulk

UpdateAddress sets the "address" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateAnnouncement

func (u *TestUpsertBulk) UpdateAnnouncement() *TestUpsertBulk

UpdateAnnouncement sets the "announcement" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateBanners

func (u *TestUpsertBulk) UpdateBanners() *TestUpsertBulk

UpdateBanners sets the "banners" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateBusinessGroupID

func (u *TestUpsertBulk) UpdateBusinessGroupID() *TestUpsertBulk

UpdateBusinessGroupID sets the "business_group_id" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateBusinessGroupUID

func (u *TestUpsertBulk) UpdateBusinessGroupUID() *TestUpsertBulk

UpdateBusinessGroupUID sets the "business_group_uid" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateDeactivatedAt

func (u *TestUpsertBulk) UpdateDeactivatedAt() *TestUpsertBulk

UpdateDeactivatedAt sets the "deactivated_at" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateDealsConfig

func (u *TestUpsertBulk) UpdateDealsConfig() *TestUpsertBulk

UpdateDealsConfig sets the "deals_config" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateDeliveryConfigs

func (u *TestUpsertBulk) UpdateDeliveryConfigs() *TestUpsertBulk

UpdateDeliveryConfigs sets the "delivery_configs" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateDineInConfigs

func (u *TestUpsertBulk) UpdateDineInConfigs() *TestUpsertBulk

UpdateDineInConfigs sets the "dine_in_configs" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateDishCategories

func (u *TestUpsertBulk) UpdateDishCategories() *TestUpsertBulk

UpdateDishCategories sets the "dish_categories" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateEnableAutoAccept

func (u *TestUpsertBulk) UpdateEnableAutoAccept() *TestUpsertBulk

UpdateEnableAutoAccept sets the "enable_auto_accept" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateEnableTakeaway

func (u *TestUpsertBulk) UpdateEnableTakeaway() *TestUpsertBulk

UpdateEnableTakeaway sets the "enable_takeaway" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateEndOfTakeaway

func (u *TestUpsertBulk) UpdateEndOfTakeaway() *TestUpsertBulk

UpdateEndOfTakeaway sets the "end_of_takeaway" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateImage

func (u *TestUpsertBulk) UpdateImage() *TestUpsertBulk

UpdateImage sets the "image" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateLatitude

func (u *TestUpsertBulk) UpdateLatitude() *TestUpsertBulk

UpdateLatitude sets the "latitude" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateLongitude

func (u *TestUpsertBulk) UpdateLongitude() *TestUpsertBulk

UpdateLongitude sets the "longitude" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateMode

func (u *TestUpsertBulk) UpdateMode() *TestUpsertBulk

UpdateMode sets the "mode" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateName

func (u *TestUpsertBulk) UpdateName() *TestUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateNewValues

func (u *TestUpsertBulk) UpdateNewValues() *TestUpsertBulk

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

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

func (*TestUpsertBulk) UpdatePayConfigs

func (u *TestUpsertBulk) UpdatePayConfigs() *TestUpsertBulk

UpdatePayConfigs sets the "pay_configs" field to the value that was provided on create.

func (*TestUpsertBulk) UpdatePayMode

func (u *TestUpsertBulk) UpdatePayMode() *TestUpsertBulk

UpdatePayMode sets the "pay_mode" field to the value that was provided on create.

func (*TestUpsertBulk) UpdatePhone

func (u *TestUpsertBulk) UpdatePhone() *TestUpsertBulk

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*TestUpsertBulk) UpdatePrintConfig

func (u *TestUpsertBulk) UpdatePrintConfig() *TestUpsertBulk

UpdatePrintConfig sets the "print_config" field to the value that was provided on create.

func (*TestUpsertBulk) UpdatePrintTimes

func (u *TestUpsertBulk) UpdatePrintTimes() *TestUpsertBulk

UpdatePrintTimes sets the "print_times" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateRingConfigs

func (u *TestUpsertBulk) UpdateRingConfigs() *TestUpsertBulk

UpdateRingConfigs sets the "ring_configs" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateSelfPickupConfigs

func (u *TestUpsertBulk) UpdateSelfPickupConfigs() *TestUpsertBulk

UpdateSelfPickupConfigs sets the "self_pickup_configs" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateServerID

func (u *TestUpsertBulk) UpdateServerID() *TestUpsertBulk

UpdateServerID sets the "server_id" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateSort

func (u *TestUpsertBulk) UpdateSort() *TestUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*TestUpsertBulk) UpdateUpdatedAt

func (u *TestUpsertBulk) UpdateUpdatedAt() *TestUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TestUpsertOne

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

TestUpsertOne is the builder for "upsert"-ing

one Test node.

func (*TestUpsertOne) AddBusinessGroupID

func (u *TestUpsertOne) AddBusinessGroupID(v int) *TestUpsertOne

AddBusinessGroupID adds v to the "business_group_id" field.

func (*TestUpsertOne) AddMode

func (u *TestUpsertOne) AddMode(v int) *TestUpsertOne

AddMode adds v to the "mode" field.

func (*TestUpsertOne) AddPrintTimes

func (u *TestUpsertOne) AddPrintTimes(v int) *TestUpsertOne

AddPrintTimes adds v to the "print_times" field.

func (*TestUpsertOne) AddServerID

func (u *TestUpsertOne) AddServerID(v int) *TestUpsertOne

AddServerID adds v to the "server_id" field.

func (*TestUpsertOne) AddSort

func (u *TestUpsertOne) AddSort(v int) *TestUpsertOne

AddSort adds v to the "sort" field.

func (*TestUpsertOne) ClearDeactivatedAt

func (u *TestUpsertOne) ClearDeactivatedAt() *TestUpsertOne

ClearDeactivatedAt clears the value of the "deactivated_at" field.

func (*TestUpsertOne) ClearDealsConfig

func (u *TestUpsertOne) ClearDealsConfig() *TestUpsertOne

ClearDealsConfig clears the value of the "deals_config" field.

func (*TestUpsertOne) ClearDineInConfigs

func (u *TestUpsertOne) ClearDineInConfigs() *TestUpsertOne

ClearDineInConfigs clears the value of the "dine_in_configs" field.

func (*TestUpsertOne) ClearEndOfTakeaway

func (u *TestUpsertOne) ClearEndOfTakeaway() *TestUpsertOne

ClearEndOfTakeaway clears the value of the "end_of_takeaway" field.

func (*TestUpsertOne) ClearPrintConfig

func (u *TestUpsertOne) ClearPrintConfig() *TestUpsertOne

ClearPrintConfig clears the value of the "print_config" field.

func (*TestUpsertOne) ClearPrintTimes added in v0.1.2

func (u *TestUpsertOne) ClearPrintTimes() *TestUpsertOne

ClearPrintTimes clears the value of the "print_times" field.

func (*TestUpsertOne) DoNothing

func (u *TestUpsertOne) DoNothing() *TestUpsertOne

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

func (*TestUpsertOne) Exec

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

Exec executes the query.

func (*TestUpsertOne) ExecX

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

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

func (*TestUpsertOne) ID

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

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

func (*TestUpsertOne) IDX

func (u *TestUpsertOne) IDX(ctx context.Context) int

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

func (*TestUpsertOne) Ignore

func (u *TestUpsertOne) Ignore() *TestUpsertOne

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

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

func (*TestUpsertOne) SetAddress

func (u *TestUpsertOne) SetAddress(v string) *TestUpsertOne

SetAddress sets the "address" field.

func (*TestUpsertOne) SetAnnouncement

func (u *TestUpsertOne) SetAnnouncement(v string) *TestUpsertOne

SetAnnouncement sets the "announcement" field.

func (*TestUpsertOne) SetBanners

func (u *TestUpsertOne) SetBanners(v schema.Banners) *TestUpsertOne

SetBanners sets the "banners" field.

func (*TestUpsertOne) SetBusinessGroupID

func (u *TestUpsertOne) SetBusinessGroupID(v int) *TestUpsertOne

SetBusinessGroupID sets the "business_group_id" field.

func (*TestUpsertOne) SetBusinessGroupUID

func (u *TestUpsertOne) SetBusinessGroupUID(v string) *TestUpsertOne

SetBusinessGroupUID sets the "business_group_uid" field.

func (*TestUpsertOne) SetDeactivatedAt

func (u *TestUpsertOne) SetDeactivatedAt(v time.Time) *TestUpsertOne

SetDeactivatedAt sets the "deactivated_at" field.

func (*TestUpsertOne) SetDealsConfig

func (u *TestUpsertOne) SetDealsConfig(v schema.DealsConfig) *TestUpsertOne

SetDealsConfig sets the "deals_config" field.

func (*TestUpsertOne) SetDeliveryConfigs

func (u *TestUpsertOne) SetDeliveryConfigs(v schema.DeliveryConfig) *TestUpsertOne

SetDeliveryConfigs sets the "delivery_configs" field.

func (*TestUpsertOne) SetDineInConfigs

func (u *TestUpsertOne) SetDineInConfigs(v schema.DineInConfigs) *TestUpsertOne

SetDineInConfigs sets the "dine_in_configs" field.

func (*TestUpsertOne) SetDishCategories

func (u *TestUpsertOne) SetDishCategories(v []string) *TestUpsertOne

SetDishCategories sets the "dish_categories" field.

func (*TestUpsertOne) SetEnableAutoAccept

func (u *TestUpsertOne) SetEnableAutoAccept(v bool) *TestUpsertOne

SetEnableAutoAccept sets the "enable_auto_accept" field.

func (*TestUpsertOne) SetEnableTakeaway

func (u *TestUpsertOne) SetEnableTakeaway(v bool) *TestUpsertOne

SetEnableTakeaway sets the "enable_takeaway" field.

func (*TestUpsertOne) SetEndOfTakeaway

func (u *TestUpsertOne) SetEndOfTakeaway(v time.Time) *TestUpsertOne

SetEndOfTakeaway sets the "end_of_takeaway" field.

func (*TestUpsertOne) SetImage

func (u *TestUpsertOne) SetImage(v string) *TestUpsertOne

SetImage sets the "image" field.

func (*TestUpsertOne) SetLatitude

func (u *TestUpsertOne) SetLatitude(v string) *TestUpsertOne

SetLatitude sets the "latitude" field.

func (*TestUpsertOne) SetLongitude

func (u *TestUpsertOne) SetLongitude(v string) *TestUpsertOne

SetLongitude sets the "longitude" field.

func (*TestUpsertOne) SetMode

func (u *TestUpsertOne) SetMode(v int) *TestUpsertOne

SetMode sets the "mode" field.

func (*TestUpsertOne) SetName

func (u *TestUpsertOne) SetName(v string) *TestUpsertOne

SetName sets the "name" field.

func (*TestUpsertOne) SetPayConfigs

func (u *TestUpsertOne) SetPayConfigs(v schema.PayConfig) *TestUpsertOne

SetPayConfigs sets the "pay_configs" field.

func (*TestUpsertOne) SetPayMode

func (u *TestUpsertOne) SetPayMode(v string) *TestUpsertOne

SetPayMode sets the "pay_mode" field.

func (*TestUpsertOne) SetPhone

func (u *TestUpsertOne) SetPhone(v string) *TestUpsertOne

SetPhone sets the "phone" field.

func (*TestUpsertOne) SetPrintConfig

func (u *TestUpsertOne) SetPrintConfig(v schema.PrintConfig) *TestUpsertOne

SetPrintConfig sets the "print_config" field.

func (*TestUpsertOne) SetPrintTimes

func (u *TestUpsertOne) SetPrintTimes(v int) *TestUpsertOne

SetPrintTimes sets the "print_times" field.

func (*TestUpsertOne) SetRingConfigs

func (u *TestUpsertOne) SetRingConfigs(v schema.RingConfig) *TestUpsertOne

SetRingConfigs sets the "ring_configs" field.

func (*TestUpsertOne) SetSelfPickupConfigs

func (u *TestUpsertOne) SetSelfPickupConfigs(v schema.SelfPickupConfig) *TestUpsertOne

SetSelfPickupConfigs sets the "self_pickup_configs" field.

func (*TestUpsertOne) SetServerID

func (u *TestUpsertOne) SetServerID(v int) *TestUpsertOne

SetServerID sets the "server_id" field.

func (*TestUpsertOne) SetSort

func (u *TestUpsertOne) SetSort(v int) *TestUpsertOne

SetSort sets the "sort" field.

func (*TestUpsertOne) SetUpdatedAt

func (u *TestUpsertOne) SetUpdatedAt(v time.Time) *TestUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*TestUpsertOne) Update

func (u *TestUpsertOne) Update(set func(*TestUpsert)) *TestUpsertOne

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

func (*TestUpsertOne) UpdateAddress

func (u *TestUpsertOne) UpdateAddress() *TestUpsertOne

UpdateAddress sets the "address" field to the value that was provided on create.

func (*TestUpsertOne) UpdateAnnouncement

func (u *TestUpsertOne) UpdateAnnouncement() *TestUpsertOne

UpdateAnnouncement sets the "announcement" field to the value that was provided on create.

func (*TestUpsertOne) UpdateBanners

func (u *TestUpsertOne) UpdateBanners() *TestUpsertOne

UpdateBanners sets the "banners" field to the value that was provided on create.

func (*TestUpsertOne) UpdateBusinessGroupID

func (u *TestUpsertOne) UpdateBusinessGroupID() *TestUpsertOne

UpdateBusinessGroupID sets the "business_group_id" field to the value that was provided on create.

func (*TestUpsertOne) UpdateBusinessGroupUID

func (u *TestUpsertOne) UpdateBusinessGroupUID() *TestUpsertOne

UpdateBusinessGroupUID sets the "business_group_uid" field to the value that was provided on create.

func (*TestUpsertOne) UpdateDeactivatedAt

func (u *TestUpsertOne) UpdateDeactivatedAt() *TestUpsertOne

UpdateDeactivatedAt sets the "deactivated_at" field to the value that was provided on create.

func (*TestUpsertOne) UpdateDealsConfig

func (u *TestUpsertOne) UpdateDealsConfig() *TestUpsertOne

UpdateDealsConfig sets the "deals_config" field to the value that was provided on create.

func (*TestUpsertOne) UpdateDeliveryConfigs

func (u *TestUpsertOne) UpdateDeliveryConfigs() *TestUpsertOne

UpdateDeliveryConfigs sets the "delivery_configs" field to the value that was provided on create.

func (*TestUpsertOne) UpdateDineInConfigs

func (u *TestUpsertOne) UpdateDineInConfigs() *TestUpsertOne

UpdateDineInConfigs sets the "dine_in_configs" field to the value that was provided on create.

func (*TestUpsertOne) UpdateDishCategories

func (u *TestUpsertOne) UpdateDishCategories() *TestUpsertOne

UpdateDishCategories sets the "dish_categories" field to the value that was provided on create.

func (*TestUpsertOne) UpdateEnableAutoAccept

func (u *TestUpsertOne) UpdateEnableAutoAccept() *TestUpsertOne

UpdateEnableAutoAccept sets the "enable_auto_accept" field to the value that was provided on create.

func (*TestUpsertOne) UpdateEnableTakeaway

func (u *TestUpsertOne) UpdateEnableTakeaway() *TestUpsertOne

UpdateEnableTakeaway sets the "enable_takeaway" field to the value that was provided on create.

func (*TestUpsertOne) UpdateEndOfTakeaway

func (u *TestUpsertOne) UpdateEndOfTakeaway() *TestUpsertOne

UpdateEndOfTakeaway sets the "end_of_takeaway" field to the value that was provided on create.

func (*TestUpsertOne) UpdateImage

func (u *TestUpsertOne) UpdateImage() *TestUpsertOne

UpdateImage sets the "image" field to the value that was provided on create.

func (*TestUpsertOne) UpdateLatitude

func (u *TestUpsertOne) UpdateLatitude() *TestUpsertOne

UpdateLatitude sets the "latitude" field to the value that was provided on create.

func (*TestUpsertOne) UpdateLongitude

func (u *TestUpsertOne) UpdateLongitude() *TestUpsertOne

UpdateLongitude sets the "longitude" field to the value that was provided on create.

func (*TestUpsertOne) UpdateMode

func (u *TestUpsertOne) UpdateMode() *TestUpsertOne

UpdateMode sets the "mode" field to the value that was provided on create.

func (*TestUpsertOne) UpdateName

func (u *TestUpsertOne) UpdateName() *TestUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*TestUpsertOne) UpdateNewValues

func (u *TestUpsertOne) UpdateNewValues() *TestUpsertOne

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

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

func (*TestUpsertOne) UpdatePayConfigs

func (u *TestUpsertOne) UpdatePayConfigs() *TestUpsertOne

UpdatePayConfigs sets the "pay_configs" field to the value that was provided on create.

func (*TestUpsertOne) UpdatePayMode

func (u *TestUpsertOne) UpdatePayMode() *TestUpsertOne

UpdatePayMode sets the "pay_mode" field to the value that was provided on create.

func (*TestUpsertOne) UpdatePhone

func (u *TestUpsertOne) UpdatePhone() *TestUpsertOne

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*TestUpsertOne) UpdatePrintConfig

func (u *TestUpsertOne) UpdatePrintConfig() *TestUpsertOne

UpdatePrintConfig sets the "print_config" field to the value that was provided on create.

func (*TestUpsertOne) UpdatePrintTimes

func (u *TestUpsertOne) UpdatePrintTimes() *TestUpsertOne

UpdatePrintTimes sets the "print_times" field to the value that was provided on create.

func (*TestUpsertOne) UpdateRingConfigs

func (u *TestUpsertOne) UpdateRingConfigs() *TestUpsertOne

UpdateRingConfigs sets the "ring_configs" field to the value that was provided on create.

func (*TestUpsertOne) UpdateSelfPickupConfigs

func (u *TestUpsertOne) UpdateSelfPickupConfigs() *TestUpsertOne

UpdateSelfPickupConfigs sets the "self_pickup_configs" field to the value that was provided on create.

func (*TestUpsertOne) UpdateServerID

func (u *TestUpsertOne) UpdateServerID() *TestUpsertOne

UpdateServerID sets the "server_id" field to the value that was provided on create.

func (*TestUpsertOne) UpdateSort

func (u *TestUpsertOne) UpdateSort() *TestUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*TestUpsertOne) UpdateUpdatedAt

func (u *TestUpsertOne) UpdateUpdatedAt() *TestUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Tests

type Tests []*Test

Tests is a parsable slice of Test.

type Tx

type Tx struct {

	// Test is the client for interacting with the Test builders.
	Test *TestClient
	// 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 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