entities

package
v0.0.0-...-fe50809 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 39 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.
	TypeOrder  = "Order"
	TypeOutbox = "Outbox"
)

Variables

View Source
var DefaultOrderOrder = &OrderOrder{
	Direction: OrderDirectionAsc,
	Field: &OrderOrderField{
		field: order.FieldID,
		toCursor: func(o *Order) Cursor {
			return Cursor{ID: o.ID}
		},
	},
}

DefaultOrderOrder is the default ordering of Order.

View Source
var DefaultOutboxOrder = &OutboxOrder{
	Direction: OrderDirectionAsc,
	Field: &OutboxOrderField{
		field: outbox.FieldID,
		toCursor: func(o *Outbox) Cursor {
			return Cursor{ID: o.ID}
		},
	},
}

DefaultOutboxOrder is the default ordering of Outbox.

View Source
var ErrEmptyOrderWhereInput = errors.New("entities: empty predicate OrderWhereInput")

ErrEmptyOrderWhereInput is returned in case the OrderWhereInput is empty.

View Source
var ErrEmptyOutboxWhereInput = errors.New("entities: empty predicate OutboxWhereInput")

ErrEmptyOutboxWhereInput is returned in case the OutboxWhereInput 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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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(entities.As(entities.Sum(field1), "sum_field1"), (entities.As(entities.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
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// Outbox is the client for interacting with the Outbox builders.
	Outbox *OutboxClient
	// 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().
	Order.
	Query().
	Count(ctx)

func (*Client) ExecContext

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

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

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id int, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []int, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) QueryContext

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Cursor

type Cursor struct {
	ID    int   `msgpack:"i"`
	Value Value `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type EntgoClient

type EntgoClient interface {
	Close()
	GetClient() *Client
	CreateTransaction(ctx context.Context) (*Tx, error)
	RollbackTransaction(tx *Tx) error
	CommitTransaction(tx *Tx) error
}

func NewEntgoClient

func NewEntgoClient(
	logger *zap.SugaredLogger,
	database database.Database) (EntgoClient, error)

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

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 AlternateSchema

func AlternateSchema(schemaConfig SchemaConfig) Option

AlternateSchemas allows alternate schema names to be passed into ent operations.

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 Order

type Order struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OrderDetails holds the value of the "order_details" field.
	OrderDetails models.OrderDetails `json:"order_details,omitempty"`
	// PreferredExchanges holds the value of the "preferred_exchanges" field.
	PreferredExchanges []models.Exchange `json:"preferred_exchanges,omitempty"`
	// contains filtered or unexported fields
}

Order is the model entity for the Order schema.

func (*Order) ExecContext

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

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

func (*Order) IsNode

func (n *Order) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Order) QueryContext

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

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

func (*Order) String

func (o *Order) String() string

String implements the fmt.Stringer.

func (*Order) ToEdge

func (o *Order) ToEdge(order *OrderOrder) *OrderEdge

ToEdge converts Order into OrderEdge.

func (*Order) Unwrap

func (o *Order) Unwrap() *Order

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

func (o *Order) Update() *OrderUpdateOne

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

type OrderClient

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

OrderClient is a client for the Order schema.

func NewOrderClient

func NewOrderClient(c config) *OrderClient

NewOrderClient returns a client for the Order from the given config.

func (*OrderClient) Create

func (c *OrderClient) Create() *OrderCreate

Create returns a builder for creating a Order entity.

func (*OrderClient) CreateBulk

func (c *OrderClient) CreateBulk(builders ...*OrderCreate) *OrderCreateBulk

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

func (*OrderClient) Delete

func (c *OrderClient) Delete() *OrderDelete

Delete returns a delete builder for Order.

func (*OrderClient) DeleteOne

func (c *OrderClient) DeleteOne(o *Order) *OrderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderClient) DeleteOneID

func (c *OrderClient) DeleteOneID(id int) *OrderDeleteOne

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

func (*OrderClient) ExecContext

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

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

func (*OrderClient) Get

func (c *OrderClient) Get(ctx context.Context, id int) (*Order, error)

Get returns a Order entity by its id.

func (*OrderClient) GetX

func (c *OrderClient) GetX(ctx context.Context, id int) *Order

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

func (*OrderClient) Hooks

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

Hooks returns the client hooks.

func (*OrderClient) Intercept

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

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

func (*OrderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OrderClient) Query

func (c *OrderClient) Query() *OrderQuery

Query returns a query builder for Order.

func (*OrderClient) QueryContext

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

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

func (*OrderClient) Update

func (c *OrderClient) Update() *OrderUpdate

Update returns an update builder for Order.

func (*OrderClient) UpdateOne

func (c *OrderClient) UpdateOne(o *Order) *OrderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderClient) UpdateOneID

func (c *OrderClient) UpdateOneID(id int) *OrderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrderClient) Use

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

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

type OrderConnection

type OrderConnection struct {
	Edges      []*OrderEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

OrderConnection is the connection containing edges to Order.

type OrderCreate

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

OrderCreate is the builder for creating a Order entity.

func (*OrderCreate) Exec

func (oc *OrderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreate) ExecContext

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

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

func (*OrderCreate) ExecX

func (oc *OrderCreate) ExecX(ctx context.Context)

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

func (*OrderCreate) Mutation

func (oc *OrderCreate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderCreate) OnConflict

func (oc *OrderCreate) OnConflict(opts ...sql.ConflictOption) *OrderUpsertOne

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

client.Order.Create().
	SetOrderDetails(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.OrderUpsert) {
		SetOrderDetails(v+v).
	}).
	Exec(ctx)

func (*OrderCreate) OnConflictColumns

func (oc *OrderCreate) OnConflictColumns(columns ...string) *OrderUpsertOne

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

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

func (*OrderCreate) QueryContext

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

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

func (*OrderCreate) Save

func (oc *OrderCreate) Save(ctx context.Context) (*Order, error)

Save creates the Order in the database.

func (*OrderCreate) SaveX

func (oc *OrderCreate) SaveX(ctx context.Context) *Order

SaveX calls Save and panics if Save returns an error.

func (*OrderCreate) SetOrderDetails

func (oc *OrderCreate) SetOrderDetails(md models.OrderDetails) *OrderCreate

SetOrderDetails sets the "order_details" field.

func (*OrderCreate) SetPreferredExchanges

func (oc *OrderCreate) SetPreferredExchanges(m []models.Exchange) *OrderCreate

SetPreferredExchanges sets the "preferred_exchanges" field.

type OrderCreateBulk

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

OrderCreateBulk is the builder for creating many Order entities in bulk.

func (*OrderCreateBulk) Exec

func (ocb *OrderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreateBulk) ExecContext

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

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

func (*OrderCreateBulk) ExecX

func (ocb *OrderCreateBulk) ExecX(ctx context.Context)

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

func (*OrderCreateBulk) OnConflict

func (ocb *OrderCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrderUpsertBulk

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

client.Order.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.OrderUpsert) {
		SetOrderDetails(v+v).
	}).
	Exec(ctx)

func (*OrderCreateBulk) OnConflictColumns

func (ocb *OrderCreateBulk) OnConflictColumns(columns ...string) *OrderUpsertBulk

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

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

func (*OrderCreateBulk) QueryContext

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

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

func (*OrderCreateBulk) Save

func (ocb *OrderCreateBulk) Save(ctx context.Context) ([]*Order, error)

Save creates the Order entities in the database.

func (*OrderCreateBulk) SaveX

func (ocb *OrderCreateBulk) SaveX(ctx context.Context) []*Order

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

type OrderDelete

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

OrderDelete is the builder for deleting a Order entity.

func (*OrderDelete) Exec

func (od *OrderDelete) Exec(ctx context.Context) (int, error)

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

func (*OrderDelete) ExecContext

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

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

func (*OrderDelete) ExecX

func (od *OrderDelete) ExecX(ctx context.Context) int

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

func (*OrderDelete) QueryContext

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

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

func (*OrderDelete) Where

func (od *OrderDelete) Where(ps ...predicate.Order) *OrderDelete

Where appends a list predicates to the OrderDelete builder.

type OrderDeleteOne

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

OrderDeleteOne is the builder for deleting a single Order entity.

func (*OrderDeleteOne) Exec

func (odo *OrderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderDeleteOne) ExecX

func (odo *OrderDeleteOne) ExecX(ctx context.Context)

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

func (*OrderDeleteOne) Where

func (odo *OrderDeleteOne) Where(ps ...predicate.Order) *OrderDeleteOne

Where appends a list predicates to the OrderDelete builder.

type OrderDirection

type OrderDirection string

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

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

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderEdge

type OrderEdge struct {
	Node   *Order `json:"node"`
	Cursor Cursor `json:"cursor"`
}

OrderEdge is the edge representation of Order.

type OrderFilter

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

OrderFilter provides a generic filtering capability at runtime for OrderQuery.

func (*OrderFilter) ExecContext

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

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

func (*OrderFilter) QueryContext

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

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

func (*OrderFilter) Where

func (f *OrderFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*OrderFilter) WhereID

func (f *OrderFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*OrderFilter) WhereOrderDetails

func (f *OrderFilter) WhereOrderDetails(p entql.BytesP)

WhereOrderDetails applies the entql json.RawMessage predicate on the order_details field.

func (*OrderFilter) WherePreferredExchanges

func (f *OrderFilter) WherePreferredExchanges(p entql.BytesP)

WherePreferredExchanges applies the entql json.RawMessage predicate on the preferred_exchanges field.

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 OrderGroupBy

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

OrderGroupBy is the group-by builder for Order entities.

func (*OrderGroupBy) Aggregate

func (ogb *OrderGroupBy) Aggregate(fns ...AggregateFunc) *OrderGroupBy

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

func (*OrderGroupBy) Bool

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

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

func (*OrderGroupBy) BoolX

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

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

func (*OrderGroupBy) Bools

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

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

func (*OrderGroupBy) BoolsX

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

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

func (*OrderGroupBy) Float64

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

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

func (*OrderGroupBy) Float64X

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

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

func (*OrderGroupBy) Float64s

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

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

func (*OrderGroupBy) Float64sX

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

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

func (*OrderGroupBy) Int

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

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

func (*OrderGroupBy) IntX

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

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

func (*OrderGroupBy) Ints

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

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

func (*OrderGroupBy) IntsX

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

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

func (*OrderGroupBy) Scan

func (ogb *OrderGroupBy) Scan(ctx context.Context, v any) error

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

func (*OrderGroupBy) ScanX

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

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

func (*OrderGroupBy) String

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

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

func (*OrderGroupBy) StringX

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

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

func (*OrderGroupBy) Strings

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

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

func (*OrderGroupBy) StringsX

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

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

type OrderMutation

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

OrderMutation represents an operation that mutates the Order nodes in the graph.

func (*OrderMutation) AddField

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

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

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

func (*OrderMutation) AddedField

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

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

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

func (*OrderMutation) AddedIDs

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

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

func (*OrderMutation) AppendPreferredExchanges

func (m *OrderMutation) AppendPreferredExchanges(value []models.Exchange)

AppendPreferredExchanges adds value to the "preferred_exchanges" field.

func (*OrderMutation) AppendedPreferredExchanges

func (m *OrderMutation) AppendedPreferredExchanges() ([]models.Exchange, bool)

AppendedPreferredExchanges returns the list of values that were appended to the "preferred_exchanges" field in this mutation.

func (*OrderMutation) ClearEdge

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

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

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

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

func (*OrderMutation) ClearedFields

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

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

func (OrderMutation) Client

func (m OrderMutation) 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 (*OrderMutation) EdgeCleared

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

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

func (*OrderMutation) ExecContext

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

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

func (*OrderMutation) Field

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

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

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

func (*OrderMutation) Fields

func (m *OrderMutation) 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 (*OrderMutation) Filter

func (m *OrderMutation) Filter() *OrderFilter

Filter returns an entql.Where implementation to apply filters on the OrderMutation builder.

func (*OrderMutation) ID

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

func (m *OrderMutation) 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 (*OrderMutation) OldField

func (m *OrderMutation) 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 (*OrderMutation) OldOrderDetails

func (m *OrderMutation) OldOrderDetails(ctx context.Context) (v models.OrderDetails, err error)

OldOrderDetails returns the old "order_details" field's value of the Order entity. If the Order 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 (*OrderMutation) OldPreferredExchanges

func (m *OrderMutation) OldPreferredExchanges(ctx context.Context) (v []models.Exchange, err error)

OldPreferredExchanges returns the old "preferred_exchanges" field's value of the Order entity. If the Order 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 (*OrderMutation) Op

func (m *OrderMutation) Op() Op

Op returns the operation name.

func (*OrderMutation) OrderDetails

func (m *OrderMutation) OrderDetails() (r models.OrderDetails, exists bool)

OrderDetails returns the value of the "order_details" field in the mutation.

func (*OrderMutation) PreferredExchanges

func (m *OrderMutation) PreferredExchanges() (r []models.Exchange, exists bool)

PreferredExchanges returns the value of the "preferred_exchanges" field in the mutation.

func (*OrderMutation) QueryContext

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

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

func (*OrderMutation) RemovedEdges

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

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

func (*OrderMutation) RemovedIDs

func (m *OrderMutation) 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 (*OrderMutation) ResetEdge

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

func (m *OrderMutation) 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 (*OrderMutation) ResetOrderDetails

func (m *OrderMutation) ResetOrderDetails()

ResetOrderDetails resets all changes to the "order_details" field.

func (*OrderMutation) ResetPreferredExchanges

func (m *OrderMutation) ResetPreferredExchanges()

ResetPreferredExchanges resets all changes to the "preferred_exchanges" field.

func (*OrderMutation) SetField

func (m *OrderMutation) 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 (*OrderMutation) SetOp

func (m *OrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderMutation) SetOrderDetails

func (m *OrderMutation) SetOrderDetails(md models.OrderDetails)

SetOrderDetails sets the "order_details" field.

func (*OrderMutation) SetPreferredExchanges

func (m *OrderMutation) SetPreferredExchanges(value []models.Exchange)

SetPreferredExchanges sets the "preferred_exchanges" field.

func (OrderMutation) Tx

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

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

func (*OrderMutation) Type

func (m *OrderMutation) Type() string

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

func (*OrderMutation) Where

func (m *OrderMutation) Where(ps ...predicate.Order)

Where appends a list predicates to the OrderMutation builder.

func (*OrderMutation) WhereP

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

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

type OrderOrder

type OrderOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *OrderOrderField `json:"field"`
}

OrderOrder defines the ordering of Order.

type OrderOrderField

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

OrderOrderField defines the ordering field of Order.

type OrderPaginateOption

type OrderPaginateOption func(*orderPager) error

OrderPaginateOption enables pagination customization.

func WithOrderFilter

func WithOrderFilter(filter func(*OrderQuery) (*OrderQuery, error)) OrderPaginateOption

WithOrderFilter configures pagination filter.

func WithOrderOrder

func WithOrderOrder(order *OrderOrder) OrderPaginateOption

WithOrderOrder configures pagination ordering.

type OrderQuery

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

OrderQuery is the builder for querying Order entities.

func (*OrderQuery) Aggregate

func (oq *OrderQuery) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate returns a OrderSelect configured with the given aggregations.

func (*OrderQuery) All

func (oq *OrderQuery) All(ctx context.Context) ([]*Order, error)

All executes the query and returns a list of Orders.

func (*OrderQuery) AllX

func (oq *OrderQuery) AllX(ctx context.Context) []*Order

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

func (*OrderQuery) Clone

func (oq *OrderQuery) Clone() *OrderQuery

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

func (*OrderQuery) CollectFields

func (o *OrderQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrderQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*OrderQuery) Count

func (oq *OrderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderQuery) CountX

func (oq *OrderQuery) CountX(ctx context.Context) int

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

func (*OrderQuery) ExecContext

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

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

func (*OrderQuery) Exist

func (oq *OrderQuery) Exist(ctx context.Context) (bool, error)

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

func (*OrderQuery) ExistX

func (oq *OrderQuery) ExistX(ctx context.Context) bool

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

func (*OrderQuery) Filter

func (oq *OrderQuery) Filter() *OrderFilter

Filter returns a Filter implementation to apply filters on the OrderQuery builder.

func (*OrderQuery) First

func (oq *OrderQuery) First(ctx context.Context) (*Order, error)

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

func (*OrderQuery) FirstID

func (oq *OrderQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OrderQuery) FirstIDX

func (oq *OrderQuery) FirstIDX(ctx context.Context) int

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

func (*OrderQuery) FirstX

func (oq *OrderQuery) FirstX(ctx context.Context) *Order

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

func (*OrderQuery) ForShare

func (oq *OrderQuery) ForShare(opts ...sql.LockOption) *OrderQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*OrderQuery) ForUpdate

func (oq *OrderQuery) ForUpdate(opts ...sql.LockOption) *OrderQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*OrderQuery) GroupBy

func (oq *OrderQuery) GroupBy(field string, fields ...string) *OrderGroupBy

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 {
	OrderDetails models.OrderDetails `json:"order_details,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Order.Query().
	GroupBy(order.FieldOrderDetails).
	Aggregate(entities.Count()).
	Scan(ctx, &v)

func (*OrderQuery) IDs

func (oq *OrderQuery) IDs(ctx context.Context) ([]int, error)

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

func (*OrderQuery) IDsX

func (oq *OrderQuery) IDsX(ctx context.Context) []int

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

func (*OrderQuery) Limit

func (oq *OrderQuery) Limit(limit int) *OrderQuery

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

func (*OrderQuery) Modify

func (oq *OrderQuery) Modify(modifiers ...func(s *sql.Selector)) *OrderSelect

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

func (*OrderQuery) Offset

func (oq *OrderQuery) Offset(offset int) *OrderQuery

Offset to start from.

func (*OrderQuery) Only

func (oq *OrderQuery) Only(ctx context.Context) (*Order, error)

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

func (*OrderQuery) OnlyID

func (oq *OrderQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OrderQuery) OnlyIDX

func (oq *OrderQuery) OnlyIDX(ctx context.Context) int

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

func (*OrderQuery) OnlyX

func (oq *OrderQuery) OnlyX(ctx context.Context) *Order

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

func (*OrderQuery) Order

func (oq *OrderQuery) Order(o ...OrderFunc) *OrderQuery

Order specifies how the records should be ordered.

func (*OrderQuery) Paginate

func (o *OrderQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...OrderPaginateOption,
) (*OrderConnection, error)

Paginate executes the query and returns a relay based cursor connection to Order.

func (*OrderQuery) QueryContext

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

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

func (*OrderQuery) Select

func (oq *OrderQuery) Select(fields ...string) *OrderSelect

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 {
	OrderDetails models.OrderDetails `json:"order_details,omitempty"`
}

client.Order.Query().
	Select(order.FieldOrderDetails).
	Scan(ctx, &v)

func (*OrderQuery) Unique

func (oq *OrderQuery) Unique(unique bool) *OrderQuery

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

func (oq *OrderQuery) Where(ps ...predicate.Order) *OrderQuery

Where adds a new predicate for the OrderQuery builder.

type OrderSelect

type OrderSelect struct {
	*OrderQuery
	// contains filtered or unexported fields
}

OrderSelect is the builder for selecting fields of Order entities.

func (*OrderSelect) Aggregate

func (os *OrderSelect) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderSelect) Bool

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

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

func (*OrderSelect) BoolX

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

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

func (*OrderSelect) Bools

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

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

func (*OrderSelect) BoolsX

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

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

func (OrderSelect) ExecContext

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

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

func (*OrderSelect) Float64

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

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

func (*OrderSelect) Float64X

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

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

func (*OrderSelect) Float64s

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

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

func (*OrderSelect) Float64sX

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

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

func (*OrderSelect) Int

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

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

func (*OrderSelect) IntX

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

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

func (*OrderSelect) Ints

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

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

func (*OrderSelect) IntsX

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

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

func (*OrderSelect) Modify

func (os *OrderSelect) Modify(modifiers ...func(s *sql.Selector)) *OrderSelect

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

func (OrderSelect) QueryContext

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

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

func (*OrderSelect) Scan

func (os *OrderSelect) Scan(ctx context.Context, v any) error

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

func (*OrderSelect) ScanX

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

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

func (*OrderSelect) String

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

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

func (*OrderSelect) StringX

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

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

func (*OrderSelect) Strings

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

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

func (*OrderSelect) StringsX

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

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

type OrderUpdate

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

OrderUpdate is the builder for updating Order entities.

func (*OrderUpdate) AppendPreferredExchanges

func (ou *OrderUpdate) AppendPreferredExchanges(m []models.Exchange) *OrderUpdate

AppendPreferredExchanges appends m to the "preferred_exchanges" field.

func (*OrderUpdate) Exec

func (ou *OrderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderUpdate) ExecContext

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

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

func (*OrderUpdate) ExecX

func (ou *OrderUpdate) ExecX(ctx context.Context)

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

func (*OrderUpdate) Modify

func (ou *OrderUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OrderUpdate

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

func (*OrderUpdate) Mutation

func (ou *OrderUpdate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdate) QueryContext

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

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

func (*OrderUpdate) Save

func (ou *OrderUpdate) Save(ctx context.Context) (int, error)

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

func (*OrderUpdate) SaveX

func (ou *OrderUpdate) SaveX(ctx context.Context) int

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

func (*OrderUpdate) SetOrderDetails

func (ou *OrderUpdate) SetOrderDetails(md models.OrderDetails) *OrderUpdate

SetOrderDetails sets the "order_details" field.

func (*OrderUpdate) SetPreferredExchanges

func (ou *OrderUpdate) SetPreferredExchanges(m []models.Exchange) *OrderUpdate

SetPreferredExchanges sets the "preferred_exchanges" field.

func (*OrderUpdate) Where

func (ou *OrderUpdate) Where(ps ...predicate.Order) *OrderUpdate

Where appends a list predicates to the OrderUpdate builder.

type OrderUpdateOne

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

OrderUpdateOne is the builder for updating a single Order entity.

func (*OrderUpdateOne) AppendPreferredExchanges

func (ouo *OrderUpdateOne) AppendPreferredExchanges(m []models.Exchange) *OrderUpdateOne

AppendPreferredExchanges appends m to the "preferred_exchanges" field.

func (*OrderUpdateOne) Exec

func (ouo *OrderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderUpdateOne) ExecContext

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

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

func (*OrderUpdateOne) ExecX

func (ouo *OrderUpdateOne) ExecX(ctx context.Context)

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

func (*OrderUpdateOne) Modify

func (ouo *OrderUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OrderUpdateOne

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

func (*OrderUpdateOne) Mutation

func (ouo *OrderUpdateOne) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdateOne) QueryContext

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

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

func (*OrderUpdateOne) Save

func (ouo *OrderUpdateOne) Save(ctx context.Context) (*Order, error)

Save executes the query and returns the updated Order entity.

func (*OrderUpdateOne) SaveX

func (ouo *OrderUpdateOne) SaveX(ctx context.Context) *Order

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

func (*OrderUpdateOne) Select

func (ouo *OrderUpdateOne) Select(field string, fields ...string) *OrderUpdateOne

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

func (*OrderUpdateOne) SetOrderDetails

func (ouo *OrderUpdateOne) SetOrderDetails(md models.OrderDetails) *OrderUpdateOne

SetOrderDetails sets the "order_details" field.

func (*OrderUpdateOne) SetPreferredExchanges

func (ouo *OrderUpdateOne) SetPreferredExchanges(m []models.Exchange) *OrderUpdateOne

SetPreferredExchanges sets the "preferred_exchanges" field.

type OrderUpsert

type OrderUpsert struct {
	*sql.UpdateSet
}

OrderUpsert is the "OnConflict" setter.

func (*OrderUpsert) SetOrderDetails

func (u *OrderUpsert) SetOrderDetails(v models.OrderDetails) *OrderUpsert

SetOrderDetails sets the "order_details" field.

func (*OrderUpsert) SetPreferredExchanges

func (u *OrderUpsert) SetPreferredExchanges(v []models.Exchange) *OrderUpsert

SetPreferredExchanges sets the "preferred_exchanges" field.

func (*OrderUpsert) UpdateOrderDetails

func (u *OrderUpsert) UpdateOrderDetails() *OrderUpsert

UpdateOrderDetails sets the "order_details" field to the value that was provided on create.

func (*OrderUpsert) UpdatePreferredExchanges

func (u *OrderUpsert) UpdatePreferredExchanges() *OrderUpsert

UpdatePreferredExchanges sets the "preferred_exchanges" field to the value that was provided on create.

type OrderUpsertBulk

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

OrderUpsertBulk is the builder for "upsert"-ing a bulk of Order nodes.

func (*OrderUpsertBulk) DoNothing

func (u *OrderUpsertBulk) DoNothing() *OrderUpsertBulk

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

func (*OrderUpsertBulk) Exec

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

Exec executes the query.

func (*OrderUpsertBulk) ExecX

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

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

func (*OrderUpsertBulk) Ignore

func (u *OrderUpsertBulk) Ignore() *OrderUpsertBulk

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

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

func (*OrderUpsertBulk) SetOrderDetails

func (u *OrderUpsertBulk) SetOrderDetails(v models.OrderDetails) *OrderUpsertBulk

SetOrderDetails sets the "order_details" field.

func (*OrderUpsertBulk) SetPreferredExchanges

func (u *OrderUpsertBulk) SetPreferredExchanges(v []models.Exchange) *OrderUpsertBulk

SetPreferredExchanges sets the "preferred_exchanges" field.

func (*OrderUpsertBulk) Update

func (u *OrderUpsertBulk) Update(set func(*OrderUpsert)) *OrderUpsertBulk

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

func (*OrderUpsertBulk) UpdateNewValues

func (u *OrderUpsertBulk) UpdateNewValues() *OrderUpsertBulk

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

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

func (*OrderUpsertBulk) UpdateOrderDetails

func (u *OrderUpsertBulk) UpdateOrderDetails() *OrderUpsertBulk

UpdateOrderDetails sets the "order_details" field to the value that was provided on create.

func (*OrderUpsertBulk) UpdatePreferredExchanges

func (u *OrderUpsertBulk) UpdatePreferredExchanges() *OrderUpsertBulk

UpdatePreferredExchanges sets the "preferred_exchanges" field to the value that was provided on create.

type OrderUpsertOne

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

OrderUpsertOne is the builder for "upsert"-ing

one Order node.

func (*OrderUpsertOne) DoNothing

func (u *OrderUpsertOne) DoNothing() *OrderUpsertOne

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

func (*OrderUpsertOne) Exec

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

Exec executes the query.

func (*OrderUpsertOne) ExecX

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

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

func (*OrderUpsertOne) ID

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

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

func (*OrderUpsertOne) IDX

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

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

func (*OrderUpsertOne) Ignore

func (u *OrderUpsertOne) Ignore() *OrderUpsertOne

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

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

func (*OrderUpsertOne) SetOrderDetails

func (u *OrderUpsertOne) SetOrderDetails(v models.OrderDetails) *OrderUpsertOne

SetOrderDetails sets the "order_details" field.

func (*OrderUpsertOne) SetPreferredExchanges

func (u *OrderUpsertOne) SetPreferredExchanges(v []models.Exchange) *OrderUpsertOne

SetPreferredExchanges sets the "preferred_exchanges" field.

func (*OrderUpsertOne) Update

func (u *OrderUpsertOne) Update(set func(*OrderUpsert)) *OrderUpsertOne

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

func (*OrderUpsertOne) UpdateNewValues

func (u *OrderUpsertOne) UpdateNewValues() *OrderUpsertOne

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

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

func (*OrderUpsertOne) UpdateOrderDetails

func (u *OrderUpsertOne) UpdateOrderDetails() *OrderUpsertOne

UpdateOrderDetails sets the "order_details" field to the value that was provided on create.

func (*OrderUpsertOne) UpdatePreferredExchanges

func (u *OrderUpsertOne) UpdatePreferredExchanges() *OrderUpsertOne

UpdatePreferredExchanges sets the "preferred_exchanges" field to the value that was provided on create.

type OrderWhereInput

type OrderWhereInput struct {
	Predicates []predicate.Order  `json:"-"`
	Not        *OrderWhereInput   `json:"not,omitempty"`
	Or         []*OrderWhereInput `json:"or,omitempty"`
	And        []*OrderWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`
}

OrderWhereInput represents a where input for filtering Order queries.

func (*OrderWhereInput) AddPredicates

func (i *OrderWhereInput) AddPredicates(predicates ...predicate.Order)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*OrderWhereInput) Filter

func (i *OrderWhereInput) Filter(q *OrderQuery) (*OrderQuery, error)

Filter applies the OrderWhereInput filter on the OrderQuery builder.

func (*OrderWhereInput) P

P returns a predicate for filtering orders. An error is returned if the input is empty or invalid.

type Orders

type Orders []*Order

Orders is a parsable slice of Order.

type Outbox

type Outbox struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Topic holds the value of the "topic" field.
	Topic string `json:"topic,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Payload holds the value of the "payload" field.
	Payload []byte `json:"payload,omitempty"`
	// Headers holds the value of the "headers" field.
	Headers map[string]string `json:"headers,omitempty"`
	// RetryCount holds the value of the "retry_count" field.
	RetryCount int `json:"retry_count,omitempty"`
	// Status holds the value of the "status" field.
	Status outbox.Status `json:"status,omitempty"`
	// LastRetry holds the value of the "last_retry" field.
	LastRetry time.Time `json:"last_retry,omitempty"`
	// ProcessingErrors holds the value of the "processing_errors" field.
	ProcessingErrors []string `json:"processing_errors,omitempty"`
	// contains filtered or unexported fields
}

Outbox is the model entity for the Outbox schema.

func (*Outbox) ExecContext

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

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

func (*Outbox) IsNode

func (n *Outbox) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Outbox) QueryContext

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

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

func (*Outbox) String

func (o *Outbox) String() string

String implements the fmt.Stringer.

func (*Outbox) ToEdge

func (o *Outbox) ToEdge(order *OutboxOrder) *OutboxEdge

ToEdge converts Outbox into OutboxEdge.

func (*Outbox) Unwrap

func (o *Outbox) Unwrap() *Outbox

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

func (o *Outbox) Update() *OutboxUpdateOne

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

type OutboxClient

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

OutboxClient is a client for the Outbox schema.

func NewOutboxClient

func NewOutboxClient(c config) *OutboxClient

NewOutboxClient returns a client for the Outbox from the given config.

func (*OutboxClient) Create

func (c *OutboxClient) Create() *OutboxCreate

Create returns a builder for creating a Outbox entity.

func (*OutboxClient) CreateBulk

func (c *OutboxClient) CreateBulk(builders ...*OutboxCreate) *OutboxCreateBulk

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

func (*OutboxClient) Delete

func (c *OutboxClient) Delete() *OutboxDelete

Delete returns a delete builder for Outbox.

func (*OutboxClient) DeleteOne

func (c *OutboxClient) DeleteOne(o *Outbox) *OutboxDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OutboxClient) DeleteOneID

func (c *OutboxClient) DeleteOneID(id int) *OutboxDeleteOne

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

func (*OutboxClient) ExecContext

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

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

func (*OutboxClient) Get

func (c *OutboxClient) Get(ctx context.Context, id int) (*Outbox, error)

Get returns a Outbox entity by its id.

func (*OutboxClient) GetX

func (c *OutboxClient) GetX(ctx context.Context, id int) *Outbox

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

func (*OutboxClient) Hooks

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

Hooks returns the client hooks.

func (*OutboxClient) Intercept

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

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

func (*OutboxClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OutboxClient) Query

func (c *OutboxClient) Query() *OutboxQuery

Query returns a query builder for Outbox.

func (*OutboxClient) QueryContext

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

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

func (*OutboxClient) Update

func (c *OutboxClient) Update() *OutboxUpdate

Update returns an update builder for Outbox.

func (*OutboxClient) UpdateOne

func (c *OutboxClient) UpdateOne(o *Outbox) *OutboxUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OutboxClient) UpdateOneID

func (c *OutboxClient) UpdateOneID(id int) *OutboxUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OutboxClient) Use

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

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

type OutboxConnection

type OutboxConnection struct {
	Edges      []*OutboxEdge `json:"edges"`
	PageInfo   PageInfo      `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

OutboxConnection is the connection containing edges to Outbox.

type OutboxCreate

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

OutboxCreate is the builder for creating a Outbox entity.

func (*OutboxCreate) Exec

func (oc *OutboxCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OutboxCreate) ExecContext

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

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

func (*OutboxCreate) ExecX

func (oc *OutboxCreate) ExecX(ctx context.Context)

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

func (*OutboxCreate) Mutation

func (oc *OutboxCreate) Mutation() *OutboxMutation

Mutation returns the OutboxMutation object of the builder.

func (*OutboxCreate) OnConflict

func (oc *OutboxCreate) OnConflict(opts ...sql.ConflictOption) *OutboxUpsertOne

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

client.Outbox.Create().
	SetTimestamp(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.OutboxUpsert) {
		SetTimestamp(v+v).
	}).
	Exec(ctx)

func (*OutboxCreate) OnConflictColumns

func (oc *OutboxCreate) OnConflictColumns(columns ...string) *OutboxUpsertOne

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

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

func (*OutboxCreate) QueryContext

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

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

func (*OutboxCreate) Save

func (oc *OutboxCreate) Save(ctx context.Context) (*Outbox, error)

Save creates the Outbox in the database.

func (*OutboxCreate) SaveX

func (oc *OutboxCreate) SaveX(ctx context.Context) *Outbox

SaveX calls Save and panics if Save returns an error.

func (*OutboxCreate) SetHeaders

func (oc *OutboxCreate) SetHeaders(m map[string]string) *OutboxCreate

SetHeaders sets the "headers" field.

func (*OutboxCreate) SetKey

func (oc *OutboxCreate) SetKey(s string) *OutboxCreate

SetKey sets the "key" field.

func (*OutboxCreate) SetLastRetry

func (oc *OutboxCreate) SetLastRetry(t time.Time) *OutboxCreate

SetLastRetry sets the "last_retry" field.

func (*OutboxCreate) SetNillableLastRetry

func (oc *OutboxCreate) SetNillableLastRetry(t *time.Time) *OutboxCreate

SetNillableLastRetry sets the "last_retry" field if the given value is not nil.

func (*OutboxCreate) SetPayload

func (oc *OutboxCreate) SetPayload(b []byte) *OutboxCreate

SetPayload sets the "payload" field.

func (*OutboxCreate) SetProcessingErrors

func (oc *OutboxCreate) SetProcessingErrors(s []string) *OutboxCreate

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxCreate) SetRetryCount

func (oc *OutboxCreate) SetRetryCount(i int) *OutboxCreate

SetRetryCount sets the "retry_count" field.

func (*OutboxCreate) SetStatus

func (oc *OutboxCreate) SetStatus(o outbox.Status) *OutboxCreate

SetStatus sets the "status" field.

func (*OutboxCreate) SetTimestamp

func (oc *OutboxCreate) SetTimestamp(t time.Time) *OutboxCreate

SetTimestamp sets the "timestamp" field.

func (*OutboxCreate) SetTopic

func (oc *OutboxCreate) SetTopic(s string) *OutboxCreate

SetTopic sets the "topic" field.

type OutboxCreateBulk

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

OutboxCreateBulk is the builder for creating many Outbox entities in bulk.

func (*OutboxCreateBulk) Exec

func (ocb *OutboxCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OutboxCreateBulk) ExecContext

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

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

func (*OutboxCreateBulk) ExecX

func (ocb *OutboxCreateBulk) ExecX(ctx context.Context)

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

func (*OutboxCreateBulk) OnConflict

func (ocb *OutboxCreateBulk) OnConflict(opts ...sql.ConflictOption) *OutboxUpsertBulk

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

client.Outbox.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.OutboxUpsert) {
		SetTimestamp(v+v).
	}).
	Exec(ctx)

func (*OutboxCreateBulk) OnConflictColumns

func (ocb *OutboxCreateBulk) OnConflictColumns(columns ...string) *OutboxUpsertBulk

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

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

func (*OutboxCreateBulk) QueryContext

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

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

func (*OutboxCreateBulk) Save

func (ocb *OutboxCreateBulk) Save(ctx context.Context) ([]*Outbox, error)

Save creates the Outbox entities in the database.

func (*OutboxCreateBulk) SaveX

func (ocb *OutboxCreateBulk) SaveX(ctx context.Context) []*Outbox

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

type OutboxDelete

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

OutboxDelete is the builder for deleting a Outbox entity.

func (*OutboxDelete) Exec

func (od *OutboxDelete) Exec(ctx context.Context) (int, error)

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

func (*OutboxDelete) ExecContext

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

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

func (*OutboxDelete) ExecX

func (od *OutboxDelete) ExecX(ctx context.Context) int

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

func (*OutboxDelete) QueryContext

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

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

func (*OutboxDelete) Where

func (od *OutboxDelete) Where(ps ...predicate.Outbox) *OutboxDelete

Where appends a list predicates to the OutboxDelete builder.

type OutboxDeleteOne

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

OutboxDeleteOne is the builder for deleting a single Outbox entity.

func (*OutboxDeleteOne) Exec

func (odo *OutboxDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OutboxDeleteOne) ExecX

func (odo *OutboxDeleteOne) ExecX(ctx context.Context)

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

func (*OutboxDeleteOne) Where

func (odo *OutboxDeleteOne) Where(ps ...predicate.Outbox) *OutboxDeleteOne

Where appends a list predicates to the OutboxDelete builder.

type OutboxEdge

type OutboxEdge struct {
	Node   *Outbox `json:"node"`
	Cursor Cursor  `json:"cursor"`
}

OutboxEdge is the edge representation of Outbox.

type OutboxFilter

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

OutboxFilter provides a generic filtering capability at runtime for OutboxQuery.

func (*OutboxFilter) ExecContext

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

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

func (*OutboxFilter) QueryContext

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

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

func (*OutboxFilter) Where

func (f *OutboxFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*OutboxFilter) WhereHeaders

func (f *OutboxFilter) WhereHeaders(p entql.BytesP)

WhereHeaders applies the entql json.RawMessage predicate on the headers field.

func (*OutboxFilter) WhereID

func (f *OutboxFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*OutboxFilter) WhereKey

func (f *OutboxFilter) WhereKey(p entql.StringP)

WhereKey applies the entql string predicate on the key field.

func (*OutboxFilter) WhereLastRetry

func (f *OutboxFilter) WhereLastRetry(p entql.TimeP)

WhereLastRetry applies the entql time.Time predicate on the last_retry field.

func (*OutboxFilter) WherePayload

func (f *OutboxFilter) WherePayload(p entql.BytesP)

WherePayload applies the entql []byte predicate on the payload field.

func (*OutboxFilter) WhereProcessingErrors

func (f *OutboxFilter) WhereProcessingErrors(p entql.BytesP)

WhereProcessingErrors applies the entql json.RawMessage predicate on the processing_errors field.

func (*OutboxFilter) WhereRetryCount

func (f *OutboxFilter) WhereRetryCount(p entql.IntP)

WhereRetryCount applies the entql int predicate on the retry_count field.

func (*OutboxFilter) WhereStatus

func (f *OutboxFilter) WhereStatus(p entql.StringP)

WhereStatus applies the entql string predicate on the status field.

func (*OutboxFilter) WhereTimestamp

func (f *OutboxFilter) WhereTimestamp(p entql.TimeP)

WhereTimestamp applies the entql time.Time predicate on the timestamp field.

func (*OutboxFilter) WhereTopic

func (f *OutboxFilter) WhereTopic(p entql.StringP)

WhereTopic applies the entql string predicate on the topic field.

type OutboxGroupBy

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

OutboxGroupBy is the group-by builder for Outbox entities.

func (*OutboxGroupBy) Aggregate

func (ogb *OutboxGroupBy) Aggregate(fns ...AggregateFunc) *OutboxGroupBy

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

func (*OutboxGroupBy) Bool

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

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

func (*OutboxGroupBy) BoolX

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

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

func (*OutboxGroupBy) Bools

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

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

func (*OutboxGroupBy) BoolsX

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

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

func (*OutboxGroupBy) Float64

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

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

func (*OutboxGroupBy) Float64X

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

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

func (*OutboxGroupBy) Float64s

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

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

func (*OutboxGroupBy) Float64sX

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

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

func (*OutboxGroupBy) Int

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

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

func (*OutboxGroupBy) IntX

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

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

func (*OutboxGroupBy) Ints

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

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

func (*OutboxGroupBy) IntsX

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

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

func (*OutboxGroupBy) Scan

func (ogb *OutboxGroupBy) Scan(ctx context.Context, v any) error

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

func (*OutboxGroupBy) ScanX

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

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

func (*OutboxGroupBy) String

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

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

func (*OutboxGroupBy) StringX

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

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

func (*OutboxGroupBy) Strings

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

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

func (*OutboxGroupBy) StringsX

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

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

type OutboxMutation

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

OutboxMutation represents an operation that mutates the Outbox nodes in the graph.

func (*OutboxMutation) AddField

func (m *OutboxMutation) 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 (*OutboxMutation) AddRetryCount

func (m *OutboxMutation) AddRetryCount(i int)

AddRetryCount adds i to the "retry_count" field.

func (*OutboxMutation) AddedEdges

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

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

func (*OutboxMutation) AddedField

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

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

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

func (*OutboxMutation) AddedIDs

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

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

func (*OutboxMutation) AddedRetryCount

func (m *OutboxMutation) AddedRetryCount() (r int, exists bool)

AddedRetryCount returns the value that was added to the "retry_count" field in this mutation.

func (*OutboxMutation) AppendProcessingErrors

func (m *OutboxMutation) AppendProcessingErrors(s []string)

AppendProcessingErrors adds s to the "processing_errors" field.

func (*OutboxMutation) AppendedProcessingErrors

func (m *OutboxMutation) AppendedProcessingErrors() ([]string, bool)

AppendedProcessingErrors returns the list of values that were appended to the "processing_errors" field in this mutation.

func (*OutboxMutation) ClearEdge

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

func (m *OutboxMutation) 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 (*OutboxMutation) ClearLastRetry

func (m *OutboxMutation) ClearLastRetry()

ClearLastRetry clears the value of the "last_retry" field.

func (*OutboxMutation) ClearProcessingErrors

func (m *OutboxMutation) ClearProcessingErrors()

ClearProcessingErrors clears the value of the "processing_errors" field.

func (*OutboxMutation) ClearedEdges

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

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

func (*OutboxMutation) ClearedFields

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

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

func (OutboxMutation) Client

func (m OutboxMutation) 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 (*OutboxMutation) EdgeCleared

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

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

func (*OutboxMutation) ExecContext

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

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

func (*OutboxMutation) Field

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

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

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

func (*OutboxMutation) Fields

func (m *OutboxMutation) 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 (*OutboxMutation) Filter

func (m *OutboxMutation) Filter() *OutboxFilter

Filter returns an entql.Where implementation to apply filters on the OutboxMutation builder.

func (*OutboxMutation) Headers

func (m *OutboxMutation) Headers() (r map[string]string, exists bool)

Headers returns the value of the "headers" field in the mutation.

func (*OutboxMutation) ID

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

func (m *OutboxMutation) 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 (*OutboxMutation) Key

func (m *OutboxMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*OutboxMutation) LastRetry

func (m *OutboxMutation) LastRetry() (r time.Time, exists bool)

LastRetry returns the value of the "last_retry" field in the mutation.

func (*OutboxMutation) LastRetryCleared

func (m *OutboxMutation) LastRetryCleared() bool

LastRetryCleared returns if the "last_retry" field was cleared in this mutation.

func (*OutboxMutation) OldField

func (m *OutboxMutation) 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 (*OutboxMutation) OldHeaders

func (m *OutboxMutation) OldHeaders(ctx context.Context) (v map[string]string, err error)

OldHeaders returns the old "headers" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldKey

func (m *OutboxMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldLastRetry

func (m *OutboxMutation) OldLastRetry(ctx context.Context) (v time.Time, err error)

OldLastRetry returns the old "last_retry" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldPayload

func (m *OutboxMutation) OldPayload(ctx context.Context) (v []byte, err error)

OldPayload returns the old "payload" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldProcessingErrors

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

OldProcessingErrors returns the old "processing_errors" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldRetryCount

func (m *OutboxMutation) OldRetryCount(ctx context.Context) (v int, err error)

OldRetryCount returns the old "retry_count" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldStatus

func (m *OutboxMutation) OldStatus(ctx context.Context) (v outbox.Status, err error)

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

func (m *OutboxMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) OldTopic

func (m *OutboxMutation) OldTopic(ctx context.Context) (v string, err error)

OldTopic returns the old "topic" field's value of the Outbox entity. If the Outbox 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 (*OutboxMutation) Op

func (m *OutboxMutation) Op() Op

Op returns the operation name.

func (*OutboxMutation) Payload

func (m *OutboxMutation) Payload() (r []byte, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*OutboxMutation) ProcessingErrors

func (m *OutboxMutation) ProcessingErrors() (r []string, exists bool)

ProcessingErrors returns the value of the "processing_errors" field in the mutation.

func (*OutboxMutation) ProcessingErrorsCleared

func (m *OutboxMutation) ProcessingErrorsCleared() bool

ProcessingErrorsCleared returns if the "processing_errors" field was cleared in this mutation.

func (*OutboxMutation) QueryContext

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

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

func (*OutboxMutation) RemovedEdges

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

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

func (*OutboxMutation) RemovedIDs

func (m *OutboxMutation) 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 (*OutboxMutation) ResetEdge

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

func (m *OutboxMutation) 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 (*OutboxMutation) ResetHeaders

func (m *OutboxMutation) ResetHeaders()

ResetHeaders resets all changes to the "headers" field.

func (*OutboxMutation) ResetKey

func (m *OutboxMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*OutboxMutation) ResetLastRetry

func (m *OutboxMutation) ResetLastRetry()

ResetLastRetry resets all changes to the "last_retry" field.

func (*OutboxMutation) ResetPayload

func (m *OutboxMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*OutboxMutation) ResetProcessingErrors

func (m *OutboxMutation) ResetProcessingErrors()

ResetProcessingErrors resets all changes to the "processing_errors" field.

func (*OutboxMutation) ResetRetryCount

func (m *OutboxMutation) ResetRetryCount()

ResetRetryCount resets all changes to the "retry_count" field.

func (*OutboxMutation) ResetStatus

func (m *OutboxMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*OutboxMutation) ResetTimestamp

func (m *OutboxMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*OutboxMutation) ResetTopic

func (m *OutboxMutation) ResetTopic()

ResetTopic resets all changes to the "topic" field.

func (*OutboxMutation) RetryCount

func (m *OutboxMutation) RetryCount() (r int, exists bool)

RetryCount returns the value of the "retry_count" field in the mutation.

func (*OutboxMutation) SetField

func (m *OutboxMutation) 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 (*OutboxMutation) SetHeaders

func (m *OutboxMutation) SetHeaders(value map[string]string)

SetHeaders sets the "headers" field.

func (*OutboxMutation) SetKey

func (m *OutboxMutation) SetKey(s string)

SetKey sets the "key" field.

func (*OutboxMutation) SetLastRetry

func (m *OutboxMutation) SetLastRetry(t time.Time)

SetLastRetry sets the "last_retry" field.

func (*OutboxMutation) SetOp

func (m *OutboxMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OutboxMutation) SetPayload

func (m *OutboxMutation) SetPayload(b []byte)

SetPayload sets the "payload" field.

func (*OutboxMutation) SetProcessingErrors

func (m *OutboxMutation) SetProcessingErrors(s []string)

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxMutation) SetRetryCount

func (m *OutboxMutation) SetRetryCount(i int)

SetRetryCount sets the "retry_count" field.

func (*OutboxMutation) SetStatus

func (m *OutboxMutation) SetStatus(o outbox.Status)

SetStatus sets the "status" field.

func (*OutboxMutation) SetTimestamp

func (m *OutboxMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*OutboxMutation) SetTopic

func (m *OutboxMutation) SetTopic(s string)

SetTopic sets the "topic" field.

func (*OutboxMutation) Status

func (m *OutboxMutation) Status() (r outbox.Status, exists bool)

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

func (*OutboxMutation) Timestamp

func (m *OutboxMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*OutboxMutation) Topic

func (m *OutboxMutation) Topic() (r string, exists bool)

Topic returns the value of the "topic" field in the mutation.

func (OutboxMutation) Tx

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

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

func (*OutboxMutation) Type

func (m *OutboxMutation) Type() string

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

func (*OutboxMutation) Where

func (m *OutboxMutation) Where(ps ...predicate.Outbox)

Where appends a list predicates to the OutboxMutation builder.

func (*OutboxMutation) WhereP

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

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

type OutboxOrder

type OutboxOrder struct {
	Direction OrderDirection    `json:"direction"`
	Field     *OutboxOrderField `json:"field"`
}

OutboxOrder defines the ordering of Outbox.

type OutboxOrderField

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

OutboxOrderField defines the ordering field of Outbox.

type OutboxPaginateOption

type OutboxPaginateOption func(*outboxPager) error

OutboxPaginateOption enables pagination customization.

func WithOutboxFilter

func WithOutboxFilter(filter func(*OutboxQuery) (*OutboxQuery, error)) OutboxPaginateOption

WithOutboxFilter configures pagination filter.

func WithOutboxOrder

func WithOutboxOrder(order *OutboxOrder) OutboxPaginateOption

WithOutboxOrder configures pagination ordering.

type OutboxQuery

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

OutboxQuery is the builder for querying Outbox entities.

func (*OutboxQuery) Aggregate

func (oq *OutboxQuery) Aggregate(fns ...AggregateFunc) *OutboxSelect

Aggregate returns a OutboxSelect configured with the given aggregations.

func (*OutboxQuery) All

func (oq *OutboxQuery) All(ctx context.Context) ([]*Outbox, error)

All executes the query and returns a list of Outboxes.

func (*OutboxQuery) AllX

func (oq *OutboxQuery) AllX(ctx context.Context) []*Outbox

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

func (*OutboxQuery) Clone

func (oq *OutboxQuery) Clone() *OutboxQuery

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

func (*OutboxQuery) CollectFields

func (o *OutboxQuery) CollectFields(ctx context.Context, satisfies ...string) (*OutboxQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*OutboxQuery) Count

func (oq *OutboxQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OutboxQuery) CountX

func (oq *OutboxQuery) CountX(ctx context.Context) int

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

func (*OutboxQuery) ExecContext

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

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

func (*OutboxQuery) Exist

func (oq *OutboxQuery) Exist(ctx context.Context) (bool, error)

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

func (*OutboxQuery) ExistX

func (oq *OutboxQuery) ExistX(ctx context.Context) bool

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

func (*OutboxQuery) Filter

func (oq *OutboxQuery) Filter() *OutboxFilter

Filter returns a Filter implementation to apply filters on the OutboxQuery builder.

func (*OutboxQuery) First

func (oq *OutboxQuery) First(ctx context.Context) (*Outbox, error)

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

func (*OutboxQuery) FirstID

func (oq *OutboxQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OutboxQuery) FirstIDX

func (oq *OutboxQuery) FirstIDX(ctx context.Context) int

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

func (*OutboxQuery) FirstX

func (oq *OutboxQuery) FirstX(ctx context.Context) *Outbox

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

func (*OutboxQuery) ForShare

func (oq *OutboxQuery) ForShare(opts ...sql.LockOption) *OutboxQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*OutboxQuery) ForUpdate

func (oq *OutboxQuery) ForUpdate(opts ...sql.LockOption) *OutboxQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*OutboxQuery) GroupBy

func (oq *OutboxQuery) GroupBy(field string, fields ...string) *OutboxGroupBy

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 {
	Timestamp time.Time `json:"timestamp,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Outbox.Query().
	GroupBy(outbox.FieldTimestamp).
	Aggregate(entities.Count()).
	Scan(ctx, &v)

func (*OutboxQuery) IDs

func (oq *OutboxQuery) IDs(ctx context.Context) ([]int, error)

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

func (*OutboxQuery) IDsX

func (oq *OutboxQuery) IDsX(ctx context.Context) []int

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

func (*OutboxQuery) Limit

func (oq *OutboxQuery) Limit(limit int) *OutboxQuery

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

func (*OutboxQuery) Modify

func (oq *OutboxQuery) Modify(modifiers ...func(s *sql.Selector)) *OutboxSelect

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

func (*OutboxQuery) Offset

func (oq *OutboxQuery) Offset(offset int) *OutboxQuery

Offset to start from.

func (*OutboxQuery) Only

func (oq *OutboxQuery) Only(ctx context.Context) (*Outbox, error)

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

func (*OutboxQuery) OnlyID

func (oq *OutboxQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OutboxQuery) OnlyIDX

func (oq *OutboxQuery) OnlyIDX(ctx context.Context) int

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

func (*OutboxQuery) OnlyX

func (oq *OutboxQuery) OnlyX(ctx context.Context) *Outbox

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

func (*OutboxQuery) Order

func (oq *OutboxQuery) Order(o ...OrderFunc) *OutboxQuery

Order specifies how the records should be ordered.

func (*OutboxQuery) Paginate

func (o *OutboxQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...OutboxPaginateOption,
) (*OutboxConnection, error)

Paginate executes the query and returns a relay based cursor connection to Outbox.

func (*OutboxQuery) QueryContext

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

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

func (*OutboxQuery) Select

func (oq *OutboxQuery) Select(fields ...string) *OutboxSelect

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 {
	Timestamp time.Time `json:"timestamp,omitempty"`
}

client.Outbox.Query().
	Select(outbox.FieldTimestamp).
	Scan(ctx, &v)

func (*OutboxQuery) Unique

func (oq *OutboxQuery) Unique(unique bool) *OutboxQuery

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

func (oq *OutboxQuery) Where(ps ...predicate.Outbox) *OutboxQuery

Where adds a new predicate for the OutboxQuery builder.

type OutboxSelect

type OutboxSelect struct {
	*OutboxQuery
	// contains filtered or unexported fields
}

OutboxSelect is the builder for selecting fields of Outbox entities.

func (*OutboxSelect) Aggregate

func (os *OutboxSelect) Aggregate(fns ...AggregateFunc) *OutboxSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OutboxSelect) Bool

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

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

func (*OutboxSelect) BoolX

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

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

func (*OutboxSelect) Bools

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

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

func (*OutboxSelect) BoolsX

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

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

func (OutboxSelect) ExecContext

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

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

func (*OutboxSelect) Float64

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

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

func (*OutboxSelect) Float64X

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

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

func (*OutboxSelect) Float64s

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

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

func (*OutboxSelect) Float64sX

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

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

func (*OutboxSelect) Int

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

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

func (*OutboxSelect) IntX

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

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

func (*OutboxSelect) Ints

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

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

func (*OutboxSelect) IntsX

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

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

func (*OutboxSelect) Modify

func (os *OutboxSelect) Modify(modifiers ...func(s *sql.Selector)) *OutboxSelect

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

func (OutboxSelect) QueryContext

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

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

func (*OutboxSelect) Scan

func (os *OutboxSelect) Scan(ctx context.Context, v any) error

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

func (*OutboxSelect) ScanX

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

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

func (*OutboxSelect) String

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

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

func (*OutboxSelect) StringX

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

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

func (*OutboxSelect) Strings

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

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

func (*OutboxSelect) StringsX

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

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

type OutboxUpdate

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

OutboxUpdate is the builder for updating Outbox entities.

func (*OutboxUpdate) AddRetryCount

func (ou *OutboxUpdate) AddRetryCount(i int) *OutboxUpdate

AddRetryCount adds i to the "retry_count" field.

func (*OutboxUpdate) AppendProcessingErrors

func (ou *OutboxUpdate) AppendProcessingErrors(s []string) *OutboxUpdate

AppendProcessingErrors appends s to the "processing_errors" field.

func (*OutboxUpdate) ClearLastRetry

func (ou *OutboxUpdate) ClearLastRetry() *OutboxUpdate

ClearLastRetry clears the value of the "last_retry" field.

func (*OutboxUpdate) ClearProcessingErrors

func (ou *OutboxUpdate) ClearProcessingErrors() *OutboxUpdate

ClearProcessingErrors clears the value of the "processing_errors" field.

func (*OutboxUpdate) Exec

func (ou *OutboxUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OutboxUpdate) ExecContext

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

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

func (*OutboxUpdate) ExecX

func (ou *OutboxUpdate) ExecX(ctx context.Context)

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

func (*OutboxUpdate) Modify

func (ou *OutboxUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OutboxUpdate

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

func (*OutboxUpdate) Mutation

func (ou *OutboxUpdate) Mutation() *OutboxMutation

Mutation returns the OutboxMutation object of the builder.

func (*OutboxUpdate) QueryContext

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

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

func (*OutboxUpdate) Save

func (ou *OutboxUpdate) Save(ctx context.Context) (int, error)

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

func (*OutboxUpdate) SaveX

func (ou *OutboxUpdate) SaveX(ctx context.Context) int

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

func (*OutboxUpdate) SetHeaders

func (ou *OutboxUpdate) SetHeaders(m map[string]string) *OutboxUpdate

SetHeaders sets the "headers" field.

func (*OutboxUpdate) SetKey

func (ou *OutboxUpdate) SetKey(s string) *OutboxUpdate

SetKey sets the "key" field.

func (*OutboxUpdate) SetLastRetry

func (ou *OutboxUpdate) SetLastRetry(t time.Time) *OutboxUpdate

SetLastRetry sets the "last_retry" field.

func (*OutboxUpdate) SetNillableLastRetry

func (ou *OutboxUpdate) SetNillableLastRetry(t *time.Time) *OutboxUpdate

SetNillableLastRetry sets the "last_retry" field if the given value is not nil.

func (*OutboxUpdate) SetPayload

func (ou *OutboxUpdate) SetPayload(b []byte) *OutboxUpdate

SetPayload sets the "payload" field.

func (*OutboxUpdate) SetProcessingErrors

func (ou *OutboxUpdate) SetProcessingErrors(s []string) *OutboxUpdate

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxUpdate) SetRetryCount

func (ou *OutboxUpdate) SetRetryCount(i int) *OutboxUpdate

SetRetryCount sets the "retry_count" field.

func (*OutboxUpdate) SetStatus

func (ou *OutboxUpdate) SetStatus(o outbox.Status) *OutboxUpdate

SetStatus sets the "status" field.

func (*OutboxUpdate) SetTimestamp

func (ou *OutboxUpdate) SetTimestamp(t time.Time) *OutboxUpdate

SetTimestamp sets the "timestamp" field.

func (*OutboxUpdate) SetTopic

func (ou *OutboxUpdate) SetTopic(s string) *OutboxUpdate

SetTopic sets the "topic" field.

func (*OutboxUpdate) Where

func (ou *OutboxUpdate) Where(ps ...predicate.Outbox) *OutboxUpdate

Where appends a list predicates to the OutboxUpdate builder.

type OutboxUpdateOne

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

OutboxUpdateOne is the builder for updating a single Outbox entity.

func (*OutboxUpdateOne) AddRetryCount

func (ouo *OutboxUpdateOne) AddRetryCount(i int) *OutboxUpdateOne

AddRetryCount adds i to the "retry_count" field.

func (*OutboxUpdateOne) AppendProcessingErrors

func (ouo *OutboxUpdateOne) AppendProcessingErrors(s []string) *OutboxUpdateOne

AppendProcessingErrors appends s to the "processing_errors" field.

func (*OutboxUpdateOne) ClearLastRetry

func (ouo *OutboxUpdateOne) ClearLastRetry() *OutboxUpdateOne

ClearLastRetry clears the value of the "last_retry" field.

func (*OutboxUpdateOne) ClearProcessingErrors

func (ouo *OutboxUpdateOne) ClearProcessingErrors() *OutboxUpdateOne

ClearProcessingErrors clears the value of the "processing_errors" field.

func (*OutboxUpdateOne) Exec

func (ouo *OutboxUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OutboxUpdateOne) ExecContext

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

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

func (*OutboxUpdateOne) ExecX

func (ouo *OutboxUpdateOne) ExecX(ctx context.Context)

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

func (*OutboxUpdateOne) Modify

func (ouo *OutboxUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OutboxUpdateOne

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

func (*OutboxUpdateOne) Mutation

func (ouo *OutboxUpdateOne) Mutation() *OutboxMutation

Mutation returns the OutboxMutation object of the builder.

func (*OutboxUpdateOne) QueryContext

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

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

func (*OutboxUpdateOne) Save

func (ouo *OutboxUpdateOne) Save(ctx context.Context) (*Outbox, error)

Save executes the query and returns the updated Outbox entity.

func (*OutboxUpdateOne) SaveX

func (ouo *OutboxUpdateOne) SaveX(ctx context.Context) *Outbox

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

func (*OutboxUpdateOne) Select

func (ouo *OutboxUpdateOne) Select(field string, fields ...string) *OutboxUpdateOne

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

func (*OutboxUpdateOne) SetHeaders

func (ouo *OutboxUpdateOne) SetHeaders(m map[string]string) *OutboxUpdateOne

SetHeaders sets the "headers" field.

func (*OutboxUpdateOne) SetKey

func (ouo *OutboxUpdateOne) SetKey(s string) *OutboxUpdateOne

SetKey sets the "key" field.

func (*OutboxUpdateOne) SetLastRetry

func (ouo *OutboxUpdateOne) SetLastRetry(t time.Time) *OutboxUpdateOne

SetLastRetry sets the "last_retry" field.

func (*OutboxUpdateOne) SetNillableLastRetry

func (ouo *OutboxUpdateOne) SetNillableLastRetry(t *time.Time) *OutboxUpdateOne

SetNillableLastRetry sets the "last_retry" field if the given value is not nil.

func (*OutboxUpdateOne) SetPayload

func (ouo *OutboxUpdateOne) SetPayload(b []byte) *OutboxUpdateOne

SetPayload sets the "payload" field.

func (*OutboxUpdateOne) SetProcessingErrors

func (ouo *OutboxUpdateOne) SetProcessingErrors(s []string) *OutboxUpdateOne

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxUpdateOne) SetRetryCount

func (ouo *OutboxUpdateOne) SetRetryCount(i int) *OutboxUpdateOne

SetRetryCount sets the "retry_count" field.

func (*OutboxUpdateOne) SetStatus

func (ouo *OutboxUpdateOne) SetStatus(o outbox.Status) *OutboxUpdateOne

SetStatus sets the "status" field.

func (*OutboxUpdateOne) SetTimestamp

func (ouo *OutboxUpdateOne) SetTimestamp(t time.Time) *OutboxUpdateOne

SetTimestamp sets the "timestamp" field.

func (*OutboxUpdateOne) SetTopic

func (ouo *OutboxUpdateOne) SetTopic(s string) *OutboxUpdateOne

SetTopic sets the "topic" field.

type OutboxUpsert

type OutboxUpsert struct {
	*sql.UpdateSet
}

OutboxUpsert is the "OnConflict" setter.

func (*OutboxUpsert) AddRetryCount

func (u *OutboxUpsert) AddRetryCount(v int) *OutboxUpsert

AddRetryCount adds v to the "retry_count" field.

func (*OutboxUpsert) ClearLastRetry

func (u *OutboxUpsert) ClearLastRetry() *OutboxUpsert

ClearLastRetry clears the value of the "last_retry" field.

func (*OutboxUpsert) ClearProcessingErrors

func (u *OutboxUpsert) ClearProcessingErrors() *OutboxUpsert

ClearProcessingErrors clears the value of the "processing_errors" field.

func (*OutboxUpsert) SetHeaders

func (u *OutboxUpsert) SetHeaders(v map[string]string) *OutboxUpsert

SetHeaders sets the "headers" field.

func (*OutboxUpsert) SetKey

func (u *OutboxUpsert) SetKey(v string) *OutboxUpsert

SetKey sets the "key" field.

func (*OutboxUpsert) SetLastRetry

func (u *OutboxUpsert) SetLastRetry(v time.Time) *OutboxUpsert

SetLastRetry sets the "last_retry" field.

func (*OutboxUpsert) SetPayload

func (u *OutboxUpsert) SetPayload(v []byte) *OutboxUpsert

SetPayload sets the "payload" field.

func (*OutboxUpsert) SetProcessingErrors

func (u *OutboxUpsert) SetProcessingErrors(v []string) *OutboxUpsert

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxUpsert) SetRetryCount

func (u *OutboxUpsert) SetRetryCount(v int) *OutboxUpsert

SetRetryCount sets the "retry_count" field.

func (*OutboxUpsert) SetStatus

func (u *OutboxUpsert) SetStatus(v outbox.Status) *OutboxUpsert

SetStatus sets the "status" field.

func (*OutboxUpsert) SetTimestamp

func (u *OutboxUpsert) SetTimestamp(v time.Time) *OutboxUpsert

SetTimestamp sets the "timestamp" field.

func (*OutboxUpsert) SetTopic

func (u *OutboxUpsert) SetTopic(v string) *OutboxUpsert

SetTopic sets the "topic" field.

func (*OutboxUpsert) UpdateHeaders

func (u *OutboxUpsert) UpdateHeaders() *OutboxUpsert

UpdateHeaders sets the "headers" field to the value that was provided on create.

func (*OutboxUpsert) UpdateKey

func (u *OutboxUpsert) UpdateKey() *OutboxUpsert

UpdateKey sets the "key" field to the value that was provided on create.

func (*OutboxUpsert) UpdateLastRetry

func (u *OutboxUpsert) UpdateLastRetry() *OutboxUpsert

UpdateLastRetry sets the "last_retry" field to the value that was provided on create.

func (*OutboxUpsert) UpdatePayload

func (u *OutboxUpsert) UpdatePayload() *OutboxUpsert

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*OutboxUpsert) UpdateProcessingErrors

func (u *OutboxUpsert) UpdateProcessingErrors() *OutboxUpsert

UpdateProcessingErrors sets the "processing_errors" field to the value that was provided on create.

func (*OutboxUpsert) UpdateRetryCount

func (u *OutboxUpsert) UpdateRetryCount() *OutboxUpsert

UpdateRetryCount sets the "retry_count" field to the value that was provided on create.

func (*OutboxUpsert) UpdateStatus

func (u *OutboxUpsert) UpdateStatus() *OutboxUpsert

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

func (*OutboxUpsert) UpdateTimestamp

func (u *OutboxUpsert) UpdateTimestamp() *OutboxUpsert

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

func (*OutboxUpsert) UpdateTopic

func (u *OutboxUpsert) UpdateTopic() *OutboxUpsert

UpdateTopic sets the "topic" field to the value that was provided on create.

type OutboxUpsertBulk

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

OutboxUpsertBulk is the builder for "upsert"-ing a bulk of Outbox nodes.

func (*OutboxUpsertBulk) AddRetryCount

func (u *OutboxUpsertBulk) AddRetryCount(v int) *OutboxUpsertBulk

AddRetryCount adds v to the "retry_count" field.

func (*OutboxUpsertBulk) ClearLastRetry

func (u *OutboxUpsertBulk) ClearLastRetry() *OutboxUpsertBulk

ClearLastRetry clears the value of the "last_retry" field.

func (*OutboxUpsertBulk) ClearProcessingErrors

func (u *OutboxUpsertBulk) ClearProcessingErrors() *OutboxUpsertBulk

ClearProcessingErrors clears the value of the "processing_errors" field.

func (*OutboxUpsertBulk) DoNothing

func (u *OutboxUpsertBulk) DoNothing() *OutboxUpsertBulk

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

func (*OutboxUpsertBulk) Exec

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

Exec executes the query.

func (*OutboxUpsertBulk) ExecX

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

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

func (*OutboxUpsertBulk) Ignore

func (u *OutboxUpsertBulk) Ignore() *OutboxUpsertBulk

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

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

func (*OutboxUpsertBulk) SetHeaders

func (u *OutboxUpsertBulk) SetHeaders(v map[string]string) *OutboxUpsertBulk

SetHeaders sets the "headers" field.

func (*OutboxUpsertBulk) SetKey

SetKey sets the "key" field.

func (*OutboxUpsertBulk) SetLastRetry

func (u *OutboxUpsertBulk) SetLastRetry(v time.Time) *OutboxUpsertBulk

SetLastRetry sets the "last_retry" field.

func (*OutboxUpsertBulk) SetPayload

func (u *OutboxUpsertBulk) SetPayload(v []byte) *OutboxUpsertBulk

SetPayload sets the "payload" field.

func (*OutboxUpsertBulk) SetProcessingErrors

func (u *OutboxUpsertBulk) SetProcessingErrors(v []string) *OutboxUpsertBulk

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxUpsertBulk) SetRetryCount

func (u *OutboxUpsertBulk) SetRetryCount(v int) *OutboxUpsertBulk

SetRetryCount sets the "retry_count" field.

func (*OutboxUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*OutboxUpsertBulk) SetTimestamp

func (u *OutboxUpsertBulk) SetTimestamp(v time.Time) *OutboxUpsertBulk

SetTimestamp sets the "timestamp" field.

func (*OutboxUpsertBulk) SetTopic

func (u *OutboxUpsertBulk) SetTopic(v string) *OutboxUpsertBulk

SetTopic sets the "topic" field.

func (*OutboxUpsertBulk) Update

func (u *OutboxUpsertBulk) Update(set func(*OutboxUpsert)) *OutboxUpsertBulk

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

func (*OutboxUpsertBulk) UpdateHeaders

func (u *OutboxUpsertBulk) UpdateHeaders() *OutboxUpsertBulk

UpdateHeaders sets the "headers" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateKey

func (u *OutboxUpsertBulk) UpdateKey() *OutboxUpsertBulk

UpdateKey sets the "key" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateLastRetry

func (u *OutboxUpsertBulk) UpdateLastRetry() *OutboxUpsertBulk

UpdateLastRetry sets the "last_retry" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateNewValues

func (u *OutboxUpsertBulk) UpdateNewValues() *OutboxUpsertBulk

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

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

func (*OutboxUpsertBulk) UpdatePayload

func (u *OutboxUpsertBulk) UpdatePayload() *OutboxUpsertBulk

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateProcessingErrors

func (u *OutboxUpsertBulk) UpdateProcessingErrors() *OutboxUpsertBulk

UpdateProcessingErrors sets the "processing_errors" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateRetryCount

func (u *OutboxUpsertBulk) UpdateRetryCount() *OutboxUpsertBulk

UpdateRetryCount sets the "retry_count" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateStatus

func (u *OutboxUpsertBulk) UpdateStatus() *OutboxUpsertBulk

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

func (*OutboxUpsertBulk) UpdateTimestamp

func (u *OutboxUpsertBulk) UpdateTimestamp() *OutboxUpsertBulk

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

func (*OutboxUpsertBulk) UpdateTopic

func (u *OutboxUpsertBulk) UpdateTopic() *OutboxUpsertBulk

UpdateTopic sets the "topic" field to the value that was provided on create.

type OutboxUpsertOne

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

OutboxUpsertOne is the builder for "upsert"-ing

one Outbox node.

func (*OutboxUpsertOne) AddRetryCount

func (u *OutboxUpsertOne) AddRetryCount(v int) *OutboxUpsertOne

AddRetryCount adds v to the "retry_count" field.

func (*OutboxUpsertOne) ClearLastRetry

func (u *OutboxUpsertOne) ClearLastRetry() *OutboxUpsertOne

ClearLastRetry clears the value of the "last_retry" field.

func (*OutboxUpsertOne) ClearProcessingErrors

func (u *OutboxUpsertOne) ClearProcessingErrors() *OutboxUpsertOne

ClearProcessingErrors clears the value of the "processing_errors" field.

func (*OutboxUpsertOne) DoNothing

func (u *OutboxUpsertOne) DoNothing() *OutboxUpsertOne

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

func (*OutboxUpsertOne) Exec

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

Exec executes the query.

func (*OutboxUpsertOne) ExecX

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

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

func (*OutboxUpsertOne) ID

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

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

func (*OutboxUpsertOne) IDX

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

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

func (*OutboxUpsertOne) Ignore

func (u *OutboxUpsertOne) Ignore() *OutboxUpsertOne

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

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

func (*OutboxUpsertOne) SetHeaders

func (u *OutboxUpsertOne) SetHeaders(v map[string]string) *OutboxUpsertOne

SetHeaders sets the "headers" field.

func (*OutboxUpsertOne) SetKey

func (u *OutboxUpsertOne) SetKey(v string) *OutboxUpsertOne

SetKey sets the "key" field.

func (*OutboxUpsertOne) SetLastRetry

func (u *OutboxUpsertOne) SetLastRetry(v time.Time) *OutboxUpsertOne

SetLastRetry sets the "last_retry" field.

func (*OutboxUpsertOne) SetPayload

func (u *OutboxUpsertOne) SetPayload(v []byte) *OutboxUpsertOne

SetPayload sets the "payload" field.

func (*OutboxUpsertOne) SetProcessingErrors

func (u *OutboxUpsertOne) SetProcessingErrors(v []string) *OutboxUpsertOne

SetProcessingErrors sets the "processing_errors" field.

func (*OutboxUpsertOne) SetRetryCount

func (u *OutboxUpsertOne) SetRetryCount(v int) *OutboxUpsertOne

SetRetryCount sets the "retry_count" field.

func (*OutboxUpsertOne) SetStatus

func (u *OutboxUpsertOne) SetStatus(v outbox.Status) *OutboxUpsertOne

SetStatus sets the "status" field.

func (*OutboxUpsertOne) SetTimestamp

func (u *OutboxUpsertOne) SetTimestamp(v time.Time) *OutboxUpsertOne

SetTimestamp sets the "timestamp" field.

func (*OutboxUpsertOne) SetTopic

func (u *OutboxUpsertOne) SetTopic(v string) *OutboxUpsertOne

SetTopic sets the "topic" field.

func (*OutboxUpsertOne) Update

func (u *OutboxUpsertOne) Update(set func(*OutboxUpsert)) *OutboxUpsertOne

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

func (*OutboxUpsertOne) UpdateHeaders

func (u *OutboxUpsertOne) UpdateHeaders() *OutboxUpsertOne

UpdateHeaders sets the "headers" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateKey

func (u *OutboxUpsertOne) UpdateKey() *OutboxUpsertOne

UpdateKey sets the "key" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateLastRetry

func (u *OutboxUpsertOne) UpdateLastRetry() *OutboxUpsertOne

UpdateLastRetry sets the "last_retry" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateNewValues

func (u *OutboxUpsertOne) UpdateNewValues() *OutboxUpsertOne

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

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

func (*OutboxUpsertOne) UpdatePayload

func (u *OutboxUpsertOne) UpdatePayload() *OutboxUpsertOne

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateProcessingErrors

func (u *OutboxUpsertOne) UpdateProcessingErrors() *OutboxUpsertOne

UpdateProcessingErrors sets the "processing_errors" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateRetryCount

func (u *OutboxUpsertOne) UpdateRetryCount() *OutboxUpsertOne

UpdateRetryCount sets the "retry_count" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateStatus

func (u *OutboxUpsertOne) UpdateStatus() *OutboxUpsertOne

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

func (*OutboxUpsertOne) UpdateTimestamp

func (u *OutboxUpsertOne) UpdateTimestamp() *OutboxUpsertOne

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

func (*OutboxUpsertOne) UpdateTopic

func (u *OutboxUpsertOne) UpdateTopic() *OutboxUpsertOne

UpdateTopic sets the "topic" field to the value that was provided on create.

type OutboxWhereInput

type OutboxWhereInput struct {
	Predicates []predicate.Outbox  `json:"-"`
	Not        *OutboxWhereInput   `json:"not,omitempty"`
	Or         []*OutboxWhereInput `json:"or,omitempty"`
	And        []*OutboxWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "timestamp" field predicates.
	Timestamp      *time.Time  `json:"timestamp,omitempty"`
	TimestampNEQ   *time.Time  `json:"timestampNEQ,omitempty"`
	TimestampIn    []time.Time `json:"timestampIn,omitempty"`
	TimestampNotIn []time.Time `json:"timestampNotIn,omitempty"`
	TimestampGT    *time.Time  `json:"timestampGT,omitempty"`
	TimestampGTE   *time.Time  `json:"timestampGTE,omitempty"`
	TimestampLT    *time.Time  `json:"timestampLT,omitempty"`
	TimestampLTE   *time.Time  `json:"timestampLTE,omitempty"`

	// "topic" field predicates.
	Topic             *string  `json:"topic,omitempty"`
	TopicNEQ          *string  `json:"topicNEQ,omitempty"`
	TopicIn           []string `json:"topicIn,omitempty"`
	TopicNotIn        []string `json:"topicNotIn,omitempty"`
	TopicGT           *string  `json:"topicGT,omitempty"`
	TopicGTE          *string  `json:"topicGTE,omitempty"`
	TopicLT           *string  `json:"topicLT,omitempty"`
	TopicLTE          *string  `json:"topicLTE,omitempty"`
	TopicContains     *string  `json:"topicContains,omitempty"`
	TopicHasPrefix    *string  `json:"topicHasPrefix,omitempty"`
	TopicHasSuffix    *string  `json:"topicHasSuffix,omitempty"`
	TopicEqualFold    *string  `json:"topicEqualFold,omitempty"`
	TopicContainsFold *string  `json:"topicContainsFold,omitempty"`

	// "key" field predicates.
	Key             *string  `json:"key,omitempty"`
	KeyNEQ          *string  `json:"keyNEQ,omitempty"`
	KeyIn           []string `json:"keyIn,omitempty"`
	KeyNotIn        []string `json:"keyNotIn,omitempty"`
	KeyGT           *string  `json:"keyGT,omitempty"`
	KeyGTE          *string  `json:"keyGTE,omitempty"`
	KeyLT           *string  `json:"keyLT,omitempty"`
	KeyLTE          *string  `json:"keyLTE,omitempty"`
	KeyContains     *string  `json:"keyContains,omitempty"`
	KeyHasPrefix    *string  `json:"keyHasPrefix,omitempty"`
	KeyHasSuffix    *string  `json:"keyHasSuffix,omitempty"`
	KeyEqualFold    *string  `json:"keyEqualFold,omitempty"`
	KeyContainsFold *string  `json:"keyContainsFold,omitempty"`

	// "retry_count" field predicates.
	RetryCount      *int  `json:"retryCount,omitempty"`
	RetryCountNEQ   *int  `json:"retryCountNEQ,omitempty"`
	RetryCountIn    []int `json:"retryCountIn,omitempty"`
	RetryCountNotIn []int `json:"retryCountNotIn,omitempty"`
	RetryCountGT    *int  `json:"retryCountGT,omitempty"`
	RetryCountGTE   *int  `json:"retryCountGTE,omitempty"`
	RetryCountLT    *int  `json:"retryCountLT,omitempty"`
	RetryCountLTE   *int  `json:"retryCountLTE,omitempty"`

	// "status" field predicates.
	Status      *outbox.Status  `json:"status,omitempty"`
	StatusNEQ   *outbox.Status  `json:"statusNEQ,omitempty"`
	StatusIn    []outbox.Status `json:"statusIn,omitempty"`
	StatusNotIn []outbox.Status `json:"statusNotIn,omitempty"`

	// "last_retry" field predicates.
	LastRetry       *time.Time  `json:"lastRetry,omitempty"`
	LastRetryNEQ    *time.Time  `json:"lastRetryNEQ,omitempty"`
	LastRetryIn     []time.Time `json:"lastRetryIn,omitempty"`
	LastRetryNotIn  []time.Time `json:"lastRetryNotIn,omitempty"`
	LastRetryGT     *time.Time  `json:"lastRetryGT,omitempty"`
	LastRetryGTE    *time.Time  `json:"lastRetryGTE,omitempty"`
	LastRetryLT     *time.Time  `json:"lastRetryLT,omitempty"`
	LastRetryLTE    *time.Time  `json:"lastRetryLTE,omitempty"`
	LastRetryIsNil  bool        `json:"lastRetryIsNil,omitempty"`
	LastRetryNotNil bool        `json:"lastRetryNotNil,omitempty"`
}

OutboxWhereInput represents a where input for filtering Outbox queries.

func (*OutboxWhereInput) AddPredicates

func (i *OutboxWhereInput) AddPredicates(predicates ...predicate.Outbox)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*OutboxWhereInput) Filter

func (i *OutboxWhereInput) Filter(q *OutboxQuery) (*OutboxQuery, error)

Filter applies the OutboxWhereInput filter on the OutboxQuery builder.

func (*OutboxWhereInput) P

P returns a predicate for filtering outboxes. An error is returned if the input is empty or invalid.

type Outboxes

type Outboxes []*Outbox

Outboxes is a parsable slice of Outbox.

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type SchemaConfig

type SchemaConfig = internal.SchemaConfig

SchemaConfig represents alternative schema names for all tables that can be passed at runtime.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// Outbox is the client for interacting with the Outbox builders.
	Outbox *OutboxClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

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

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

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

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

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) QueryContext

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

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

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis
Package mock_entities is a generated GoMock package.
Package mock_entities is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL