ent

package
v0.0.0-...-0e865a5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 22 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.
	TypeBanner  = "Banner"
	TypeFeature = "Feature"
	TypeTag     = "Tag"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Banner struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Content holds the value of the "content" field.
	Content map[string]interface{} `json:"content,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BannerQuery when eager-loading is set.
	Edges BannerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Banner is the model entity for the Banner schema.

func (*Banner) QueryFeature

func (b *Banner) QueryFeature() *FeatureQuery

QueryFeature queries the "feature" edge of the Banner entity.

func (*Banner) QueryTags

func (b *Banner) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Banner entity.

func (*Banner) String

func (b *Banner) String() string

String implements the fmt.Stringer.

func (*Banner) Unwrap

func (b *Banner) Unwrap() *Banner

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

func (b *Banner) Update() *BannerUpdateOne

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

func (*Banner) Value

func (b *Banner) Value(name string) (ent.Value, error)

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

type BannerClient

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

BannerClient is a client for the Banner schema.

func NewBannerClient

func NewBannerClient(c config) *BannerClient

NewBannerClient returns a client for the Banner from the given config.

func (*BannerClient) Create

func (c *BannerClient) Create() *BannerCreate

Create returns a builder for creating a Banner entity.

func (*BannerClient) CreateBulk

func (c *BannerClient) CreateBulk(builders ...*BannerCreate) *BannerCreateBulk

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

func (*BannerClient) Delete

func (c *BannerClient) Delete() *BannerDelete

Delete returns a delete builder for Banner.

func (*BannerClient) DeleteOne

func (c *BannerClient) DeleteOne(b *Banner) *BannerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BannerClient) DeleteOneID

func (c *BannerClient) DeleteOneID(id int) *BannerDeleteOne

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

func (*BannerClient) Get

func (c *BannerClient) Get(ctx context.Context, id int) (*Banner, error)

Get returns a Banner entity by its id.

func (*BannerClient) GetX

func (c *BannerClient) GetX(ctx context.Context, id int) *Banner

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

func (*BannerClient) Hooks

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

Hooks returns the client hooks.

func (*BannerClient) Intercept

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

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

func (*BannerClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BannerClient) MapCreateBulk

func (c *BannerClient) MapCreateBulk(slice any, setFunc func(*BannerCreate, int)) *BannerCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*BannerClient) Query

func (c *BannerClient) Query() *BannerQuery

Query returns a query builder for Banner.

func (*BannerClient) QueryFeature

func (c *BannerClient) QueryFeature(b *Banner) *FeatureQuery

QueryFeature queries the feature edge of a Banner.

func (*BannerClient) QueryTags

func (c *BannerClient) QueryTags(b *Banner) *TagQuery

QueryTags queries the tags edge of a Banner.

func (*BannerClient) Update

func (c *BannerClient) Update() *BannerUpdate

Update returns an update builder for Banner.

func (*BannerClient) UpdateOne

func (c *BannerClient) UpdateOne(b *Banner) *BannerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BannerClient) UpdateOneID

func (c *BannerClient) UpdateOneID(id int) *BannerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BannerClient) Use

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

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

type BannerCreate

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

BannerCreate is the builder for creating a Banner entity.

func (*BannerCreate) AddFeature

func (bc *BannerCreate) AddFeature(f ...*Feature) *BannerCreate

AddFeature adds the "feature" edges to the Feature entity.

func (*BannerCreate) AddFeatureIDs

func (bc *BannerCreate) AddFeatureIDs(ids ...int) *BannerCreate

AddFeatureIDs adds the "feature" edge to the Feature entity by IDs.

func (*BannerCreate) AddTagIDs

func (bc *BannerCreate) AddTagIDs(ids ...int) *BannerCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*BannerCreate) AddTags

func (bc *BannerCreate) AddTags(t ...*Tag) *BannerCreate

AddTags adds the "tags" edges to the Tag entity.

func (*BannerCreate) Exec

func (bc *BannerCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BannerCreate) ExecX

func (bc *BannerCreate) ExecX(ctx context.Context)

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

func (*BannerCreate) Mutation

func (bc *BannerCreate) Mutation() *BannerMutation

Mutation returns the BannerMutation object of the builder.

func (*BannerCreate) Save

func (bc *BannerCreate) Save(ctx context.Context) (*Banner, error)

Save creates the Banner in the database.

func (*BannerCreate) SaveX

func (bc *BannerCreate) SaveX(ctx context.Context) *Banner

SaveX calls Save and panics if Save returns an error.

func (*BannerCreate) SetContent

func (bc *BannerCreate) SetContent(m map[string]interface{}) *BannerCreate

SetContent sets the "content" field.

func (*BannerCreate) SetCreatedAt

func (bc *BannerCreate) SetCreatedAt(t time.Time) *BannerCreate

SetCreatedAt sets the "created_at" field.

func (*BannerCreate) SetIsActive

func (bc *BannerCreate) SetIsActive(b bool) *BannerCreate

SetIsActive sets the "is_active" field.

func (*BannerCreate) SetNillableCreatedAt

func (bc *BannerCreate) SetNillableCreatedAt(t *time.Time) *BannerCreate

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

func (*BannerCreate) SetNillableIsActive

func (bc *BannerCreate) SetNillableIsActive(b *bool) *BannerCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*BannerCreate) SetNillableUpdatedAt

func (bc *BannerCreate) SetNillableUpdatedAt(t *time.Time) *BannerCreate

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

func (*BannerCreate) SetUpdatedAt

func (bc *BannerCreate) SetUpdatedAt(t time.Time) *BannerCreate

SetUpdatedAt sets the "updated_at" field.

type BannerCreateBulk

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

BannerCreateBulk is the builder for creating many Banner entities in bulk.

func (*BannerCreateBulk) Exec

func (bcb *BannerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BannerCreateBulk) ExecX

func (bcb *BannerCreateBulk) ExecX(ctx context.Context)

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

func (*BannerCreateBulk) Save

func (bcb *BannerCreateBulk) Save(ctx context.Context) ([]*Banner, error)

Save creates the Banner entities in the database.

func (*BannerCreateBulk) SaveX

func (bcb *BannerCreateBulk) SaveX(ctx context.Context) []*Banner

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

type BannerDelete

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

BannerDelete is the builder for deleting a Banner entity.

func (*BannerDelete) Exec

func (bd *BannerDelete) Exec(ctx context.Context) (int, error)

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

func (*BannerDelete) ExecX

func (bd *BannerDelete) ExecX(ctx context.Context) int

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

func (*BannerDelete) Where

func (bd *BannerDelete) Where(ps ...predicate.Banner) *BannerDelete

Where appends a list predicates to the BannerDelete builder.

type BannerDeleteOne

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

BannerDeleteOne is the builder for deleting a single Banner entity.

func (*BannerDeleteOne) Exec

func (bdo *BannerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BannerDeleteOne) ExecX

func (bdo *BannerDeleteOne) ExecX(ctx context.Context)

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

func (*BannerDeleteOne) Where

func (bdo *BannerDeleteOne) Where(ps ...predicate.Banner) *BannerDeleteOne

Where appends a list predicates to the BannerDelete builder.

type BannerEdges

type BannerEdges struct {
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// Feature holds the value of the feature edge.
	Feature []*Feature `json:"feature,omitempty"`
	// contains filtered or unexported fields
}

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

func (BannerEdges) FeatureOrErr

func (e BannerEdges) FeatureOrErr() ([]*Feature, error)

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

func (BannerEdges) TagsOrErr

func (e BannerEdges) TagsOrErr() ([]*Tag, error)

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

type BannerGroupBy

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

BannerGroupBy is the group-by builder for Banner entities.

func (*BannerGroupBy) Aggregate

func (bgb *BannerGroupBy) Aggregate(fns ...AggregateFunc) *BannerGroupBy

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

func (*BannerGroupBy) Bool

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

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

func (*BannerGroupBy) BoolX

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

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

func (*BannerGroupBy) Bools

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

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

func (*BannerGroupBy) BoolsX

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

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

func (*BannerGroupBy) Float64

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

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

func (*BannerGroupBy) Float64X

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

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

func (*BannerGroupBy) Float64s

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

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

func (*BannerGroupBy) Float64sX

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

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

func (*BannerGroupBy) Int

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

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

func (*BannerGroupBy) IntX

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

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

func (*BannerGroupBy) Ints

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

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

func (*BannerGroupBy) IntsX

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

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

func (*BannerGroupBy) Scan

func (bgb *BannerGroupBy) Scan(ctx context.Context, v any) error

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

func (*BannerGroupBy) ScanX

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

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

func (*BannerGroupBy) String

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

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

func (*BannerGroupBy) StringX

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

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

func (*BannerGroupBy) Strings

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

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

func (*BannerGroupBy) StringsX

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

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

type BannerMutation

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

BannerMutation represents an operation that mutates the Banner nodes in the graph.

func (*BannerMutation) AddFeatureIDs

func (m *BannerMutation) AddFeatureIDs(ids ...int)

AddFeatureIDs adds the "feature" edge to the Feature entity by ids.

func (*BannerMutation) AddField

func (m *BannerMutation) 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 (*BannerMutation) AddTagIDs

func (m *BannerMutation) AddTagIDs(ids ...int)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*BannerMutation) AddedEdges

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

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

func (*BannerMutation) AddedField

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

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

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

func (*BannerMutation) AddedIDs

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

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

func (*BannerMutation) ClearEdge

func (m *BannerMutation) 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 (*BannerMutation) ClearFeature

func (m *BannerMutation) ClearFeature()

ClearFeature clears the "feature" edge to the Feature entity.

func (*BannerMutation) ClearField

func (m *BannerMutation) 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 (*BannerMutation) ClearTags

func (m *BannerMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*BannerMutation) ClearedEdges

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

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

func (*BannerMutation) ClearedFields

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

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

func (BannerMutation) Client

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

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

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

func (*BannerMutation) CreatedAt

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

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

func (*BannerMutation) EdgeCleared

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

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

func (*BannerMutation) FeatureCleared

func (m *BannerMutation) FeatureCleared() bool

FeatureCleared reports if the "feature" edge to the Feature entity was cleared.

func (*BannerMutation) FeatureIDs

func (m *BannerMutation) FeatureIDs() (ids []int)

FeatureIDs returns the "feature" edge IDs in the mutation.

func (*BannerMutation) Field

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

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

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

func (*BannerMutation) Fields

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

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

func (m *BannerMutation) 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 (*BannerMutation) IsActive

func (m *BannerMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*BannerMutation) OldContent

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

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

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

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

func (m *BannerMutation) 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 (*BannerMutation) OldIsActive

func (m *BannerMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the Banner entity. If the Banner 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 (*BannerMutation) OldUpdatedAt

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

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

func (m *BannerMutation) Op() Op

Op returns the operation name.

func (*BannerMutation) RemoveFeatureIDs

func (m *BannerMutation) RemoveFeatureIDs(ids ...int)

RemoveFeatureIDs removes the "feature" edge to the Feature entity by IDs.

func (*BannerMutation) RemoveTagIDs

func (m *BannerMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*BannerMutation) RemovedEdges

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

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

func (*BannerMutation) RemovedFeatureIDs

func (m *BannerMutation) RemovedFeatureIDs() (ids []int)

RemovedFeature returns the removed IDs of the "feature" edge to the Feature entity.

func (*BannerMutation) RemovedIDs

func (m *BannerMutation) 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 (*BannerMutation) RemovedTagsIDs

func (m *BannerMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*BannerMutation) ResetContent

func (m *BannerMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*BannerMutation) ResetCreatedAt

func (m *BannerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BannerMutation) ResetEdge

func (m *BannerMutation) 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 (*BannerMutation) ResetFeature

func (m *BannerMutation) ResetFeature()

ResetFeature resets all changes to the "feature" edge.

func (*BannerMutation) ResetField

func (m *BannerMutation) 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 (*BannerMutation) ResetIsActive

func (m *BannerMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*BannerMutation) ResetTags

func (m *BannerMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*BannerMutation) ResetUpdatedAt

func (m *BannerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BannerMutation) SetContent

func (m *BannerMutation) SetContent(value map[string]interface{})

SetContent sets the "content" field.

func (*BannerMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BannerMutation) SetField

func (m *BannerMutation) 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 (*BannerMutation) SetIsActive

func (m *BannerMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*BannerMutation) SetOp

func (m *BannerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BannerMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BannerMutation) TagsCleared

func (m *BannerMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*BannerMutation) TagsIDs

func (m *BannerMutation) TagsIDs() (ids []int)

TagsIDs returns the "tags" edge IDs in the mutation.

func (BannerMutation) Tx

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

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

func (*BannerMutation) Type

func (m *BannerMutation) Type() string

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

func (*BannerMutation) UpdatedAt

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

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

func (*BannerMutation) Where

func (m *BannerMutation) Where(ps ...predicate.Banner)

Where appends a list predicates to the BannerMutation builder.

func (*BannerMutation) WhereP

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

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

type BannerQuery

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

BannerQuery is the builder for querying Banner entities.

func (*BannerQuery) Aggregate

func (bq *BannerQuery) Aggregate(fns ...AggregateFunc) *BannerSelect

Aggregate returns a BannerSelect configured with the given aggregations.

func (*BannerQuery) All

func (bq *BannerQuery) All(ctx context.Context) ([]*Banner, error)

All executes the query and returns a list of Banners.

func (*BannerQuery) AllX

func (bq *BannerQuery) AllX(ctx context.Context) []*Banner

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

func (*BannerQuery) Clone

func (bq *BannerQuery) Clone() *BannerQuery

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

func (*BannerQuery) Count

func (bq *BannerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BannerQuery) CountX

func (bq *BannerQuery) CountX(ctx context.Context) int

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

func (*BannerQuery) Exist

func (bq *BannerQuery) Exist(ctx context.Context) (bool, error)

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

func (*BannerQuery) ExistX

func (bq *BannerQuery) ExistX(ctx context.Context) bool

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

func (*BannerQuery) First

func (bq *BannerQuery) First(ctx context.Context) (*Banner, error)

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

func (*BannerQuery) FirstID

func (bq *BannerQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BannerQuery) FirstIDX

func (bq *BannerQuery) FirstIDX(ctx context.Context) int

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

func (*BannerQuery) FirstX

func (bq *BannerQuery) FirstX(ctx context.Context) *Banner

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

func (*BannerQuery) GroupBy

func (bq *BannerQuery) GroupBy(field string, fields ...string) *BannerGroupBy

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 {
	Content map[string]interface {} `json:"content,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Banner.Query().
	GroupBy(banner.FieldContent).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BannerQuery) IDs

func (bq *BannerQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*BannerQuery) IDsX

func (bq *BannerQuery) IDsX(ctx context.Context) []int

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

func (*BannerQuery) Limit

func (bq *BannerQuery) Limit(limit int) *BannerQuery

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

func (*BannerQuery) Offset

func (bq *BannerQuery) Offset(offset int) *BannerQuery

Offset to start from.

func (*BannerQuery) Only

func (bq *BannerQuery) Only(ctx context.Context) (*Banner, error)

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

func (*BannerQuery) OnlyID

func (bq *BannerQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BannerQuery) OnlyIDX

func (bq *BannerQuery) OnlyIDX(ctx context.Context) int

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

func (*BannerQuery) OnlyX

func (bq *BannerQuery) OnlyX(ctx context.Context) *Banner

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

func (*BannerQuery) Order

func (bq *BannerQuery) Order(o ...banner.OrderOption) *BannerQuery

Order specifies how the records should be ordered.

func (*BannerQuery) QueryFeature

func (bq *BannerQuery) QueryFeature() *FeatureQuery

QueryFeature chains the current query on the "feature" edge.

func (*BannerQuery) QueryTags

func (bq *BannerQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*BannerQuery) Select

func (bq *BannerQuery) Select(fields ...string) *BannerSelect

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 {
	Content map[string]interface {} `json:"content,omitempty"`
}

client.Banner.Query().
	Select(banner.FieldContent).
	Scan(ctx, &v)

func (*BannerQuery) Unique

func (bq *BannerQuery) Unique(unique bool) *BannerQuery

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

func (bq *BannerQuery) Where(ps ...predicate.Banner) *BannerQuery

Where adds a new predicate for the BannerQuery builder.

func (*BannerQuery) WithFeature

func (bq *BannerQuery) WithFeature(opts ...func(*FeatureQuery)) *BannerQuery

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

func (*BannerQuery) WithTags

func (bq *BannerQuery) WithTags(opts ...func(*TagQuery)) *BannerQuery

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

type BannerSelect

type BannerSelect struct {
	*BannerQuery
	// contains filtered or unexported fields
}

BannerSelect is the builder for selecting fields of Banner entities.

func (*BannerSelect) Aggregate

func (bs *BannerSelect) Aggregate(fns ...AggregateFunc) *BannerSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BannerSelect) Bool

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

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

func (*BannerSelect) BoolX

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

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

func (*BannerSelect) Bools

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

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

func (*BannerSelect) BoolsX

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

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

func (*BannerSelect) Float64

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

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

func (*BannerSelect) Float64X

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

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

func (*BannerSelect) Float64s

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

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

func (*BannerSelect) Float64sX

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

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

func (*BannerSelect) Int

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

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

func (*BannerSelect) IntX

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

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

func (*BannerSelect) Ints

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

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

func (*BannerSelect) IntsX

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

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

func (*BannerSelect) Scan

func (bs *BannerSelect) Scan(ctx context.Context, v any) error

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

func (*BannerSelect) ScanX

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

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

func (*BannerSelect) String

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

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

func (*BannerSelect) StringX

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

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

func (*BannerSelect) Strings

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

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

func (*BannerSelect) StringsX

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

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

type BannerUpdate

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

BannerUpdate is the builder for updating Banner entities.

func (*BannerUpdate) AddFeature

func (bu *BannerUpdate) AddFeature(f ...*Feature) *BannerUpdate

AddFeature adds the "feature" edges to the Feature entity.

func (*BannerUpdate) AddFeatureIDs

func (bu *BannerUpdate) AddFeatureIDs(ids ...int) *BannerUpdate

AddFeatureIDs adds the "feature" edge to the Feature entity by IDs.

func (*BannerUpdate) AddTagIDs

func (bu *BannerUpdate) AddTagIDs(ids ...int) *BannerUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*BannerUpdate) AddTags

func (bu *BannerUpdate) AddTags(t ...*Tag) *BannerUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*BannerUpdate) ClearFeature

func (bu *BannerUpdate) ClearFeature() *BannerUpdate

ClearFeature clears all "feature" edges to the Feature entity.

func (*BannerUpdate) ClearTags

func (bu *BannerUpdate) ClearTags() *BannerUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*BannerUpdate) Exec

func (bu *BannerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BannerUpdate) ExecX

func (bu *BannerUpdate) ExecX(ctx context.Context)

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

func (*BannerUpdate) Mutation

func (bu *BannerUpdate) Mutation() *BannerMutation

Mutation returns the BannerMutation object of the builder.

func (*BannerUpdate) RemoveFeature

func (bu *BannerUpdate) RemoveFeature(f ...*Feature) *BannerUpdate

RemoveFeature removes "feature" edges to Feature entities.

func (*BannerUpdate) RemoveFeatureIDs

func (bu *BannerUpdate) RemoveFeatureIDs(ids ...int) *BannerUpdate

RemoveFeatureIDs removes the "feature" edge to Feature entities by IDs.

func (*BannerUpdate) RemoveTagIDs

func (bu *BannerUpdate) RemoveTagIDs(ids ...int) *BannerUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*BannerUpdate) RemoveTags

func (bu *BannerUpdate) RemoveTags(t ...*Tag) *BannerUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*BannerUpdate) Save

func (bu *BannerUpdate) Save(ctx context.Context) (int, error)

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

func (*BannerUpdate) SaveX

func (bu *BannerUpdate) SaveX(ctx context.Context) int

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

func (*BannerUpdate) SetContent

func (bu *BannerUpdate) SetContent(m map[string]interface{}) *BannerUpdate

SetContent sets the "content" field.

func (*BannerUpdate) SetIsActive

func (bu *BannerUpdate) SetIsActive(b bool) *BannerUpdate

SetIsActive sets the "is_active" field.

func (*BannerUpdate) SetNillableIsActive

func (bu *BannerUpdate) SetNillableIsActive(b *bool) *BannerUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*BannerUpdate) SetNillableUpdatedAt

func (bu *BannerUpdate) SetNillableUpdatedAt(t *time.Time) *BannerUpdate

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

func (*BannerUpdate) SetUpdatedAt

func (bu *BannerUpdate) SetUpdatedAt(t time.Time) *BannerUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BannerUpdate) Where

func (bu *BannerUpdate) Where(ps ...predicate.Banner) *BannerUpdate

Where appends a list predicates to the BannerUpdate builder.

type BannerUpdateOne

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

BannerUpdateOne is the builder for updating a single Banner entity.

func (*BannerUpdateOne) AddFeature

func (buo *BannerUpdateOne) AddFeature(f ...*Feature) *BannerUpdateOne

AddFeature adds the "feature" edges to the Feature entity.

func (*BannerUpdateOne) AddFeatureIDs

func (buo *BannerUpdateOne) AddFeatureIDs(ids ...int) *BannerUpdateOne

AddFeatureIDs adds the "feature" edge to the Feature entity by IDs.

func (*BannerUpdateOne) AddTagIDs

func (buo *BannerUpdateOne) AddTagIDs(ids ...int) *BannerUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*BannerUpdateOne) AddTags

func (buo *BannerUpdateOne) AddTags(t ...*Tag) *BannerUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*BannerUpdateOne) ClearFeature

func (buo *BannerUpdateOne) ClearFeature() *BannerUpdateOne

ClearFeature clears all "feature" edges to the Feature entity.

func (*BannerUpdateOne) ClearTags

func (buo *BannerUpdateOne) ClearTags() *BannerUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*BannerUpdateOne) Exec

func (buo *BannerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BannerUpdateOne) ExecX

func (buo *BannerUpdateOne) ExecX(ctx context.Context)

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

func (*BannerUpdateOne) Mutation

func (buo *BannerUpdateOne) Mutation() *BannerMutation

Mutation returns the BannerMutation object of the builder.

func (*BannerUpdateOne) RemoveFeature

func (buo *BannerUpdateOne) RemoveFeature(f ...*Feature) *BannerUpdateOne

RemoveFeature removes "feature" edges to Feature entities.

func (*BannerUpdateOne) RemoveFeatureIDs

func (buo *BannerUpdateOne) RemoveFeatureIDs(ids ...int) *BannerUpdateOne

RemoveFeatureIDs removes the "feature" edge to Feature entities by IDs.

func (*BannerUpdateOne) RemoveTagIDs

func (buo *BannerUpdateOne) RemoveTagIDs(ids ...int) *BannerUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*BannerUpdateOne) RemoveTags

func (buo *BannerUpdateOne) RemoveTags(t ...*Tag) *BannerUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*BannerUpdateOne) Save

func (buo *BannerUpdateOne) Save(ctx context.Context) (*Banner, error)

Save executes the query and returns the updated Banner entity.

func (*BannerUpdateOne) SaveX

func (buo *BannerUpdateOne) SaveX(ctx context.Context) *Banner

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

func (*BannerUpdateOne) Select

func (buo *BannerUpdateOne) Select(field string, fields ...string) *BannerUpdateOne

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

func (*BannerUpdateOne) SetContent

func (buo *BannerUpdateOne) SetContent(m map[string]interface{}) *BannerUpdateOne

SetContent sets the "content" field.

func (*BannerUpdateOne) SetIsActive

func (buo *BannerUpdateOne) SetIsActive(b bool) *BannerUpdateOne

SetIsActive sets the "is_active" field.

func (*BannerUpdateOne) SetNillableIsActive

func (buo *BannerUpdateOne) SetNillableIsActive(b *bool) *BannerUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*BannerUpdateOne) SetNillableUpdatedAt

func (buo *BannerUpdateOne) SetNillableUpdatedAt(t *time.Time) *BannerUpdateOne

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

func (*BannerUpdateOne) SetUpdatedAt

func (buo *BannerUpdateOne) SetUpdatedAt(t time.Time) *BannerUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BannerUpdateOne) Where

func (buo *BannerUpdateOne) Where(ps ...predicate.Banner) *BannerUpdateOne

Where appends a list predicates to the BannerUpdate builder.

type Banners

type Banners []*Banner

Banners is a parsable slice of Banner.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Banner is the client for interacting with the Banner builders.
	Banner *BannerClient
	// Feature is the client for interacting with the Feature builders.
	Feature *FeatureClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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().
	Banner.
	Query().
	Count(ctx)

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) 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 Feature

type Feature struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// FeatureName holds the value of the "feature_name" field.
	FeatureName string `json:"feature_name,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FeatureQuery when eager-loading is set.
	Edges FeatureEdges `json:"edges"`
	// contains filtered or unexported fields
}

Feature is the model entity for the Feature schema.

func (*Feature) QueryBanners

func (f *Feature) QueryBanners() *BannerQuery

QueryBanners queries the "banners" edge of the Feature entity.

func (*Feature) String

func (f *Feature) String() string

String implements the fmt.Stringer.

func (*Feature) Unwrap

func (f *Feature) Unwrap() *Feature

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

func (f *Feature) Update() *FeatureUpdateOne

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

func (*Feature) Value

func (f *Feature) Value(name string) (ent.Value, error)

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

type FeatureClient

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

FeatureClient is a client for the Feature schema.

func NewFeatureClient

func NewFeatureClient(c config) *FeatureClient

NewFeatureClient returns a client for the Feature from the given config.

func (*FeatureClient) Create

func (c *FeatureClient) Create() *FeatureCreate

Create returns a builder for creating a Feature entity.

func (*FeatureClient) CreateBulk

func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk

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

func (*FeatureClient) Delete

func (c *FeatureClient) Delete() *FeatureDelete

Delete returns a delete builder for Feature.

func (*FeatureClient) DeleteOne

func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FeatureClient) DeleteOneID

func (c *FeatureClient) DeleteOneID(id int) *FeatureDeleteOne

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

func (*FeatureClient) Get

func (c *FeatureClient) Get(ctx context.Context, id int) (*Feature, error)

Get returns a Feature entity by its id.

func (*FeatureClient) GetX

func (c *FeatureClient) GetX(ctx context.Context, id int) *Feature

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

func (*FeatureClient) Hooks

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

Hooks returns the client hooks.

func (*FeatureClient) Intercept

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

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

func (*FeatureClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FeatureClient) MapCreateBulk

func (c *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FeatureClient) Query

func (c *FeatureClient) Query() *FeatureQuery

Query returns a query builder for Feature.

func (*FeatureClient) QueryBanners

func (c *FeatureClient) QueryBanners(f *Feature) *BannerQuery

QueryBanners queries the banners edge of a Feature.

func (*FeatureClient) Update

func (c *FeatureClient) Update() *FeatureUpdate

Update returns an update builder for Feature.

func (*FeatureClient) UpdateOne

func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FeatureClient) UpdateOneID

func (c *FeatureClient) UpdateOneID(id int) *FeatureUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FeatureClient) Use

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

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

type FeatureCreate

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

FeatureCreate is the builder for creating a Feature entity.

func (*FeatureCreate) AddBannerIDs

func (fc *FeatureCreate) AddBannerIDs(ids ...int) *FeatureCreate

AddBannerIDs adds the "banners" edge to the Banner entity by IDs.

func (*FeatureCreate) AddBanners

func (fc *FeatureCreate) AddBanners(b ...*Banner) *FeatureCreate

AddBanners adds the "banners" edges to the Banner entity.

func (*FeatureCreate) Exec

func (fc *FeatureCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureCreate) ExecX

func (fc *FeatureCreate) ExecX(ctx context.Context)

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

func (*FeatureCreate) Mutation

func (fc *FeatureCreate) Mutation() *FeatureMutation

Mutation returns the FeatureMutation object of the builder.

func (*FeatureCreate) Save

func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error)

Save creates the Feature in the database.

func (*FeatureCreate) SaveX

func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature

SaveX calls Save and panics if Save returns an error.

func (*FeatureCreate) SetCreatedAt

func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate

SetCreatedAt sets the "created_at" field.

func (*FeatureCreate) SetFeatureName

func (fc *FeatureCreate) SetFeatureName(s string) *FeatureCreate

SetFeatureName sets the "feature_name" field.

func (*FeatureCreate) SetNillableCreatedAt

func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate

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

func (*FeatureCreate) SetNillableUpdatedAt

func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate

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

func (*FeatureCreate) SetUpdatedAt

func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate

SetUpdatedAt sets the "updated_at" field.

type FeatureCreateBulk

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

FeatureCreateBulk is the builder for creating many Feature entities in bulk.

func (*FeatureCreateBulk) Exec

func (fcb *FeatureCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureCreateBulk) ExecX

func (fcb *FeatureCreateBulk) ExecX(ctx context.Context)

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

func (*FeatureCreateBulk) Save

func (fcb *FeatureCreateBulk) Save(ctx context.Context) ([]*Feature, error)

Save creates the Feature entities in the database.

func (*FeatureCreateBulk) SaveX

func (fcb *FeatureCreateBulk) SaveX(ctx context.Context) []*Feature

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

type FeatureDelete

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

FeatureDelete is the builder for deleting a Feature entity.

func (*FeatureDelete) Exec

func (fd *FeatureDelete) Exec(ctx context.Context) (int, error)

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

func (*FeatureDelete) ExecX

func (fd *FeatureDelete) ExecX(ctx context.Context) int

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

func (*FeatureDelete) Where

func (fd *FeatureDelete) Where(ps ...predicate.Feature) *FeatureDelete

Where appends a list predicates to the FeatureDelete builder.

type FeatureDeleteOne

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

FeatureDeleteOne is the builder for deleting a single Feature entity.

func (*FeatureDeleteOne) Exec

func (fdo *FeatureDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FeatureDeleteOne) ExecX

func (fdo *FeatureDeleteOne) ExecX(ctx context.Context)

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

func (*FeatureDeleteOne) Where

Where appends a list predicates to the FeatureDelete builder.

type FeatureEdges

type FeatureEdges struct {
	// Banners holds the value of the banners edge.
	Banners []*Banner `json:"banners,omitempty"`
	// contains filtered or unexported fields
}

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

func (FeatureEdges) BannersOrErr

func (e FeatureEdges) BannersOrErr() ([]*Banner, error)

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

type FeatureGroupBy

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

FeatureGroupBy is the group-by builder for Feature entities.

func (*FeatureGroupBy) Aggregate

func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy

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

func (*FeatureGroupBy) Bool

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

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

func (*FeatureGroupBy) BoolX

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

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

func (*FeatureGroupBy) Bools

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

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

func (*FeatureGroupBy) BoolsX

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

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

func (*FeatureGroupBy) Float64

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

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

func (*FeatureGroupBy) Float64X

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

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

func (*FeatureGroupBy) Float64s

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

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

func (*FeatureGroupBy) Float64sX

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

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

func (*FeatureGroupBy) Int

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

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

func (*FeatureGroupBy) IntX

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

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

func (*FeatureGroupBy) Ints

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

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

func (*FeatureGroupBy) IntsX

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

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

func (*FeatureGroupBy) Scan

func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error

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

func (*FeatureGroupBy) ScanX

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

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

func (*FeatureGroupBy) String

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

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

func (*FeatureGroupBy) StringX

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

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

func (*FeatureGroupBy) Strings

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

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

func (*FeatureGroupBy) StringsX

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

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

type FeatureMutation

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

FeatureMutation represents an operation that mutates the Feature nodes in the graph.

func (*FeatureMutation) AddBannerIDs

func (m *FeatureMutation) AddBannerIDs(ids ...int)

AddBannerIDs adds the "banners" edge to the Banner entity by ids.

func (*FeatureMutation) AddField

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

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

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

func (*FeatureMutation) AddedField

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

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

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

func (*FeatureMutation) AddedIDs

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

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

func (*FeatureMutation) BannersCleared

func (m *FeatureMutation) BannersCleared() bool

BannersCleared reports if the "banners" edge to the Banner entity was cleared.

func (*FeatureMutation) BannersIDs

func (m *FeatureMutation) BannersIDs() (ids []int)

BannersIDs returns the "banners" edge IDs in the mutation.

func (*FeatureMutation) ClearBanners

func (m *FeatureMutation) ClearBanners()

ClearBanners clears the "banners" edge to the Banner entity.

func (*FeatureMutation) ClearEdge

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

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

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

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

func (*FeatureMutation) ClearedFields

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

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

func (FeatureMutation) Client

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

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

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

func (*FeatureMutation) EdgeCleared

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

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

func (*FeatureMutation) FeatureName

func (m *FeatureMutation) FeatureName() (r string, exists bool)

FeatureName returns the value of the "feature_name" field in the mutation.

func (*FeatureMutation) Field

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

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

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

func (*FeatureMutation) Fields

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

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

func (m *FeatureMutation) 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 (*FeatureMutation) OldCreatedAt

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

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

func (m *FeatureMutation) OldFeatureName(ctx context.Context) (v string, err error)

OldFeatureName returns the old "feature_name" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldField

func (m *FeatureMutation) 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 (*FeatureMutation) OldUpdatedAt

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

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

func (m *FeatureMutation) Op() Op

Op returns the operation name.

func (*FeatureMutation) RemoveBannerIDs

func (m *FeatureMutation) RemoveBannerIDs(ids ...int)

RemoveBannerIDs removes the "banners" edge to the Banner entity by IDs.

func (*FeatureMutation) RemovedBannersIDs

func (m *FeatureMutation) RemovedBannersIDs() (ids []int)

RemovedBanners returns the removed IDs of the "banners" edge to the Banner entity.

func (*FeatureMutation) RemovedEdges

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

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

func (*FeatureMutation) RemovedIDs

func (m *FeatureMutation) 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 (*FeatureMutation) ResetBanners

func (m *FeatureMutation) ResetBanners()

ResetBanners resets all changes to the "banners" edge.

func (*FeatureMutation) ResetCreatedAt

func (m *FeatureMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FeatureMutation) ResetEdge

func (m *FeatureMutation) 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 (*FeatureMutation) ResetFeatureName

func (m *FeatureMutation) ResetFeatureName()

ResetFeatureName resets all changes to the "feature_name" field.

func (*FeatureMutation) ResetField

func (m *FeatureMutation) 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 (*FeatureMutation) ResetUpdatedAt

func (m *FeatureMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FeatureMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeatureMutation) SetFeatureName

func (m *FeatureMutation) SetFeatureName(s string)

SetFeatureName sets the "feature_name" field.

func (*FeatureMutation) SetField

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

func (m *FeatureMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FeatureMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (FeatureMutation) Tx

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

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

func (*FeatureMutation) Type

func (m *FeatureMutation) Type() string

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

func (*FeatureMutation) UpdatedAt

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

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

func (*FeatureMutation) Where

func (m *FeatureMutation) Where(ps ...predicate.Feature)

Where appends a list predicates to the FeatureMutation builder.

func (*FeatureMutation) WhereP

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

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

type FeatureQuery

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

FeatureQuery is the builder for querying Feature entities.

func (*FeatureQuery) Aggregate

func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect

Aggregate returns a FeatureSelect configured with the given aggregations.

func (*FeatureQuery) All

func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error)

All executes the query and returns a list of Features.

func (*FeatureQuery) AllX

func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature

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

func (*FeatureQuery) Clone

func (fq *FeatureQuery) Clone() *FeatureQuery

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

func (*FeatureQuery) Count

func (fq *FeatureQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FeatureQuery) CountX

func (fq *FeatureQuery) CountX(ctx context.Context) int

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

func (*FeatureQuery) Exist

func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error)

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

func (*FeatureQuery) ExistX

func (fq *FeatureQuery) ExistX(ctx context.Context) bool

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

func (*FeatureQuery) First

func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error)

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

func (*FeatureQuery) FirstID

func (fq *FeatureQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FeatureQuery) FirstIDX

func (fq *FeatureQuery) FirstIDX(ctx context.Context) int

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

func (*FeatureQuery) FirstX

func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature

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

func (*FeatureQuery) GroupBy

func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy

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

client.Feature.Query().
	GroupBy(feature.FieldFeatureName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FeatureQuery) IDs

func (fq *FeatureQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*FeatureQuery) IDsX

func (fq *FeatureQuery) IDsX(ctx context.Context) []int

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

func (*FeatureQuery) Limit

func (fq *FeatureQuery) Limit(limit int) *FeatureQuery

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

func (*FeatureQuery) Offset

func (fq *FeatureQuery) Offset(offset int) *FeatureQuery

Offset to start from.

func (*FeatureQuery) Only

func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error)

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

func (*FeatureQuery) OnlyID

func (fq *FeatureQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FeatureQuery) OnlyIDX

func (fq *FeatureQuery) OnlyIDX(ctx context.Context) int

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

func (*FeatureQuery) OnlyX

func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature

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

func (*FeatureQuery) Order

func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery

Order specifies how the records should be ordered.

func (*FeatureQuery) QueryBanners

func (fq *FeatureQuery) QueryBanners() *BannerQuery

QueryBanners chains the current query on the "banners" edge.

func (*FeatureQuery) Select

func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect

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

client.Feature.Query().
	Select(feature.FieldFeatureName).
	Scan(ctx, &v)

func (*FeatureQuery) Unique

func (fq *FeatureQuery) Unique(unique bool) *FeatureQuery

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

func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery

Where adds a new predicate for the FeatureQuery builder.

func (*FeatureQuery) WithBanners

func (fq *FeatureQuery) WithBanners(opts ...func(*BannerQuery)) *FeatureQuery

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

type FeatureSelect

type FeatureSelect struct {
	*FeatureQuery
	// contains filtered or unexported fields
}

FeatureSelect is the builder for selecting fields of Feature entities.

func (*FeatureSelect) Aggregate

func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FeatureSelect) Bool

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

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

func (*FeatureSelect) BoolX

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

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

func (*FeatureSelect) Bools

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

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

func (*FeatureSelect) BoolsX

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

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

func (*FeatureSelect) Float64

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

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

func (*FeatureSelect) Float64X

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

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

func (*FeatureSelect) Float64s

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

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

func (*FeatureSelect) Float64sX

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

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

func (*FeatureSelect) Int

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

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

func (*FeatureSelect) IntX

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

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

func (*FeatureSelect) Ints

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

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

func (*FeatureSelect) IntsX

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

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

func (*FeatureSelect) Scan

func (fs *FeatureSelect) Scan(ctx context.Context, v any) error

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

func (*FeatureSelect) ScanX

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

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

func (*FeatureSelect) String

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

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

func (*FeatureSelect) StringX

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

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

func (*FeatureSelect) Strings

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

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

func (*FeatureSelect) StringsX

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

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

type FeatureUpdate

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

FeatureUpdate is the builder for updating Feature entities.

func (*FeatureUpdate) AddBannerIDs

func (fu *FeatureUpdate) AddBannerIDs(ids ...int) *FeatureUpdate

AddBannerIDs adds the "banners" edge to the Banner entity by IDs.

func (*FeatureUpdate) AddBanners

func (fu *FeatureUpdate) AddBanners(b ...*Banner) *FeatureUpdate

AddBanners adds the "banners" edges to the Banner entity.

func (*FeatureUpdate) ClearBanners

func (fu *FeatureUpdate) ClearBanners() *FeatureUpdate

ClearBanners clears all "banners" edges to the Banner entity.

func (*FeatureUpdate) Exec

func (fu *FeatureUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureUpdate) ExecX

func (fu *FeatureUpdate) ExecX(ctx context.Context)

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

func (*FeatureUpdate) Mutation

func (fu *FeatureUpdate) Mutation() *FeatureMutation

Mutation returns the FeatureMutation object of the builder.

func (*FeatureUpdate) RemoveBannerIDs

func (fu *FeatureUpdate) RemoveBannerIDs(ids ...int) *FeatureUpdate

RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.

func (*FeatureUpdate) RemoveBanners

func (fu *FeatureUpdate) RemoveBanners(b ...*Banner) *FeatureUpdate

RemoveBanners removes "banners" edges to Banner entities.

func (*FeatureUpdate) Save

func (fu *FeatureUpdate) Save(ctx context.Context) (int, error)

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

func (*FeatureUpdate) SaveX

func (fu *FeatureUpdate) SaveX(ctx context.Context) int

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

func (*FeatureUpdate) SetFeatureName

func (fu *FeatureUpdate) SetFeatureName(s string) *FeatureUpdate

SetFeatureName sets the "feature_name" field.

func (*FeatureUpdate) SetNillableFeatureName

func (fu *FeatureUpdate) SetNillableFeatureName(s *string) *FeatureUpdate

SetNillableFeatureName sets the "feature_name" field if the given value is not nil.

func (*FeatureUpdate) SetNillableUpdatedAt

func (fu *FeatureUpdate) SetNillableUpdatedAt(t *time.Time) *FeatureUpdate

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

func (*FeatureUpdate) SetUpdatedAt

func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpdate) Where

func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate

Where appends a list predicates to the FeatureUpdate builder.

type FeatureUpdateOne

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

FeatureUpdateOne is the builder for updating a single Feature entity.

func (*FeatureUpdateOne) AddBannerIDs

func (fuo *FeatureUpdateOne) AddBannerIDs(ids ...int) *FeatureUpdateOne

AddBannerIDs adds the "banners" edge to the Banner entity by IDs.

func (*FeatureUpdateOne) AddBanners

func (fuo *FeatureUpdateOne) AddBanners(b ...*Banner) *FeatureUpdateOne

AddBanners adds the "banners" edges to the Banner entity.

func (*FeatureUpdateOne) ClearBanners

func (fuo *FeatureUpdateOne) ClearBanners() *FeatureUpdateOne

ClearBanners clears all "banners" edges to the Banner entity.

func (*FeatureUpdateOne) Exec

func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FeatureUpdateOne) ExecX

func (fuo *FeatureUpdateOne) ExecX(ctx context.Context)

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

func (*FeatureUpdateOne) Mutation

func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation

Mutation returns the FeatureMutation object of the builder.

func (*FeatureUpdateOne) RemoveBannerIDs

func (fuo *FeatureUpdateOne) RemoveBannerIDs(ids ...int) *FeatureUpdateOne

RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.

func (*FeatureUpdateOne) RemoveBanners

func (fuo *FeatureUpdateOne) RemoveBanners(b ...*Banner) *FeatureUpdateOne

RemoveBanners removes "banners" edges to Banner entities.

func (*FeatureUpdateOne) Save

func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error)

Save executes the query and returns the updated Feature entity.

func (*FeatureUpdateOne) SaveX

func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature

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

func (*FeatureUpdateOne) Select

func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne

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

func (*FeatureUpdateOne) SetFeatureName

func (fuo *FeatureUpdateOne) SetFeatureName(s string) *FeatureUpdateOne

SetFeatureName sets the "feature_name" field.

func (*FeatureUpdateOne) SetNillableFeatureName

func (fuo *FeatureUpdateOne) SetNillableFeatureName(s *string) *FeatureUpdateOne

SetNillableFeatureName sets the "feature_name" field if the given value is not nil.

func (*FeatureUpdateOne) SetNillableUpdatedAt

func (fuo *FeatureUpdateOne) SetNillableUpdatedAt(t *time.Time) *FeatureUpdateOne

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

func (*FeatureUpdateOne) SetUpdatedAt

func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpdateOne) Where

Where appends a list predicates to the FeatureUpdate builder.

type Features

type Features []*Feature

Features is a parsable slice of Feature.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type 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 Tag

type Tag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TagName holds the value of the "tag_name" field.
	TagName string `json:"tag_name,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryBanners

func (t *Tag) QueryBanners() *BannerQuery

QueryBanners queries the "banners" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

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

func (t *Tag) Update() *TagUpdateOne

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

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

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

type TagClient

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

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

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

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int) *TagDeleteOne

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

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

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

func (*TagClient) Hooks

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

Hooks returns the client hooks.

func (*TagClient) Intercept

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

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

func (*TagClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryBanners

func (c *TagClient) QueryBanners(t *Tag) *BannerQuery

QueryBanners queries the banners edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

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

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

type TagCreate

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

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddBannerIDs

func (tc *TagCreate) AddBannerIDs(ids ...int) *TagCreate

AddBannerIDs adds the "banners" edge to the Banner entity by IDs.

func (*TagCreate) AddBanners

func (tc *TagCreate) AddBanners(b ...*Banner) *TagCreate

AddBanners adds the "banners" edges to the Banner entity.

func (*TagCreate) Exec

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

Exec executes the query.

func (*TagCreate) ExecX

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

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

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TagCreate) SetNillableCreatedAt

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

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

func (*TagCreate) SetNillableUpdatedAt

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

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

func (*TagCreate) SetTagName

func (tc *TagCreate) SetTagName(s string) *TagCreate

SetTagName sets the "tag_name" field.

func (*TagCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type TagCreateBulk

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

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

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

Exec executes the query.

func (*TagCreateBulk) ExecX

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

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

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

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

type TagDelete

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

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

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

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

func (*TagDelete) ExecX

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

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

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

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

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

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

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

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

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

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Banners holds the value of the banners edge.
	Banners []*Banner `json:"banners,omitempty"`
	// contains filtered or unexported fields
}

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

func (TagEdges) BannersOrErr

func (e TagEdges) BannersOrErr() ([]*Banner, error)

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

type TagGroupBy

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

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

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

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

func (*TagGroupBy) Bool

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

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

func (*TagGroupBy) BoolX

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

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

func (*TagGroupBy) Bools

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

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

func (*TagGroupBy) BoolsX

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

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

func (*TagGroupBy) Float64

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

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

func (*TagGroupBy) Float64X

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

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

func (*TagGroupBy) Float64s

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

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

func (*TagGroupBy) Float64sX

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

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

func (*TagGroupBy) Int

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

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

func (*TagGroupBy) IntX

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

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

func (*TagGroupBy) Ints

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

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

func (*TagGroupBy) IntsX

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

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

func (*TagGroupBy) Scan

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

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

func (*TagGroupBy) ScanX

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

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

func (*TagGroupBy) String

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

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

func (*TagGroupBy) StringX

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

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

func (*TagGroupBy) Strings

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

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

func (*TagGroupBy) StringsX

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

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

type TagMutation

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

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddBannerIDs

func (m *TagMutation) AddBannerIDs(ids ...int)

AddBannerIDs adds the "banners" edge to the Banner entity by ids.

func (*TagMutation) AddField

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

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

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

func (*TagMutation) AddedField

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

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

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

func (*TagMutation) AddedIDs

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

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

func (*TagMutation) BannersCleared

func (m *TagMutation) BannersCleared() bool

BannersCleared reports if the "banners" edge to the Banner entity was cleared.

func (*TagMutation) BannersIDs

func (m *TagMutation) BannersIDs() (ids []int)

BannersIDs returns the "banners" edge IDs in the mutation.

func (*TagMutation) ClearBanners

func (m *TagMutation) ClearBanners()

ClearBanners clears the "banners" edge to the Banner entity.

func (*TagMutation) ClearEdge

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

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

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

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

func (*TagMutation) ClearedFields

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

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

func (TagMutation) Client

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

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

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

func (*TagMutation) EdgeCleared

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

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

func (*TagMutation) Field

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

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

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

func (*TagMutation) Fields

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

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

func (m *TagMutation) 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 (*TagMutation) OldCreatedAt

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

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

func (m *TagMutation) 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 (*TagMutation) OldTagName

func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)

OldTagName returns the old "tag_name" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldUpdatedAt

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

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

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) RemoveBannerIDs

func (m *TagMutation) RemoveBannerIDs(ids ...int)

RemoveBannerIDs removes the "banners" edge to the Banner entity by IDs.

func (*TagMutation) RemovedBannersIDs

func (m *TagMutation) RemovedBannersIDs() (ids []int)

RemovedBanners returns the removed IDs of the "banners" edge to the Banner entity.

func (*TagMutation) RemovedEdges

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

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

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) ResetBanners

func (m *TagMutation) ResetBanners()

ResetBanners resets all changes to the "banners" edge.

func (*TagMutation) ResetCreatedAt

func (m *TagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TagMutation) ResetEdge

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

func (m *TagMutation) 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 (*TagMutation) ResetTagName

func (m *TagMutation) ResetTagName()

ResetTagName resets all changes to the "tag_name" field.

func (*TagMutation) ResetUpdatedAt

func (m *TagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TagMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TagMutation) SetField

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

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetTagName

func (m *TagMutation) SetTagName(s string)

SetTagName sets the "tag_name" field.

func (*TagMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*TagMutation) TagName

func (m *TagMutation) TagName() (r string, exists bool)

TagName returns the value of the "tag_name" field in the mutation.

func (TagMutation) Tx

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

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

func (*TagMutation) Type

func (m *TagMutation) Type() string

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

func (*TagMutation) UpdatedAt

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

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

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

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

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

type TagQuery

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

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

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

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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

func (*TagQuery) Count

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

Count returns the count of the given query.

func (*TagQuery) CountX

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

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

func (*TagQuery) Exist

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

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

func (*TagQuery) ExistX

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

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

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

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

func (*TagQuery) FirstID

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

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

func (*TagQuery) FirstIDX

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

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

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

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

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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

client.Tag.Query().
	GroupBy(tag.FieldTagName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*TagQuery) IDsX

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

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

func (*TagQuery) Limit

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

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

func (*TagQuery) Offset

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

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

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

func (*TagQuery) OnlyID

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

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

func (*TagQuery) OnlyIDX

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

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

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

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

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryBanners

func (tq *TagQuery) QueryBanners() *BannerQuery

QueryBanners chains the current query on the "banners" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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

client.Tag.Query().
	Select(tag.FieldTagName).
	Scan(ctx, &v)

func (*TagQuery) Unique

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

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

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithBanners

func (tq *TagQuery) WithBanners(opts ...func(*BannerQuery)) *TagQuery

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

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

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

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

func (*TagSelect) BoolX

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

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

func (*TagSelect) Bools

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

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

func (*TagSelect) BoolsX

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

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

func (*TagSelect) Float64

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

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

func (*TagSelect) Float64X

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

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

func (*TagSelect) Float64s

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

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

func (*TagSelect) Float64sX

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

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

func (*TagSelect) Int

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

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

func (*TagSelect) IntX

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

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

func (*TagSelect) Ints

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

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

func (*TagSelect) IntsX

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

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

func (*TagSelect) Scan

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

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

func (*TagSelect) ScanX

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

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

func (*TagSelect) String

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

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

func (*TagSelect) StringX

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

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

func (*TagSelect) Strings

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

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

func (*TagSelect) StringsX

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

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

type TagUpdate

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

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddBannerIDs

func (tu *TagUpdate) AddBannerIDs(ids ...int) *TagUpdate

AddBannerIDs adds the "banners" edge to the Banner entity by IDs.

func (*TagUpdate) AddBanners

func (tu *TagUpdate) AddBanners(b ...*Banner) *TagUpdate

AddBanners adds the "banners" edges to the Banner entity.

func (*TagUpdate) ClearBanners

func (tu *TagUpdate) ClearBanners() *TagUpdate

ClearBanners clears all "banners" edges to the Banner entity.

func (*TagUpdate) Exec

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

Exec executes the query.

func (*TagUpdate) ExecX

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

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

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveBannerIDs

func (tu *TagUpdate) RemoveBannerIDs(ids ...int) *TagUpdate

RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.

func (*TagUpdate) RemoveBanners

func (tu *TagUpdate) RemoveBanners(b ...*Banner) *TagUpdate

RemoveBanners removes "banners" edges to Banner entities.

func (*TagUpdate) Save

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

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

func (*TagUpdate) SaveX

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

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

func (*TagUpdate) SetNillableTagName

func (tu *TagUpdate) SetNillableTagName(s *string) *TagUpdate

SetNillableTagName sets the "tag_name" field if the given value is not nil.

func (*TagUpdate) SetNillableUpdatedAt

func (tu *TagUpdate) SetNillableUpdatedAt(t *time.Time) *TagUpdate

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

func (*TagUpdate) SetTagName

func (tu *TagUpdate) SetTagName(s string) *TagUpdate

SetTagName sets the "tag_name" field.

func (*TagUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

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

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddBannerIDs

func (tuo *TagUpdateOne) AddBannerIDs(ids ...int) *TagUpdateOne

AddBannerIDs adds the "banners" edge to the Banner entity by IDs.

func (*TagUpdateOne) AddBanners

func (tuo *TagUpdateOne) AddBanners(b ...*Banner) *TagUpdateOne

AddBanners adds the "banners" edges to the Banner entity.

func (*TagUpdateOne) ClearBanners

func (tuo *TagUpdateOne) ClearBanners() *TagUpdateOne

ClearBanners clears all "banners" edges to the Banner entity.

func (*TagUpdateOne) Exec

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

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

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

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

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveBannerIDs

func (tuo *TagUpdateOne) RemoveBannerIDs(ids ...int) *TagUpdateOne

RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.

func (*TagUpdateOne) RemoveBanners

func (tuo *TagUpdateOne) RemoveBanners(b ...*Banner) *TagUpdateOne

RemoveBanners removes "banners" edges to Banner entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

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

func (*TagUpdateOne) Select

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

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

func (*TagUpdateOne) SetNillableTagName

func (tuo *TagUpdateOne) SetNillableTagName(s *string) *TagUpdateOne

SetNillableTagName sets the "tag_name" field if the given value is not nil.

func (*TagUpdateOne) SetNillableUpdatedAt

func (tuo *TagUpdateOne) SetNillableUpdatedAt(t *time.Time) *TagUpdateOne

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

func (*TagUpdateOne) SetTagName

func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne

SetTagName sets the "tag_name" field.

func (*TagUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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 {

	// Banner is the client for interacting with the Banner builders.
	Banner *BannerClient
	// Feature is the client for interacting with the Feature builders.
	Feature *FeatureClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

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

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL