generated

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 26 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.
	TypeContentTypeDef     = "ContentTypeDef"
	TypeFile               = "File"
	TypeGallery            = "Gallery"
	TypeGalleryContentType = "GalleryContentType"
	TypeGalleryItem        = "GalleryItem"
	TypeGalleryNode        = "GalleryNode"
	TypeNode               = "Node"
)

Variables

View Source
var ErrTxStarted = errors.New("generated: 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// ContentTypeDef is the client for interacting with the ContentTypeDef builders.
	ContentTypeDef *ContentTypeDefClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Gallery is the client for interacting with the Gallery builders.
	Gallery *GalleryClient
	// GalleryContentType is the client for interacting with the GalleryContentType builders.
	GalleryContentType *GalleryContentTypeClient
	// GalleryItem is the client for interacting with the GalleryItem builders.
	GalleryItem *GalleryItemClient
	// GalleryNode is the client for interacting with the GalleryNode builders.
	GalleryNode *GalleryNodeClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// 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().
	ContentTypeDef.
	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 ContentTypeDef

type ContentTypeDef struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

ContentTypeDef is the model entity for the ContentTypeDef schema.

func (*ContentTypeDef) String

func (_m *ContentTypeDef) String() string

String implements the fmt.Stringer.

func (*ContentTypeDef) Unwrap

func (_m *ContentTypeDef) Unwrap() *ContentTypeDef

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

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

func (*ContentTypeDef) Value

func (_m *ContentTypeDef) Value(name string) (ent.Value, error)

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

type ContentTypeDefClient

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

ContentTypeDefClient is a client for the ContentTypeDef schema.

func NewContentTypeDefClient

func NewContentTypeDefClient(c config) *ContentTypeDefClient

NewContentTypeDefClient returns a client for the ContentTypeDef from the given config.

func (*ContentTypeDefClient) Create

Create returns a builder for creating a ContentTypeDef entity.

func (*ContentTypeDefClient) CreateBulk

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

func (*ContentTypeDefClient) Delete

Delete returns a delete builder for ContentTypeDef.

func (*ContentTypeDefClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContentTypeDefClient) DeleteOneID

func (c *ContentTypeDefClient) DeleteOneID(id int) *ContentTypeDefDeleteOne

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

func (*ContentTypeDefClient) Get

Get returns a ContentTypeDef entity by its id.

func (*ContentTypeDefClient) GetX

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

func (*ContentTypeDefClient) Hooks

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

Hooks returns the client hooks.

func (*ContentTypeDefClient) Intercept

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

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

func (*ContentTypeDefClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ContentTypeDefClient) MapCreateBulk

func (c *ContentTypeDefClient) MapCreateBulk(slice any, setFunc func(*ContentTypeDefCreate, int)) *ContentTypeDefCreateBulk

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 (*ContentTypeDefClient) Query

Query returns a query builder for ContentTypeDef.

func (*ContentTypeDefClient) Update

Update returns an update builder for ContentTypeDef.

func (*ContentTypeDefClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContentTypeDefClient) UpdateOneID

func (c *ContentTypeDefClient) UpdateOneID(id int) *ContentTypeDefUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ContentTypeDefClient) Use

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

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

type ContentTypeDefCreate

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

ContentTypeDefCreate is the builder for creating a ContentTypeDef entity.

func (*ContentTypeDefCreate) Exec

func (_c *ContentTypeDefCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContentTypeDefCreate) ExecX

func (_c *ContentTypeDefCreate) ExecX(ctx context.Context)

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

func (*ContentTypeDefCreate) Mutation

Mutation returns the ContentTypeDefMutation object of the builder.

func (*ContentTypeDefCreate) Save

Save creates the ContentTypeDef in the database.

func (*ContentTypeDefCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ContentTypeDefCreate) SetID

SetID sets the "id" field.

type ContentTypeDefCreateBulk

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

ContentTypeDefCreateBulk is the builder for creating many ContentTypeDef entities in bulk.

func (*ContentTypeDefCreateBulk) Exec

Exec executes the query.

func (*ContentTypeDefCreateBulk) ExecX

func (_c *ContentTypeDefCreateBulk) ExecX(ctx context.Context)

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

func (*ContentTypeDefCreateBulk) Save

Save creates the ContentTypeDef entities in the database.

func (*ContentTypeDefCreateBulk) SaveX

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

type ContentTypeDefDelete

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

ContentTypeDefDelete is the builder for deleting a ContentTypeDef entity.

func (*ContentTypeDefDelete) Exec

func (_d *ContentTypeDefDelete) Exec(ctx context.Context) (int, error)

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

func (*ContentTypeDefDelete) ExecX

func (_d *ContentTypeDefDelete) ExecX(ctx context.Context) int

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

func (*ContentTypeDefDelete) Where

Where appends a list predicates to the ContentTypeDefDelete builder.

type ContentTypeDefDeleteOne

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

ContentTypeDefDeleteOne is the builder for deleting a single ContentTypeDef entity.

func (*ContentTypeDefDeleteOne) Exec

Exec executes the deletion query.

func (*ContentTypeDefDeleteOne) ExecX

func (_d *ContentTypeDefDeleteOne) ExecX(ctx context.Context)

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

func (*ContentTypeDefDeleteOne) Where

Where appends a list predicates to the ContentTypeDefDelete builder.

type ContentTypeDefGroupBy

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

ContentTypeDefGroupBy is the group-by builder for ContentTypeDef entities.

func (*ContentTypeDefGroupBy) Aggregate

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

func (*ContentTypeDefGroupBy) Bool

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

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

func (*ContentTypeDefGroupBy) BoolX

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

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

func (*ContentTypeDefGroupBy) Bools

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

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

func (*ContentTypeDefGroupBy) BoolsX

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

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

func (*ContentTypeDefGroupBy) Float64

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

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

func (*ContentTypeDefGroupBy) Float64X

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

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

func (*ContentTypeDefGroupBy) Float64s

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

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

func (*ContentTypeDefGroupBy) Float64sX

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

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

func (*ContentTypeDefGroupBy) Int

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

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

func (*ContentTypeDefGroupBy) IntX

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

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

func (*ContentTypeDefGroupBy) Ints

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

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

func (*ContentTypeDefGroupBy) IntsX

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

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

func (*ContentTypeDefGroupBy) Scan

func (_g *ContentTypeDefGroupBy) Scan(ctx context.Context, v any) error

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

func (*ContentTypeDefGroupBy) ScanX

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

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

func (*ContentTypeDefGroupBy) String

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

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

func (*ContentTypeDefGroupBy) StringX

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

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

func (*ContentTypeDefGroupBy) Strings

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

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

func (*ContentTypeDefGroupBy) StringsX

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

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

type ContentTypeDefMutation

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

ContentTypeDefMutation represents an operation that mutates the ContentTypeDef nodes in the graph.

func (*ContentTypeDefMutation) AddField

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

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

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

func (*ContentTypeDefMutation) AddedField

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

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

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

func (*ContentTypeDefMutation) AddedIDs

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

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

func (*ContentTypeDefMutation) ClearEdge

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

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

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

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

func (*ContentTypeDefMutation) ClearedFields

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

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

func (ContentTypeDefMutation) Client

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

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

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

func (*ContentTypeDefMutation) Field

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

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

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

func (*ContentTypeDefMutation) Fields

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

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

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

func (m *ContentTypeDefMutation) 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 (*ContentTypeDefMutation) Op

func (m *ContentTypeDefMutation) Op() Op

Op returns the operation name.

func (*ContentTypeDefMutation) RemovedEdges

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

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

func (*ContentTypeDefMutation) RemovedIDs

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

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

func (m *ContentTypeDefMutation) 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 (*ContentTypeDefMutation) SetField

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

func (m *ContentTypeDefMutation) SetID(id int)

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

func (*ContentTypeDefMutation) SetOp

func (m *ContentTypeDefMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ContentTypeDefMutation) Tx

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

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

func (*ContentTypeDefMutation) Type

func (m *ContentTypeDefMutation) Type() string

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

func (*ContentTypeDefMutation) Where

Where appends a list predicates to the ContentTypeDefMutation builder.

func (*ContentTypeDefMutation) WhereP

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

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

type ContentTypeDefQuery

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

ContentTypeDefQuery is the builder for querying ContentTypeDef entities.

func (*ContentTypeDefQuery) Aggregate

Aggregate returns a ContentTypeDefSelect configured with the given aggregations.

func (*ContentTypeDefQuery) All

All executes the query and returns a list of ContentTypeDefs.

func (*ContentTypeDefQuery) AllX

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

func (*ContentTypeDefQuery) Clone

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

func (*ContentTypeDefQuery) Count

func (_q *ContentTypeDefQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ContentTypeDefQuery) CountX

func (_q *ContentTypeDefQuery) CountX(ctx context.Context) int

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

func (*ContentTypeDefQuery) Exist

func (_q *ContentTypeDefQuery) Exist(ctx context.Context) (bool, error)

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

func (*ContentTypeDefQuery) ExistX

func (_q *ContentTypeDefQuery) ExistX(ctx context.Context) bool

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

func (*ContentTypeDefQuery) First

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

func (*ContentTypeDefQuery) FirstID

func (_q *ContentTypeDefQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ContentTypeDefQuery) FirstIDX

func (_q *ContentTypeDefQuery) FirstIDX(ctx context.Context) int

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

func (*ContentTypeDefQuery) FirstX

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

func (*ContentTypeDefQuery) GroupBy

func (_q *ContentTypeDefQuery) GroupBy(field string, fields ...string) *ContentTypeDefGroupBy

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.

func (*ContentTypeDefQuery) IDs

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

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

func (*ContentTypeDefQuery) IDsX

func (_q *ContentTypeDefQuery) IDsX(ctx context.Context) []int

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

func (*ContentTypeDefQuery) Limit

func (_q *ContentTypeDefQuery) Limit(limit int) *ContentTypeDefQuery

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

func (*ContentTypeDefQuery) Offset

func (_q *ContentTypeDefQuery) Offset(offset int) *ContentTypeDefQuery

Offset to start from.

func (*ContentTypeDefQuery) Only

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

func (*ContentTypeDefQuery) OnlyID

func (_q *ContentTypeDefQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ContentTypeDefQuery) OnlyIDX

func (_q *ContentTypeDefQuery) OnlyIDX(ctx context.Context) int

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

func (*ContentTypeDefQuery) OnlyX

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

func (*ContentTypeDefQuery) Order

Order specifies how the records should be ordered.

func (*ContentTypeDefQuery) Select

func (_q *ContentTypeDefQuery) Select(fields ...string) *ContentTypeDefSelect

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

func (*ContentTypeDefQuery) Unique

func (_q *ContentTypeDefQuery) Unique(unique bool) *ContentTypeDefQuery

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

Where adds a new predicate for the ContentTypeDefQuery builder.

type ContentTypeDefSelect

type ContentTypeDefSelect struct {
	*ContentTypeDefQuery
	// contains filtered or unexported fields
}

ContentTypeDefSelect is the builder for selecting fields of ContentTypeDef entities.

func (*ContentTypeDefSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ContentTypeDefSelect) Bool

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

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

func (*ContentTypeDefSelect) BoolX

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

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

func (*ContentTypeDefSelect) Bools

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

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

func (*ContentTypeDefSelect) BoolsX

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

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

func (*ContentTypeDefSelect) Float64

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

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

func (*ContentTypeDefSelect) Float64X

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

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

func (*ContentTypeDefSelect) Float64s

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

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

func (*ContentTypeDefSelect) Float64sX

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

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

func (*ContentTypeDefSelect) Int

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

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

func (*ContentTypeDefSelect) IntX

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

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

func (*ContentTypeDefSelect) Ints

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

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

func (*ContentTypeDefSelect) IntsX

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

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

func (*ContentTypeDefSelect) Scan

func (_s *ContentTypeDefSelect) Scan(ctx context.Context, v any) error

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

func (*ContentTypeDefSelect) ScanX

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

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

func (*ContentTypeDefSelect) String

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

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

func (*ContentTypeDefSelect) StringX

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

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

func (*ContentTypeDefSelect) Strings

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

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

func (*ContentTypeDefSelect) StringsX

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

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

type ContentTypeDefUpdate

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

ContentTypeDefUpdate is the builder for updating ContentTypeDef entities.

func (*ContentTypeDefUpdate) Exec

func (_u *ContentTypeDefUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContentTypeDefUpdate) ExecX

func (_u *ContentTypeDefUpdate) ExecX(ctx context.Context)

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

func (*ContentTypeDefUpdate) Mutation

Mutation returns the ContentTypeDefMutation object of the builder.

func (*ContentTypeDefUpdate) Save

func (_u *ContentTypeDefUpdate) Save(ctx context.Context) (int, error)

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

func (*ContentTypeDefUpdate) SaveX

func (_u *ContentTypeDefUpdate) SaveX(ctx context.Context) int

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

func (*ContentTypeDefUpdate) Where

Where appends a list predicates to the ContentTypeDefUpdate builder.

type ContentTypeDefUpdateOne

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

ContentTypeDefUpdateOne is the builder for updating a single ContentTypeDef entity.

func (*ContentTypeDefUpdateOne) Exec

Exec executes the query on the entity.

func (*ContentTypeDefUpdateOne) ExecX

func (_u *ContentTypeDefUpdateOne) ExecX(ctx context.Context)

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

func (*ContentTypeDefUpdateOne) Mutation

Mutation returns the ContentTypeDefMutation object of the builder.

func (*ContentTypeDefUpdateOne) Save

Save executes the query and returns the updated ContentTypeDef entity.

func (*ContentTypeDefUpdateOne) SaveX

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

func (*ContentTypeDefUpdateOne) Select

func (_u *ContentTypeDefUpdateOne) Select(field string, fields ...string) *ContentTypeDefUpdateOne

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

func (*ContentTypeDefUpdateOne) Where

Where appends a list predicates to the ContentTypeDefUpdate builder.

type ContentTypeDefs

type ContentTypeDefs []*ContentTypeDef

ContentTypeDefs is a parsable slice of ContentTypeDef.

type File

type File struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) String

func (_m *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap

func (_m *File) Unwrap() *File

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

func (_m *File) Update() *FileUpdateOne

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

func (*File) Value

func (_m *File) Value(name string) (ent.Value, error)

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

type FileClient

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

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

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

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(_m *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id int) *FileDeleteOne

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

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id int) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id int) *File

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

func (*FileClient) Hooks

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

Hooks returns the client hooks.

func (*FileClient) Intercept

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

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

func (*FileClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FileClient) MapCreateBulk

func (c *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk

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 (*FileClient) Query

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(_m *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id int) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

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

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

type FileCreate

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

FileCreate is the builder for creating a File entity.

func (*FileCreate) Exec

func (_c *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecX

func (_c *FileCreate) ExecX(ctx context.Context)

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

func (*FileCreate) Mutation

func (_c *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) Save

func (_c *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (_c *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetID

func (_c *FileCreate) SetID(v int) *FileCreate

SetID sets the "id" field.

type FileCreateBulk

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

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (_c *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecX

func (_c *FileCreateBulk) ExecX(ctx context.Context)

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

func (*FileCreateBulk) Save

func (_c *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (_c *FileCreateBulk) SaveX(ctx context.Context) []*File

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

type FileDelete

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

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (_d *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecX

func (_d *FileDelete) ExecX(ctx context.Context) int

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

func (*FileDelete) Where

func (_d *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

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

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (_d *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (_d *FileDeleteOne) ExecX(ctx context.Context)

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

func (*FileDeleteOne) Where

func (_d *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileGroupBy

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (_g *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

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

func (*FileGroupBy) Bool

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

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

func (*FileGroupBy) BoolX

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

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

func (*FileGroupBy) Bools

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

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

func (*FileGroupBy) BoolsX

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

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

func (*FileGroupBy) Float64

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

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

func (*FileGroupBy) Float64X

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

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

func (*FileGroupBy) Float64s

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

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

func (*FileGroupBy) Float64sX

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

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

func (*FileGroupBy) Int

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

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

func (*FileGroupBy) IntX

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

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

func (*FileGroupBy) Ints

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

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

func (*FileGroupBy) IntsX

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

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

func (*FileGroupBy) Scan

func (_g *FileGroupBy) Scan(ctx context.Context, v any) error

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

func (*FileGroupBy) ScanX

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

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

func (*FileGroupBy) String

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

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

func (*FileGroupBy) StringX

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

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

func (*FileGroupBy) Strings

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

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

func (*FileGroupBy) StringsX

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

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

type FileMutation

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

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddField

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

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

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

func (*FileMutation) AddedField

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

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

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

func (*FileMutation) AddedIDs

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

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

func (*FileMutation) ClearEdge

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

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

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

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

func (*FileMutation) ClearedFields

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

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

func (FileMutation) Client

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

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

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

func (*FileMutation) Field

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

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

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

func (*FileMutation) Fields

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

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

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

func (m *FileMutation) 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 (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) RemovedEdges

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

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

func (*FileMutation) RemovedIDs

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

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

func (m *FileMutation) 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 (*FileMutation) SetField

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

func (m *FileMutation) SetID(id int)

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

func (*FileMutation) SetOp

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (FileMutation) Tx

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

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

func (*FileMutation) Type

func (m *FileMutation) Type() string

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

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP

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

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

type FileQuery

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

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate

func (_q *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

func (_q *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (_q *FileQuery) AllX(ctx context.Context) []*File

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

func (*FileQuery) Clone

func (_q *FileQuery) Clone() *FileQuery

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

func (*FileQuery) Count

func (_q *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (_q *FileQuery) CountX(ctx context.Context) int

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

func (*FileQuery) Exist

func (_q *FileQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileQuery) ExistX

func (_q *FileQuery) ExistX(ctx context.Context) bool

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

func (*FileQuery) First

func (_q *FileQuery) First(ctx context.Context) (*File, error)

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

func (*FileQuery) FirstID

func (_q *FileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FileQuery) FirstIDX

func (_q *FileQuery) FirstIDX(ctx context.Context) int

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

func (*FileQuery) FirstX

func (_q *FileQuery) FirstX(ctx context.Context) *File

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

func (*FileQuery) GroupBy

func (_q *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

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.

func (*FileQuery) IDs

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

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

func (*FileQuery) IDsX

func (_q *FileQuery) IDsX(ctx context.Context) []int

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

func (*FileQuery) Limit

func (_q *FileQuery) Limit(limit int) *FileQuery

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

func (*FileQuery) Offset

func (_q *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only

func (_q *FileQuery) Only(ctx context.Context) (*File, error)

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

func (*FileQuery) OnlyID

func (_q *FileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FileQuery) OnlyIDX

func (_q *FileQuery) OnlyIDX(ctx context.Context) int

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

func (*FileQuery) OnlyX

func (_q *FileQuery) OnlyX(ctx context.Context) *File

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

func (*FileQuery) Order

func (_q *FileQuery) Order(o ...file.OrderOption) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) Select

func (_q *FileQuery) Select(fields ...string) *FileSelect

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

func (*FileQuery) Unique

func (_q *FileQuery) Unique(unique bool) *FileQuery

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

func (_q *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate

func (_s *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool

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

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

func (*FileSelect) BoolX

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

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

func (*FileSelect) Bools

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

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

func (*FileSelect) BoolsX

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

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

func (*FileSelect) Float64

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

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

func (*FileSelect) Float64X

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

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

func (*FileSelect) Float64s

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

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

func (*FileSelect) Float64sX

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

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

func (*FileSelect) Int

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

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

func (*FileSelect) IntX

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

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

func (*FileSelect) Ints

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

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

func (*FileSelect) IntsX

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

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

func (*FileSelect) Scan

func (_s *FileSelect) Scan(ctx context.Context, v any) error

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

func (*FileSelect) ScanX

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

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

func (*FileSelect) String

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

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

func (*FileSelect) StringX

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

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

func (*FileSelect) Strings

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

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

func (*FileSelect) StringsX

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

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

type FileUpdate

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

FileUpdate is the builder for updating File entities.

func (*FileUpdate) Exec

func (_u *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecX

func (_u *FileUpdate) ExecX(ctx context.Context)

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

func (*FileUpdate) Mutation

func (_u *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) Save

func (_u *FileUpdate) Save(ctx context.Context) (int, error)

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

func (*FileUpdate) SaveX

func (_u *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) Where

func (_u *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

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

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) Exec

func (_u *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecX

func (_u *FileUpdateOne) ExecX(ctx context.Context)

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

func (*FileUpdateOne) Mutation

func (_u *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) Save

func (_u *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (_u *FileUpdateOne) SaveX(ctx context.Context) *File

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

func (*FileUpdateOne) Select

func (_u *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

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

func (*FileUpdateOne) Where

func (_u *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type Files

type Files []*File

Files is a parsable slice of File.

type Galleries

type Galleries []*Gallery

Galleries is a parsable slice of Gallery.

type Gallery struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// The node (nodes.id) the gallery belongs to
	Nid int `json:"nid,omitempty"`
	// PreviewSmallStyle holds the value of the "preview_small_style" field.
	PreviewSmallStyle string `json:"preview_small_style,omitempty"`
	// PreviewMediumStyle holds the value of the "preview_medium_style" field.
	PreviewMediumStyle string `json:"preview_medium_style,omitempty"`
	// The gallery's title
	Title string `json:"title,omitempty"`
	// The gallery's description
	Description string `json:"description,omitempty"`
	// The gallery's position among the node's galleries
	Weight int `json:"weight,omitempty"`
	// 1 - shown, 0 - hidden
	Status bool `json:"status,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 GalleryQuery when eager-loading is set.
	Edges GalleryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Gallery is the model entity for the Gallery schema.

func (*Gallery) QueryItems

func (_m *Gallery) QueryItems() *GalleryItemQuery

QueryItems queries the "items" edge of the Gallery entity.

func (*Gallery) QueryNode

func (_m *Gallery) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the Gallery entity.

func (*Gallery) String

func (_m *Gallery) String() string

String implements the fmt.Stringer.

func (*Gallery) Unwrap

func (_m *Gallery) Unwrap() *Gallery

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

func (_m *Gallery) Update() *GalleryUpdateOne

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

func (*Gallery) Value

func (_m *Gallery) Value(name string) (ent.Value, error)

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

type GalleryClient

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

GalleryClient is a client for the Gallery schema.

func NewGalleryClient

func NewGalleryClient(c config) *GalleryClient

NewGalleryClient returns a client for the Gallery from the given config.

func (*GalleryClient) Create

func (c *GalleryClient) Create() *GalleryCreate

Create returns a builder for creating a Gallery entity.

func (*GalleryClient) CreateBulk

func (c *GalleryClient) CreateBulk(builders ...*GalleryCreate) *GalleryCreateBulk

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

func (*GalleryClient) Delete

func (c *GalleryClient) Delete() *GalleryDelete

Delete returns a delete builder for Gallery.

func (*GalleryClient) DeleteOne

func (c *GalleryClient) DeleteOne(_m *Gallery) *GalleryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GalleryClient) DeleteOneID

func (c *GalleryClient) DeleteOneID(id int) *GalleryDeleteOne

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

func (*GalleryClient) Get

func (c *GalleryClient) Get(ctx context.Context, id int) (*Gallery, error)

Get returns a Gallery entity by its id.

func (*GalleryClient) GetX

func (c *GalleryClient) GetX(ctx context.Context, id int) *Gallery

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

func (*GalleryClient) Hooks

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

Hooks returns the client hooks.

func (*GalleryClient) Intercept

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

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

func (*GalleryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GalleryClient) MapCreateBulk

func (c *GalleryClient) MapCreateBulk(slice any, setFunc func(*GalleryCreate, int)) *GalleryCreateBulk

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 (*GalleryClient) Query

func (c *GalleryClient) Query() *GalleryQuery

Query returns a query builder for Gallery.

func (*GalleryClient) QueryItems

func (c *GalleryClient) QueryItems(_m *Gallery) *GalleryItemQuery

QueryItems queries the items edge of a Gallery.

func (*GalleryClient) QueryNode

func (c *GalleryClient) QueryNode(_m *Gallery) *NodeQuery

QueryNode queries the node edge of a Gallery.

func (*GalleryClient) Update

func (c *GalleryClient) Update() *GalleryUpdate

Update returns an update builder for Gallery.

func (*GalleryClient) UpdateOne

func (c *GalleryClient) UpdateOne(_m *Gallery) *GalleryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GalleryClient) UpdateOneID

func (c *GalleryClient) UpdateOneID(id int) *GalleryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GalleryClient) Use

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

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

type GalleryContentType

type GalleryContentType struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ContentTypeID holds the value of the "content_type_id" field.
	ContentTypeID int `json:"content_type_id,omitempty"`
	// DefaultEnabled holds the value of the "default_enabled" field.
	DefaultEnabled bool `json:"default_enabled,omitempty"`
	// PictureField holds the value of the "picture_field" field.
	PictureField string `json:"picture_field,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GalleryContentTypeQuery when eager-loading is set.
	Edges GalleryContentTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

GalleryContentType is the model entity for the GalleryContentType schema.

func (*GalleryContentType) QueryContentType

func (_m *GalleryContentType) QueryContentType() *ContentTypeDefQuery

QueryContentType queries the "content_type" edge of the GalleryContentType entity.

func (*GalleryContentType) String

func (_m *GalleryContentType) String() string

String implements the fmt.Stringer.

func (*GalleryContentType) Unwrap

func (_m *GalleryContentType) Unwrap() *GalleryContentType

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

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

func (*GalleryContentType) Value

func (_m *GalleryContentType) Value(name string) (ent.Value, error)

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

type GalleryContentTypeClient

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

GalleryContentTypeClient is a client for the GalleryContentType schema.

func NewGalleryContentTypeClient

func NewGalleryContentTypeClient(c config) *GalleryContentTypeClient

NewGalleryContentTypeClient returns a client for the GalleryContentType from the given config.

func (*GalleryContentTypeClient) Create

Create returns a builder for creating a GalleryContentType entity.

func (*GalleryContentTypeClient) CreateBulk

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

func (*GalleryContentTypeClient) Delete

Delete returns a delete builder for GalleryContentType.

func (*GalleryContentTypeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GalleryContentTypeClient) DeleteOneID

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

func (*GalleryContentTypeClient) Get

Get returns a GalleryContentType entity by its id.

func (*GalleryContentTypeClient) GetX

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

func (*GalleryContentTypeClient) Hooks

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

Hooks returns the client hooks.

func (*GalleryContentTypeClient) Intercept

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

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

func (*GalleryContentTypeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GalleryContentTypeClient) MapCreateBulk

func (c *GalleryContentTypeClient) MapCreateBulk(slice any, setFunc func(*GalleryContentTypeCreate, int)) *GalleryContentTypeCreateBulk

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 (*GalleryContentTypeClient) Query

Query returns a query builder for GalleryContentType.

func (*GalleryContentTypeClient) QueryContentType

QueryContentType queries the content_type edge of a GalleryContentType.

func (*GalleryContentTypeClient) Update

Update returns an update builder for GalleryContentType.

func (*GalleryContentTypeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GalleryContentTypeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GalleryContentTypeClient) Use

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

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

type GalleryContentTypeCreate

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

GalleryContentTypeCreate is the builder for creating a GalleryContentType entity.

func (*GalleryContentTypeCreate) Exec

Exec executes the query.

func (*GalleryContentTypeCreate) ExecX

func (_c *GalleryContentTypeCreate) ExecX(ctx context.Context)

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

func (*GalleryContentTypeCreate) Mutation

Mutation returns the GalleryContentTypeMutation object of the builder.

func (*GalleryContentTypeCreate) Save

Save creates the GalleryContentType in the database.

func (*GalleryContentTypeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GalleryContentTypeCreate) SetContentType

SetContentType sets the "content_type" edge to the ContentTypeDef entity.

func (*GalleryContentTypeCreate) SetContentTypeID

func (_c *GalleryContentTypeCreate) SetContentTypeID(v int) *GalleryContentTypeCreate

SetContentTypeID sets the "content_type_id" field.

func (*GalleryContentTypeCreate) SetDefaultEnabled

func (_c *GalleryContentTypeCreate) SetDefaultEnabled(v bool) *GalleryContentTypeCreate

SetDefaultEnabled sets the "default_enabled" field.

func (*GalleryContentTypeCreate) SetID

SetID sets the "id" field.

func (*GalleryContentTypeCreate) SetNillableDefaultEnabled

func (_c *GalleryContentTypeCreate) SetNillableDefaultEnabled(v *bool) *GalleryContentTypeCreate

SetNillableDefaultEnabled sets the "default_enabled" field if the given value is not nil.

func (*GalleryContentTypeCreate) SetNillablePictureField

func (_c *GalleryContentTypeCreate) SetNillablePictureField(v *string) *GalleryContentTypeCreate

SetNillablePictureField sets the "picture_field" field if the given value is not nil.

func (*GalleryContentTypeCreate) SetPictureField

SetPictureField sets the "picture_field" field.

type GalleryContentTypeCreateBulk

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

GalleryContentTypeCreateBulk is the builder for creating many GalleryContentType entities in bulk.

func (*GalleryContentTypeCreateBulk) Exec

Exec executes the query.

func (*GalleryContentTypeCreateBulk) ExecX

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

func (*GalleryContentTypeCreateBulk) Save

Save creates the GalleryContentType entities in the database.

func (*GalleryContentTypeCreateBulk) SaveX

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

type GalleryContentTypeDelete

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

GalleryContentTypeDelete is the builder for deleting a GalleryContentType entity.

func (*GalleryContentTypeDelete) Exec

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

func (*GalleryContentTypeDelete) ExecX

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

func (*GalleryContentTypeDelete) Where

Where appends a list predicates to the GalleryContentTypeDelete builder.

type GalleryContentTypeDeleteOne

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

GalleryContentTypeDeleteOne is the builder for deleting a single GalleryContentType entity.

func (*GalleryContentTypeDeleteOne) Exec

Exec executes the deletion query.

func (*GalleryContentTypeDeleteOne) ExecX

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

func (*GalleryContentTypeDeleteOne) Where

Where appends a list predicates to the GalleryContentTypeDelete builder.

type GalleryContentTypeEdges

type GalleryContentTypeEdges struct {
	// ContentType holds the value of the content_type edge.
	ContentType *ContentTypeDef `json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

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

func (GalleryContentTypeEdges) ContentTypeOrErr

func (e GalleryContentTypeEdges) ContentTypeOrErr() (*ContentTypeDef, error)

ContentTypeOrErr returns the ContentType value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GalleryContentTypeGroupBy

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

GalleryContentTypeGroupBy is the group-by builder for GalleryContentType entities.

func (*GalleryContentTypeGroupBy) Aggregate

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

func (*GalleryContentTypeGroupBy) Bool

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

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

func (*GalleryContentTypeGroupBy) BoolX

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

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

func (*GalleryContentTypeGroupBy) Bools

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

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

func (*GalleryContentTypeGroupBy) BoolsX

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

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

func (*GalleryContentTypeGroupBy) Float64

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

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

func (*GalleryContentTypeGroupBy) Float64X

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

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

func (*GalleryContentTypeGroupBy) Float64s

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

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

func (*GalleryContentTypeGroupBy) Float64sX

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

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

func (*GalleryContentTypeGroupBy) Int

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

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

func (*GalleryContentTypeGroupBy) IntX

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

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

func (*GalleryContentTypeGroupBy) Ints

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

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

func (*GalleryContentTypeGroupBy) IntsX

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

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

func (*GalleryContentTypeGroupBy) Scan

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

func (*GalleryContentTypeGroupBy) ScanX

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

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

func (*GalleryContentTypeGroupBy) String

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

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

func (*GalleryContentTypeGroupBy) StringX

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

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

func (*GalleryContentTypeGroupBy) Strings

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

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

func (*GalleryContentTypeGroupBy) StringsX

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

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

type GalleryContentTypeMutation

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

GalleryContentTypeMutation represents an operation that mutates the GalleryContentType nodes in the graph.

func (*GalleryContentTypeMutation) AddField

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

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

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

func (*GalleryContentTypeMutation) AddedField

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

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

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

func (*GalleryContentTypeMutation) AddedIDs

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

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

func (*GalleryContentTypeMutation) ClearContentType

func (m *GalleryContentTypeMutation) ClearContentType()

ClearContentType clears the "content_type" edge to the ContentTypeDef entity.

func (*GalleryContentTypeMutation) ClearEdge

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

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

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

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

func (*GalleryContentTypeMutation) ClearedFields

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

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

func (GalleryContentTypeMutation) Client

func (m GalleryContentTypeMutation) 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 (*GalleryContentTypeMutation) ContentTypeCleared

func (m *GalleryContentTypeMutation) ContentTypeCleared() bool

ContentTypeCleared reports if the "content_type" edge to the ContentTypeDef entity was cleared.

func (*GalleryContentTypeMutation) ContentTypeID

func (m *GalleryContentTypeMutation) ContentTypeID() (r int, exists bool)

ContentTypeID returns the value of the "content_type_id" field in the mutation.

func (*GalleryContentTypeMutation) ContentTypeIDs

func (m *GalleryContentTypeMutation) ContentTypeIDs() (ids []int)

ContentTypeIDs returns the "content_type" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ContentTypeID instead. It exists only for internal usage by the builders.

func (*GalleryContentTypeMutation) DefaultEnabled

func (m *GalleryContentTypeMutation) DefaultEnabled() (r bool, exists bool)

DefaultEnabled returns the value of the "default_enabled" field in the mutation.

func (*GalleryContentTypeMutation) EdgeCleared

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

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

func (*GalleryContentTypeMutation) Field

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

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

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

func (*GalleryContentTypeMutation) Fields

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

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

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 (*GalleryContentTypeMutation) OldContentTypeID

func (m *GalleryContentTypeMutation) OldContentTypeID(ctx context.Context) (v int, err error)

OldContentTypeID returns the old "content_type_id" field's value of the GalleryContentType entity. If the GalleryContentType 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 (*GalleryContentTypeMutation) OldDefaultEnabled

func (m *GalleryContentTypeMutation) OldDefaultEnabled(ctx context.Context) (v bool, err error)

OldDefaultEnabled returns the old "default_enabled" field's value of the GalleryContentType entity. If the GalleryContentType 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 (*GalleryContentTypeMutation) OldField

func (m *GalleryContentTypeMutation) 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 (*GalleryContentTypeMutation) OldPictureField

func (m *GalleryContentTypeMutation) OldPictureField(ctx context.Context) (v string, err error)

OldPictureField returns the old "picture_field" field's value of the GalleryContentType entity. If the GalleryContentType 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 (*GalleryContentTypeMutation) Op

Op returns the operation name.

func (*GalleryContentTypeMutation) PictureField

func (m *GalleryContentTypeMutation) PictureField() (r string, exists bool)

PictureField returns the value of the "picture_field" field in the mutation.

func (*GalleryContentTypeMutation) RemovedEdges

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

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

func (*GalleryContentTypeMutation) RemovedIDs

func (m *GalleryContentTypeMutation) 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 (*GalleryContentTypeMutation) ResetContentType

func (m *GalleryContentTypeMutation) ResetContentType()

ResetContentType resets all changes to the "content_type" edge.

func (*GalleryContentTypeMutation) ResetContentTypeID

func (m *GalleryContentTypeMutation) ResetContentTypeID()

ResetContentTypeID resets all changes to the "content_type_id" field.

func (*GalleryContentTypeMutation) ResetDefaultEnabled

func (m *GalleryContentTypeMutation) ResetDefaultEnabled()

ResetDefaultEnabled resets all changes to the "default_enabled" field.

func (*GalleryContentTypeMutation) ResetEdge

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

func (m *GalleryContentTypeMutation) 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 (*GalleryContentTypeMutation) ResetPictureField

func (m *GalleryContentTypeMutation) ResetPictureField()

ResetPictureField resets all changes to the "picture_field" field.

func (*GalleryContentTypeMutation) SetContentTypeID

func (m *GalleryContentTypeMutation) SetContentTypeID(i int)

SetContentTypeID sets the "content_type_id" field.

func (*GalleryContentTypeMutation) SetDefaultEnabled

func (m *GalleryContentTypeMutation) SetDefaultEnabled(b bool)

SetDefaultEnabled sets the "default_enabled" field.

func (*GalleryContentTypeMutation) SetField

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

func (m *GalleryContentTypeMutation) SetID(id int)

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

func (*GalleryContentTypeMutation) SetOp

func (m *GalleryContentTypeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GalleryContentTypeMutation) SetPictureField

func (m *GalleryContentTypeMutation) SetPictureField(s string)

SetPictureField sets the "picture_field" field.

func (GalleryContentTypeMutation) Tx

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

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

func (*GalleryContentTypeMutation) Type

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

func (*GalleryContentTypeMutation) Where

Where appends a list predicates to the GalleryContentTypeMutation builder.

func (*GalleryContentTypeMutation) WhereP

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

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

type GalleryContentTypeQuery

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

GalleryContentTypeQuery is the builder for querying GalleryContentType entities.

func (*GalleryContentTypeQuery) Aggregate

Aggregate returns a GalleryContentTypeSelect configured with the given aggregations.

func (*GalleryContentTypeQuery) All

All executes the query and returns a list of GalleryContentTypes.

func (*GalleryContentTypeQuery) AllX

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

func (*GalleryContentTypeQuery) Clone

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

func (*GalleryContentTypeQuery) Count

func (_q *GalleryContentTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GalleryContentTypeQuery) CountX

func (_q *GalleryContentTypeQuery) CountX(ctx context.Context) int

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

func (*GalleryContentTypeQuery) Exist

func (_q *GalleryContentTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*GalleryContentTypeQuery) ExistX

func (_q *GalleryContentTypeQuery) ExistX(ctx context.Context) bool

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

func (*GalleryContentTypeQuery) First

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

func (*GalleryContentTypeQuery) FirstID

func (_q *GalleryContentTypeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*GalleryContentTypeQuery) FirstIDX

func (_q *GalleryContentTypeQuery) FirstIDX(ctx context.Context) int

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

func (*GalleryContentTypeQuery) FirstX

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

func (*GalleryContentTypeQuery) GroupBy

func (_q *GalleryContentTypeQuery) GroupBy(field string, fields ...string) *GalleryContentTypeGroupBy

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 {
	ContentTypeID int `json:"content_type_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GalleryContentType.Query().
	GroupBy(gallerycontenttype.FieldContentTypeID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*GalleryContentTypeQuery) IDs

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

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

func (*GalleryContentTypeQuery) IDsX

func (_q *GalleryContentTypeQuery) IDsX(ctx context.Context) []int

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

func (*GalleryContentTypeQuery) Limit

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

func (*GalleryContentTypeQuery) Offset

Offset to start from.

func (*GalleryContentTypeQuery) Only

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

func (*GalleryContentTypeQuery) OnlyID

func (_q *GalleryContentTypeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*GalleryContentTypeQuery) OnlyIDX

func (_q *GalleryContentTypeQuery) OnlyIDX(ctx context.Context) int

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

func (*GalleryContentTypeQuery) OnlyX

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

func (*GalleryContentTypeQuery) Order

Order specifies how the records should be ordered.

func (*GalleryContentTypeQuery) QueryContentType

func (_q *GalleryContentTypeQuery) QueryContentType() *ContentTypeDefQuery

QueryContentType chains the current query on the "content_type" edge.

func (*GalleryContentTypeQuery) Select

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 {
	ContentTypeID int `json:"content_type_id,omitempty"`
}

client.GalleryContentType.Query().
	Select(gallerycontenttype.FieldContentTypeID).
	Scan(ctx, &v)

func (*GalleryContentTypeQuery) Unique

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

func (*GalleryContentTypeQuery) Where

Where adds a new predicate for the GalleryContentTypeQuery builder.

func (*GalleryContentTypeQuery) WithContentType

func (_q *GalleryContentTypeQuery) WithContentType(opts ...func(*ContentTypeDefQuery)) *GalleryContentTypeQuery

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

type GalleryContentTypeSelect

type GalleryContentTypeSelect struct {
	*GalleryContentTypeQuery
	// contains filtered or unexported fields
}

GalleryContentTypeSelect is the builder for selecting fields of GalleryContentType entities.

func (*GalleryContentTypeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GalleryContentTypeSelect) Bool

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

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

func (*GalleryContentTypeSelect) BoolX

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

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

func (*GalleryContentTypeSelect) Bools

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

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

func (*GalleryContentTypeSelect) BoolsX

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

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

func (*GalleryContentTypeSelect) Float64

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

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

func (*GalleryContentTypeSelect) Float64X

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

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

func (*GalleryContentTypeSelect) Float64s

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

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

func (*GalleryContentTypeSelect) Float64sX

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

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

func (*GalleryContentTypeSelect) Int

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

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

func (*GalleryContentTypeSelect) IntX

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

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

func (*GalleryContentTypeSelect) Ints

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

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

func (*GalleryContentTypeSelect) IntsX

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

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

func (*GalleryContentTypeSelect) Scan

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

func (*GalleryContentTypeSelect) ScanX

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

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

func (*GalleryContentTypeSelect) String

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

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

func (*GalleryContentTypeSelect) StringX

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

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

func (*GalleryContentTypeSelect) Strings

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

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

func (*GalleryContentTypeSelect) StringsX

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

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

type GalleryContentTypeUpdate

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

GalleryContentTypeUpdate is the builder for updating GalleryContentType entities.

func (*GalleryContentTypeUpdate) ClearContentType

func (_u *GalleryContentTypeUpdate) ClearContentType() *GalleryContentTypeUpdate

ClearContentType clears the "content_type" edge to the ContentTypeDef entity.

func (*GalleryContentTypeUpdate) Exec

Exec executes the query.

func (*GalleryContentTypeUpdate) ExecX

func (_u *GalleryContentTypeUpdate) ExecX(ctx context.Context)

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

func (*GalleryContentTypeUpdate) Mutation

Mutation returns the GalleryContentTypeMutation object of the builder.

func (*GalleryContentTypeUpdate) Save

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

func (*GalleryContentTypeUpdate) SaveX

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

func (*GalleryContentTypeUpdate) SetContentType

SetContentType sets the "content_type" edge to the ContentTypeDef entity.

func (*GalleryContentTypeUpdate) SetContentTypeID

func (_u *GalleryContentTypeUpdate) SetContentTypeID(v int) *GalleryContentTypeUpdate

SetContentTypeID sets the "content_type_id" field.

func (*GalleryContentTypeUpdate) SetDefaultEnabled

func (_u *GalleryContentTypeUpdate) SetDefaultEnabled(v bool) *GalleryContentTypeUpdate

SetDefaultEnabled sets the "default_enabled" field.

func (*GalleryContentTypeUpdate) SetNillableContentTypeID

func (_u *GalleryContentTypeUpdate) SetNillableContentTypeID(v *int) *GalleryContentTypeUpdate

SetNillableContentTypeID sets the "content_type_id" field if the given value is not nil.

func (*GalleryContentTypeUpdate) SetNillableDefaultEnabled

func (_u *GalleryContentTypeUpdate) SetNillableDefaultEnabled(v *bool) *GalleryContentTypeUpdate

SetNillableDefaultEnabled sets the "default_enabled" field if the given value is not nil.

func (*GalleryContentTypeUpdate) SetNillablePictureField

func (_u *GalleryContentTypeUpdate) SetNillablePictureField(v *string) *GalleryContentTypeUpdate

SetNillablePictureField sets the "picture_field" field if the given value is not nil.

func (*GalleryContentTypeUpdate) SetPictureField

SetPictureField sets the "picture_field" field.

func (*GalleryContentTypeUpdate) Where

Where appends a list predicates to the GalleryContentTypeUpdate builder.

type GalleryContentTypeUpdateOne

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

GalleryContentTypeUpdateOne is the builder for updating a single GalleryContentType entity.

func (*GalleryContentTypeUpdateOne) ClearContentType

ClearContentType clears the "content_type" edge to the ContentTypeDef entity.

func (*GalleryContentTypeUpdateOne) Exec

Exec executes the query on the entity.

func (*GalleryContentTypeUpdateOne) ExecX

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

func (*GalleryContentTypeUpdateOne) Mutation

Mutation returns the GalleryContentTypeMutation object of the builder.

func (*GalleryContentTypeUpdateOne) Save

Save executes the query and returns the updated GalleryContentType entity.

func (*GalleryContentTypeUpdateOne) SaveX

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

func (*GalleryContentTypeUpdateOne) Select

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

func (*GalleryContentTypeUpdateOne) SetContentType

SetContentType sets the "content_type" edge to the ContentTypeDef entity.

func (*GalleryContentTypeUpdateOne) SetContentTypeID

SetContentTypeID sets the "content_type_id" field.

func (*GalleryContentTypeUpdateOne) SetDefaultEnabled

SetDefaultEnabled sets the "default_enabled" field.

func (*GalleryContentTypeUpdateOne) SetNillableContentTypeID

func (_u *GalleryContentTypeUpdateOne) SetNillableContentTypeID(v *int) *GalleryContentTypeUpdateOne

SetNillableContentTypeID sets the "content_type_id" field if the given value is not nil.

func (*GalleryContentTypeUpdateOne) SetNillableDefaultEnabled

func (_u *GalleryContentTypeUpdateOne) SetNillableDefaultEnabled(v *bool) *GalleryContentTypeUpdateOne

SetNillableDefaultEnabled sets the "default_enabled" field if the given value is not nil.

func (*GalleryContentTypeUpdateOne) SetNillablePictureField

func (_u *GalleryContentTypeUpdateOne) SetNillablePictureField(v *string) *GalleryContentTypeUpdateOne

SetNillablePictureField sets the "picture_field" field if the given value is not nil.

func (*GalleryContentTypeUpdateOne) SetPictureField

SetPictureField sets the "picture_field" field.

func (*GalleryContentTypeUpdateOne) Where

Where appends a list predicates to the GalleryContentTypeUpdate builder.

type GalleryContentTypes

type GalleryContentTypes []*GalleryContentType

GalleryContentTypes is a parsable slice of GalleryContentType.

type GalleryCreate

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

GalleryCreate is the builder for creating a Gallery entity.

func (*GalleryCreate) AddItemIDs

func (_c *GalleryCreate) AddItemIDs(ids ...int) *GalleryCreate

AddItemIDs adds the "items" edge to the GalleryItem entity by IDs.

func (*GalleryCreate) AddItems

func (_c *GalleryCreate) AddItems(v ...*GalleryItem) *GalleryCreate

AddItems adds the "items" edges to the GalleryItem entity.

func (*GalleryCreate) Exec

func (_c *GalleryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryCreate) ExecX

func (_c *GalleryCreate) ExecX(ctx context.Context)

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

func (*GalleryCreate) Mutation

func (_c *GalleryCreate) Mutation() *GalleryMutation

Mutation returns the GalleryMutation object of the builder.

func (*GalleryCreate) Save

func (_c *GalleryCreate) Save(ctx context.Context) (*Gallery, error)

Save creates the Gallery in the database.

func (*GalleryCreate) SaveX

func (_c *GalleryCreate) SaveX(ctx context.Context) *Gallery

SaveX calls Save and panics if Save returns an error.

func (*GalleryCreate) SetCreatedAt

func (_c *GalleryCreate) SetCreatedAt(v time.Time) *GalleryCreate

SetCreatedAt sets the "created_at" field.

func (*GalleryCreate) SetDescription

func (_c *GalleryCreate) SetDescription(v string) *GalleryCreate

SetDescription sets the "description" field.

func (*GalleryCreate) SetID

func (_c *GalleryCreate) SetID(v int) *GalleryCreate

SetID sets the "id" field.

func (*GalleryCreate) SetNid

func (_c *GalleryCreate) SetNid(v int) *GalleryCreate

SetNid sets the "nid" field.

func (*GalleryCreate) SetNillableCreatedAt

func (_c *GalleryCreate) SetNillableCreatedAt(v *time.Time) *GalleryCreate

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

func (*GalleryCreate) SetNillableDescription

func (_c *GalleryCreate) SetNillableDescription(v *string) *GalleryCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GalleryCreate) SetNillablePreviewMediumStyle

func (_c *GalleryCreate) SetNillablePreviewMediumStyle(v *string) *GalleryCreate

SetNillablePreviewMediumStyle sets the "preview_medium_style" field if the given value is not nil.

func (*GalleryCreate) SetNillablePreviewSmallStyle

func (_c *GalleryCreate) SetNillablePreviewSmallStyle(v *string) *GalleryCreate

SetNillablePreviewSmallStyle sets the "preview_small_style" field if the given value is not nil.

func (*GalleryCreate) SetNillableStatus

func (_c *GalleryCreate) SetNillableStatus(v *bool) *GalleryCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*GalleryCreate) SetNillableTitle

func (_c *GalleryCreate) SetNillableTitle(v *string) *GalleryCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*GalleryCreate) SetNillableUpdatedAt

func (_c *GalleryCreate) SetNillableUpdatedAt(v *time.Time) *GalleryCreate

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

func (*GalleryCreate) SetNillableWeight

func (_c *GalleryCreate) SetNillableWeight(v *int) *GalleryCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*GalleryCreate) SetNode

func (_c *GalleryCreate) SetNode(v *Node) *GalleryCreate

SetNode sets the "node" edge to the Node entity.

func (*GalleryCreate) SetNodeID

func (_c *GalleryCreate) SetNodeID(id int) *GalleryCreate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*GalleryCreate) SetPreviewMediumStyle

func (_c *GalleryCreate) SetPreviewMediumStyle(v string) *GalleryCreate

SetPreviewMediumStyle sets the "preview_medium_style" field.

func (*GalleryCreate) SetPreviewSmallStyle

func (_c *GalleryCreate) SetPreviewSmallStyle(v string) *GalleryCreate

SetPreviewSmallStyle sets the "preview_small_style" field.

func (*GalleryCreate) SetStatus

func (_c *GalleryCreate) SetStatus(v bool) *GalleryCreate

SetStatus sets the "status" field.

func (*GalleryCreate) SetTitle

func (_c *GalleryCreate) SetTitle(v string) *GalleryCreate

SetTitle sets the "title" field.

func (*GalleryCreate) SetUpdatedAt

func (_c *GalleryCreate) SetUpdatedAt(v time.Time) *GalleryCreate

SetUpdatedAt sets the "updated_at" field.

func (*GalleryCreate) SetWeight

func (_c *GalleryCreate) SetWeight(v int) *GalleryCreate

SetWeight sets the "weight" field.

type GalleryCreateBulk

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

GalleryCreateBulk is the builder for creating many Gallery entities in bulk.

func (*GalleryCreateBulk) Exec

func (_c *GalleryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryCreateBulk) ExecX

func (_c *GalleryCreateBulk) ExecX(ctx context.Context)

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

func (*GalleryCreateBulk) Save

func (_c *GalleryCreateBulk) Save(ctx context.Context) ([]*Gallery, error)

Save creates the Gallery entities in the database.

func (*GalleryCreateBulk) SaveX

func (_c *GalleryCreateBulk) SaveX(ctx context.Context) []*Gallery

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

type GalleryDelete

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

GalleryDelete is the builder for deleting a Gallery entity.

func (*GalleryDelete) Exec

func (_d *GalleryDelete) Exec(ctx context.Context) (int, error)

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

func (*GalleryDelete) ExecX

func (_d *GalleryDelete) ExecX(ctx context.Context) int

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

func (*GalleryDelete) Where

func (_d *GalleryDelete) Where(ps ...predicate.Gallery) *GalleryDelete

Where appends a list predicates to the GalleryDelete builder.

type GalleryDeleteOne

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

GalleryDeleteOne is the builder for deleting a single Gallery entity.

func (*GalleryDeleteOne) Exec

func (_d *GalleryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GalleryDeleteOne) ExecX

func (_d *GalleryDeleteOne) ExecX(ctx context.Context)

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

func (*GalleryDeleteOne) Where

Where appends a list predicates to the GalleryDelete builder.

type GalleryEdges

type GalleryEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// Items holds the value of the items edge.
	Items []*GalleryItem `json:"items,omitempty"`
	// contains filtered or unexported fields
}

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

func (GalleryEdges) ItemsOrErr

func (e GalleryEdges) ItemsOrErr() ([]*GalleryItem, error)

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

func (GalleryEdges) NodeOrErr

func (e GalleryEdges) NodeOrErr() (*Node, error)

NodeOrErr returns the Node value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GalleryGroupBy

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

GalleryGroupBy is the group-by builder for Gallery entities.

func (*GalleryGroupBy) Aggregate

func (_g *GalleryGroupBy) Aggregate(fns ...AggregateFunc) *GalleryGroupBy

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

func (*GalleryGroupBy) Bool

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

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

func (*GalleryGroupBy) BoolX

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

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

func (*GalleryGroupBy) Bools

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

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

func (*GalleryGroupBy) BoolsX

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

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

func (*GalleryGroupBy) Float64

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

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

func (*GalleryGroupBy) Float64X

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

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

func (*GalleryGroupBy) Float64s

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

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

func (*GalleryGroupBy) Float64sX

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

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

func (*GalleryGroupBy) Int

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

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

func (*GalleryGroupBy) IntX

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

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

func (*GalleryGroupBy) Ints

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

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

func (*GalleryGroupBy) IntsX

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

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

func (*GalleryGroupBy) Scan

func (_g *GalleryGroupBy) Scan(ctx context.Context, v any) error

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

func (*GalleryGroupBy) ScanX

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

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

func (*GalleryGroupBy) String

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

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

func (*GalleryGroupBy) StringX

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

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

func (*GalleryGroupBy) Strings

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

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

func (*GalleryGroupBy) StringsX

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

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

type GalleryItem

type GalleryItem struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// The gallery (galleries.id)
	GalleryID int `json:"gallery_id,omitempty"`
	// The image file (files.id)
	Fid int `json:"fid,omitempty"`
	// The image's title
	Title string `json:"title,omitempty"`
	// The image's description
	Description string `json:"description,omitempty"`
	// The image's position in the gallery
	Weight int `json:"weight,omitempty"`
	// Whether the image is the gallery's cover
	IsCover bool `json:"is_cover,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GalleryItemQuery when eager-loading is set.
	Edges GalleryItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

GalleryItem is the model entity for the GalleryItem schema.

func (*GalleryItem) QueryFile

func (_m *GalleryItem) QueryFile() *FileQuery

QueryFile queries the "file" edge of the GalleryItem entity.

func (*GalleryItem) QueryGallery

func (_m *GalleryItem) QueryGallery() *GalleryQuery

QueryGallery queries the "gallery" edge of the GalleryItem entity.

func (*GalleryItem) String

func (_m *GalleryItem) String() string

String implements the fmt.Stringer.

func (*GalleryItem) Unwrap

func (_m *GalleryItem) Unwrap() *GalleryItem

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

func (_m *GalleryItem) Update() *GalleryItemUpdateOne

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

func (*GalleryItem) Value

func (_m *GalleryItem) Value(name string) (ent.Value, error)

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

type GalleryItemClient

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

GalleryItemClient is a client for the GalleryItem schema.

func NewGalleryItemClient

func NewGalleryItemClient(c config) *GalleryItemClient

NewGalleryItemClient returns a client for the GalleryItem from the given config.

func (*GalleryItemClient) Create

func (c *GalleryItemClient) Create() *GalleryItemCreate

Create returns a builder for creating a GalleryItem entity.

func (*GalleryItemClient) CreateBulk

func (c *GalleryItemClient) CreateBulk(builders ...*GalleryItemCreate) *GalleryItemCreateBulk

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

func (*GalleryItemClient) Delete

func (c *GalleryItemClient) Delete() *GalleryItemDelete

Delete returns a delete builder for GalleryItem.

func (*GalleryItemClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GalleryItemClient) DeleteOneID

func (c *GalleryItemClient) DeleteOneID(id int) *GalleryItemDeleteOne

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

func (*GalleryItemClient) Get

func (c *GalleryItemClient) Get(ctx context.Context, id int) (*GalleryItem, error)

Get returns a GalleryItem entity by its id.

func (*GalleryItemClient) GetX

func (c *GalleryItemClient) GetX(ctx context.Context, id int) *GalleryItem

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

func (*GalleryItemClient) Hooks

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

Hooks returns the client hooks.

func (*GalleryItemClient) Intercept

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

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

func (*GalleryItemClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GalleryItemClient) MapCreateBulk

func (c *GalleryItemClient) MapCreateBulk(slice any, setFunc func(*GalleryItemCreate, int)) *GalleryItemCreateBulk

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 (*GalleryItemClient) Query

func (c *GalleryItemClient) Query() *GalleryItemQuery

Query returns a query builder for GalleryItem.

func (*GalleryItemClient) QueryFile

func (c *GalleryItemClient) QueryFile(_m *GalleryItem) *FileQuery

QueryFile queries the file edge of a GalleryItem.

func (*GalleryItemClient) QueryGallery

func (c *GalleryItemClient) QueryGallery(_m *GalleryItem) *GalleryQuery

QueryGallery queries the gallery edge of a GalleryItem.

func (*GalleryItemClient) Update

func (c *GalleryItemClient) Update() *GalleryItemUpdate

Update returns an update builder for GalleryItem.

func (*GalleryItemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GalleryItemClient) UpdateOneID

func (c *GalleryItemClient) UpdateOneID(id int) *GalleryItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GalleryItemClient) Use

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

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

type GalleryItemCreate

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

GalleryItemCreate is the builder for creating a GalleryItem entity.

func (*GalleryItemCreate) Exec

func (_c *GalleryItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryItemCreate) ExecX

func (_c *GalleryItemCreate) ExecX(ctx context.Context)

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

func (*GalleryItemCreate) Mutation

func (_c *GalleryItemCreate) Mutation() *GalleryItemMutation

Mutation returns the GalleryItemMutation object of the builder.

func (*GalleryItemCreate) Save

Save creates the GalleryItem in the database.

func (*GalleryItemCreate) SaveX

func (_c *GalleryItemCreate) SaveX(ctx context.Context) *GalleryItem

SaveX calls Save and panics if Save returns an error.

func (*GalleryItemCreate) SetCreatedAt

func (_c *GalleryItemCreate) SetCreatedAt(v time.Time) *GalleryItemCreate

SetCreatedAt sets the "created_at" field.

func (*GalleryItemCreate) SetDescription

func (_c *GalleryItemCreate) SetDescription(v string) *GalleryItemCreate

SetDescription sets the "description" field.

func (*GalleryItemCreate) SetFid

func (_c *GalleryItemCreate) SetFid(v int) *GalleryItemCreate

SetFid sets the "fid" field.

func (*GalleryItemCreate) SetFile

func (_c *GalleryItemCreate) SetFile(v *File) *GalleryItemCreate

SetFile sets the "file" edge to the File entity.

func (*GalleryItemCreate) SetFileID

func (_c *GalleryItemCreate) SetFileID(id int) *GalleryItemCreate

SetFileID sets the "file" edge to the File entity by ID.

func (*GalleryItemCreate) SetGallery

func (_c *GalleryItemCreate) SetGallery(v *Gallery) *GalleryItemCreate

SetGallery sets the "gallery" edge to the Gallery entity.

func (*GalleryItemCreate) SetGalleryID

func (_c *GalleryItemCreate) SetGalleryID(v int) *GalleryItemCreate

SetGalleryID sets the "gallery_id" field.

func (*GalleryItemCreate) SetID

func (_c *GalleryItemCreate) SetID(v int) *GalleryItemCreate

SetID sets the "id" field.

func (*GalleryItemCreate) SetIsCover

func (_c *GalleryItemCreate) SetIsCover(v bool) *GalleryItemCreate

SetIsCover sets the "is_cover" field.

func (*GalleryItemCreate) SetNillableCreatedAt

func (_c *GalleryItemCreate) SetNillableCreatedAt(v *time.Time) *GalleryItemCreate

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

func (*GalleryItemCreate) SetNillableDescription

func (_c *GalleryItemCreate) SetNillableDescription(v *string) *GalleryItemCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GalleryItemCreate) SetNillableIsCover

func (_c *GalleryItemCreate) SetNillableIsCover(v *bool) *GalleryItemCreate

SetNillableIsCover sets the "is_cover" field if the given value is not nil.

func (*GalleryItemCreate) SetNillableTitle

func (_c *GalleryItemCreate) SetNillableTitle(v *string) *GalleryItemCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*GalleryItemCreate) SetNillableWeight

func (_c *GalleryItemCreate) SetNillableWeight(v *int) *GalleryItemCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*GalleryItemCreate) SetTitle

func (_c *GalleryItemCreate) SetTitle(v string) *GalleryItemCreate

SetTitle sets the "title" field.

func (*GalleryItemCreate) SetWeight

func (_c *GalleryItemCreate) SetWeight(v int) *GalleryItemCreate

SetWeight sets the "weight" field.

type GalleryItemCreateBulk

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

GalleryItemCreateBulk is the builder for creating many GalleryItem entities in bulk.

func (*GalleryItemCreateBulk) Exec

Exec executes the query.

func (*GalleryItemCreateBulk) ExecX

func (_c *GalleryItemCreateBulk) ExecX(ctx context.Context)

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

func (*GalleryItemCreateBulk) Save

Save creates the GalleryItem entities in the database.

func (*GalleryItemCreateBulk) SaveX

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

type GalleryItemDelete

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

GalleryItemDelete is the builder for deleting a GalleryItem entity.

func (*GalleryItemDelete) Exec

func (_d *GalleryItemDelete) Exec(ctx context.Context) (int, error)

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

func (*GalleryItemDelete) ExecX

func (_d *GalleryItemDelete) ExecX(ctx context.Context) int

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

func (*GalleryItemDelete) Where

Where appends a list predicates to the GalleryItemDelete builder.

type GalleryItemDeleteOne

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

GalleryItemDeleteOne is the builder for deleting a single GalleryItem entity.

func (*GalleryItemDeleteOne) Exec

func (_d *GalleryItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GalleryItemDeleteOne) ExecX

func (_d *GalleryItemDeleteOne) ExecX(ctx context.Context)

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

func (*GalleryItemDeleteOne) Where

Where appends a list predicates to the GalleryItemDelete builder.

type GalleryItemEdges

type GalleryItemEdges struct {
	// Gallery holds the value of the gallery edge.
	Gallery *Gallery `json:"gallery,omitempty"`
	// File holds the value of the file edge.
	File *File `json:"file,omitempty"`
	// contains filtered or unexported fields
}

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

func (GalleryItemEdges) FileOrErr

func (e GalleryItemEdges) FileOrErr() (*File, error)

FileOrErr returns the File value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GalleryItemEdges) GalleryOrErr

func (e GalleryItemEdges) GalleryOrErr() (*Gallery, error)

GalleryOrErr returns the Gallery value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GalleryItemGroupBy

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

GalleryItemGroupBy is the group-by builder for GalleryItem entities.

func (*GalleryItemGroupBy) Aggregate

func (_g *GalleryItemGroupBy) Aggregate(fns ...AggregateFunc) *GalleryItemGroupBy

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

func (*GalleryItemGroupBy) Bool

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

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

func (*GalleryItemGroupBy) BoolX

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

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

func (*GalleryItemGroupBy) Bools

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

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

func (*GalleryItemGroupBy) BoolsX

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

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

func (*GalleryItemGroupBy) Float64

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

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

func (*GalleryItemGroupBy) Float64X

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

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

func (*GalleryItemGroupBy) Float64s

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

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

func (*GalleryItemGroupBy) Float64sX

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

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

func (*GalleryItemGroupBy) Int

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

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

func (*GalleryItemGroupBy) IntX

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

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

func (*GalleryItemGroupBy) Ints

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

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

func (*GalleryItemGroupBy) IntsX

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

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

func (*GalleryItemGroupBy) Scan

func (_g *GalleryItemGroupBy) Scan(ctx context.Context, v any) error

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

func (*GalleryItemGroupBy) ScanX

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

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

func (*GalleryItemGroupBy) String

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

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

func (*GalleryItemGroupBy) StringX

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

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

func (*GalleryItemGroupBy) Strings

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

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

func (*GalleryItemGroupBy) StringsX

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

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

type GalleryItemMutation

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

GalleryItemMutation represents an operation that mutates the GalleryItem nodes in the graph.

func (*GalleryItemMutation) AddField

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) AddWeight

func (m *GalleryItemMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*GalleryItemMutation) AddedEdges

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

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

func (*GalleryItemMutation) AddedField

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

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

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

func (*GalleryItemMutation) AddedIDs

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

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

func (*GalleryItemMutation) AddedWeight

func (m *GalleryItemMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*GalleryItemMutation) ClearDescription

func (m *GalleryItemMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*GalleryItemMutation) ClearEdge

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

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) ClearFile

func (m *GalleryItemMutation) ClearFile()

ClearFile clears the "file" edge to the File entity.

func (*GalleryItemMutation) ClearGallery

func (m *GalleryItemMutation) ClearGallery()

ClearGallery clears the "gallery" edge to the Gallery entity.

func (*GalleryItemMutation) ClearTitle

func (m *GalleryItemMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*GalleryItemMutation) ClearWeight

func (m *GalleryItemMutation) ClearWeight()

ClearWeight clears the value of the "weight" field.

func (*GalleryItemMutation) ClearedEdges

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

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

func (*GalleryItemMutation) ClearedFields

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

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

func (GalleryItemMutation) Client

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

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

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

func (*GalleryItemMutation) Description

func (m *GalleryItemMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*GalleryItemMutation) DescriptionCleared

func (m *GalleryItemMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*GalleryItemMutation) EdgeCleared

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

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

func (*GalleryItemMutation) Fid

func (m *GalleryItemMutation) Fid() (r int, exists bool)

Fid returns the value of the "fid" field in the mutation.

func (*GalleryItemMutation) Field

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

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

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

func (*GalleryItemMutation) Fields

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) FileCleared

func (m *GalleryItemMutation) FileCleared() bool

FileCleared reports if the "file" edge to the File entity was cleared.

func (*GalleryItemMutation) FileID

func (m *GalleryItemMutation) FileID() (id int, exists bool)

FileID returns the "file" edge ID in the mutation.

func (*GalleryItemMutation) FileIDs

func (m *GalleryItemMutation) FileIDs() (ids []int)

FileIDs returns the "file" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FileID instead. It exists only for internal usage by the builders.

func (*GalleryItemMutation) GalleryCleared

func (m *GalleryItemMutation) GalleryCleared() bool

GalleryCleared reports if the "gallery" edge to the Gallery entity was cleared.

func (*GalleryItemMutation) GalleryID

func (m *GalleryItemMutation) GalleryID() (r int, exists bool)

GalleryID returns the value of the "gallery_id" field in the mutation.

func (*GalleryItemMutation) GalleryIDs

func (m *GalleryItemMutation) GalleryIDs() (ids []int)

GalleryIDs returns the "gallery" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GalleryID instead. It exists only for internal usage by the builders.

func (*GalleryItemMutation) ID

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

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) IsCover

func (m *GalleryItemMutation) IsCover() (r bool, exists bool)

IsCover returns the value of the "is_cover" field in the mutation.

func (*GalleryItemMutation) OldCreatedAt

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

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

func (m *GalleryItemMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the GalleryItem entity. If the GalleryItem 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 (*GalleryItemMutation) OldFid

func (m *GalleryItemMutation) OldFid(ctx context.Context) (v int, err error)

OldFid returns the old "fid" field's value of the GalleryItem entity. If the GalleryItem 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 (*GalleryItemMutation) OldField

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) OldGalleryID

func (m *GalleryItemMutation) OldGalleryID(ctx context.Context) (v int, err error)

OldGalleryID returns the old "gallery_id" field's value of the GalleryItem entity. If the GalleryItem 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 (*GalleryItemMutation) OldIsCover

func (m *GalleryItemMutation) OldIsCover(ctx context.Context) (v bool, err error)

OldIsCover returns the old "is_cover" field's value of the GalleryItem entity. If the GalleryItem 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 (*GalleryItemMutation) OldTitle

func (m *GalleryItemMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the GalleryItem entity. If the GalleryItem 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 (*GalleryItemMutation) OldWeight

func (m *GalleryItemMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the GalleryItem entity. If the GalleryItem 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 (*GalleryItemMutation) Op

func (m *GalleryItemMutation) Op() Op

Op returns the operation name.

func (*GalleryItemMutation) RemovedEdges

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

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

func (*GalleryItemMutation) RemovedIDs

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) ResetCreatedAt

func (m *GalleryItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GalleryItemMutation) ResetDescription

func (m *GalleryItemMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GalleryItemMutation) ResetEdge

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) ResetFid

func (m *GalleryItemMutation) ResetFid()

ResetFid resets all changes to the "fid" field.

func (*GalleryItemMutation) ResetField

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) ResetFile

func (m *GalleryItemMutation) ResetFile()

ResetFile resets all changes to the "file" edge.

func (*GalleryItemMutation) ResetGallery

func (m *GalleryItemMutation) ResetGallery()

ResetGallery resets all changes to the "gallery" edge.

func (*GalleryItemMutation) ResetGalleryID

func (m *GalleryItemMutation) ResetGalleryID()

ResetGalleryID resets all changes to the "gallery_id" field.

func (*GalleryItemMutation) ResetIsCover

func (m *GalleryItemMutation) ResetIsCover()

ResetIsCover resets all changes to the "is_cover" field.

func (*GalleryItemMutation) ResetTitle

func (m *GalleryItemMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*GalleryItemMutation) ResetWeight

func (m *GalleryItemMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*GalleryItemMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GalleryItemMutation) SetDescription

func (m *GalleryItemMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GalleryItemMutation) SetFid

func (m *GalleryItemMutation) SetFid(i int)

SetFid sets the "fid" field.

func (*GalleryItemMutation) SetField

func (m *GalleryItemMutation) 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 (*GalleryItemMutation) SetFileID

func (m *GalleryItemMutation) SetFileID(id int)

SetFileID sets the "file" edge to the File entity by id.

func (*GalleryItemMutation) SetGalleryID

func (m *GalleryItemMutation) SetGalleryID(i int)

SetGalleryID sets the "gallery_id" field.

func (*GalleryItemMutation) SetID

func (m *GalleryItemMutation) SetID(id int)

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

func (*GalleryItemMutation) SetIsCover

func (m *GalleryItemMutation) SetIsCover(b bool)

SetIsCover sets the "is_cover" field.

func (*GalleryItemMutation) SetOp

func (m *GalleryItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GalleryItemMutation) SetTitle

func (m *GalleryItemMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*GalleryItemMutation) SetWeight

func (m *GalleryItemMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (*GalleryItemMutation) Title

func (m *GalleryItemMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*GalleryItemMutation) TitleCleared

func (m *GalleryItemMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (GalleryItemMutation) Tx

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

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

func (*GalleryItemMutation) Type

func (m *GalleryItemMutation) Type() string

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

func (*GalleryItemMutation) Weight

func (m *GalleryItemMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*GalleryItemMutation) WeightCleared

func (m *GalleryItemMutation) WeightCleared() bool

WeightCleared returns if the "weight" field was cleared in this mutation.

func (*GalleryItemMutation) Where

func (m *GalleryItemMutation) Where(ps ...predicate.GalleryItem)

Where appends a list predicates to the GalleryItemMutation builder.

func (*GalleryItemMutation) WhereP

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

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

type GalleryItemQuery

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

GalleryItemQuery is the builder for querying GalleryItem entities.

func (*GalleryItemQuery) Aggregate

func (_q *GalleryItemQuery) Aggregate(fns ...AggregateFunc) *GalleryItemSelect

Aggregate returns a GalleryItemSelect configured with the given aggregations.

func (*GalleryItemQuery) All

func (_q *GalleryItemQuery) All(ctx context.Context) ([]*GalleryItem, error)

All executes the query and returns a list of GalleryItems.

func (*GalleryItemQuery) AllX

func (_q *GalleryItemQuery) AllX(ctx context.Context) []*GalleryItem

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

func (*GalleryItemQuery) Clone

func (_q *GalleryItemQuery) Clone() *GalleryItemQuery

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

func (*GalleryItemQuery) Count

func (_q *GalleryItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GalleryItemQuery) CountX

func (_q *GalleryItemQuery) CountX(ctx context.Context) int

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

func (*GalleryItemQuery) Exist

func (_q *GalleryItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*GalleryItemQuery) ExistX

func (_q *GalleryItemQuery) ExistX(ctx context.Context) bool

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

func (*GalleryItemQuery) First

func (_q *GalleryItemQuery) First(ctx context.Context) (*GalleryItem, error)

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

func (*GalleryItemQuery) FirstID

func (_q *GalleryItemQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*GalleryItemQuery) FirstIDX

func (_q *GalleryItemQuery) FirstIDX(ctx context.Context) int

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

func (*GalleryItemQuery) FirstX

func (_q *GalleryItemQuery) FirstX(ctx context.Context) *GalleryItem

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

func (*GalleryItemQuery) GroupBy

func (_q *GalleryItemQuery) GroupBy(field string, fields ...string) *GalleryItemGroupBy

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 {
	GalleryID int `json:"gallery_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GalleryItem.Query().
	GroupBy(galleryitem.FieldGalleryID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*GalleryItemQuery) IDs

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

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

func (*GalleryItemQuery) IDsX

func (_q *GalleryItemQuery) IDsX(ctx context.Context) []int

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

func (*GalleryItemQuery) Limit

func (_q *GalleryItemQuery) Limit(limit int) *GalleryItemQuery

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

func (*GalleryItemQuery) Offset

func (_q *GalleryItemQuery) Offset(offset int) *GalleryItemQuery

Offset to start from.

func (*GalleryItemQuery) Only

func (_q *GalleryItemQuery) Only(ctx context.Context) (*GalleryItem, error)

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

func (*GalleryItemQuery) OnlyID

func (_q *GalleryItemQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*GalleryItemQuery) OnlyIDX

func (_q *GalleryItemQuery) OnlyIDX(ctx context.Context) int

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

func (*GalleryItemQuery) OnlyX

func (_q *GalleryItemQuery) OnlyX(ctx context.Context) *GalleryItem

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

func (*GalleryItemQuery) Order

Order specifies how the records should be ordered.

func (*GalleryItemQuery) QueryFile

func (_q *GalleryItemQuery) QueryFile() *FileQuery

QueryFile chains the current query on the "file" edge.

func (*GalleryItemQuery) QueryGallery

func (_q *GalleryItemQuery) QueryGallery() *GalleryQuery

QueryGallery chains the current query on the "gallery" edge.

func (*GalleryItemQuery) Select

func (_q *GalleryItemQuery) Select(fields ...string) *GalleryItemSelect

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 {
	GalleryID int `json:"gallery_id,omitempty"`
}

client.GalleryItem.Query().
	Select(galleryitem.FieldGalleryID).
	Scan(ctx, &v)

func (*GalleryItemQuery) Unique

func (_q *GalleryItemQuery) Unique(unique bool) *GalleryItemQuery

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

Where adds a new predicate for the GalleryItemQuery builder.

func (*GalleryItemQuery) WithFile

func (_q *GalleryItemQuery) WithFile(opts ...func(*FileQuery)) *GalleryItemQuery

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

func (*GalleryItemQuery) WithGallery

func (_q *GalleryItemQuery) WithGallery(opts ...func(*GalleryQuery)) *GalleryItemQuery

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

type GalleryItemSelect

type GalleryItemSelect struct {
	*GalleryItemQuery
	// contains filtered or unexported fields
}

GalleryItemSelect is the builder for selecting fields of GalleryItem entities.

func (*GalleryItemSelect) Aggregate

func (_s *GalleryItemSelect) Aggregate(fns ...AggregateFunc) *GalleryItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GalleryItemSelect) Bool

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

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

func (*GalleryItemSelect) BoolX

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

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

func (*GalleryItemSelect) Bools

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

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

func (*GalleryItemSelect) BoolsX

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

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

func (*GalleryItemSelect) Float64

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

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

func (*GalleryItemSelect) Float64X

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

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

func (*GalleryItemSelect) Float64s

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

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

func (*GalleryItemSelect) Float64sX

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

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

func (*GalleryItemSelect) Int

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

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

func (*GalleryItemSelect) IntX

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

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

func (*GalleryItemSelect) Ints

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

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

func (*GalleryItemSelect) IntsX

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

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

func (*GalleryItemSelect) Scan

func (_s *GalleryItemSelect) Scan(ctx context.Context, v any) error

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

func (*GalleryItemSelect) ScanX

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

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

func (*GalleryItemSelect) String

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

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

func (*GalleryItemSelect) StringX

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

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

func (*GalleryItemSelect) Strings

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

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

func (*GalleryItemSelect) StringsX

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

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

type GalleryItemUpdate

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

GalleryItemUpdate is the builder for updating GalleryItem entities.

func (*GalleryItemUpdate) AddWeight

func (_u *GalleryItemUpdate) AddWeight(v int) *GalleryItemUpdate

AddWeight adds value to the "weight" field.

func (*GalleryItemUpdate) ClearDescription

func (_u *GalleryItemUpdate) ClearDescription() *GalleryItemUpdate

ClearDescription clears the value of the "description" field.

func (*GalleryItemUpdate) ClearFile

func (_u *GalleryItemUpdate) ClearFile() *GalleryItemUpdate

ClearFile clears the "file" edge to the File entity.

func (*GalleryItemUpdate) ClearGallery

func (_u *GalleryItemUpdate) ClearGallery() *GalleryItemUpdate

ClearGallery clears the "gallery" edge to the Gallery entity.

func (*GalleryItemUpdate) ClearTitle

func (_u *GalleryItemUpdate) ClearTitle() *GalleryItemUpdate

ClearTitle clears the value of the "title" field.

func (*GalleryItemUpdate) ClearWeight

func (_u *GalleryItemUpdate) ClearWeight() *GalleryItemUpdate

ClearWeight clears the value of the "weight" field.

func (*GalleryItemUpdate) Exec

func (_u *GalleryItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryItemUpdate) ExecX

func (_u *GalleryItemUpdate) ExecX(ctx context.Context)

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

func (*GalleryItemUpdate) Mutation

func (_u *GalleryItemUpdate) Mutation() *GalleryItemMutation

Mutation returns the GalleryItemMutation object of the builder.

func (*GalleryItemUpdate) Save

func (_u *GalleryItemUpdate) Save(ctx context.Context) (int, error)

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

func (*GalleryItemUpdate) SaveX

func (_u *GalleryItemUpdate) SaveX(ctx context.Context) int

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

func (*GalleryItemUpdate) SetDescription

func (_u *GalleryItemUpdate) SetDescription(v string) *GalleryItemUpdate

SetDescription sets the "description" field.

func (*GalleryItemUpdate) SetFid

func (_u *GalleryItemUpdate) SetFid(v int) *GalleryItemUpdate

SetFid sets the "fid" field.

func (*GalleryItemUpdate) SetFile

func (_u *GalleryItemUpdate) SetFile(v *File) *GalleryItemUpdate

SetFile sets the "file" edge to the File entity.

func (*GalleryItemUpdate) SetFileID

func (_u *GalleryItemUpdate) SetFileID(id int) *GalleryItemUpdate

SetFileID sets the "file" edge to the File entity by ID.

func (*GalleryItemUpdate) SetGallery

func (_u *GalleryItemUpdate) SetGallery(v *Gallery) *GalleryItemUpdate

SetGallery sets the "gallery" edge to the Gallery entity.

func (*GalleryItemUpdate) SetGalleryID

func (_u *GalleryItemUpdate) SetGalleryID(v int) *GalleryItemUpdate

SetGalleryID sets the "gallery_id" field.

func (*GalleryItemUpdate) SetIsCover

func (_u *GalleryItemUpdate) SetIsCover(v bool) *GalleryItemUpdate

SetIsCover sets the "is_cover" field.

func (*GalleryItemUpdate) SetNillableDescription

func (_u *GalleryItemUpdate) SetNillableDescription(v *string) *GalleryItemUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GalleryItemUpdate) SetNillableFid

func (_u *GalleryItemUpdate) SetNillableFid(v *int) *GalleryItemUpdate

SetNillableFid sets the "fid" field if the given value is not nil.

func (*GalleryItemUpdate) SetNillableGalleryID

func (_u *GalleryItemUpdate) SetNillableGalleryID(v *int) *GalleryItemUpdate

SetNillableGalleryID sets the "gallery_id" field if the given value is not nil.

func (*GalleryItemUpdate) SetNillableIsCover

func (_u *GalleryItemUpdate) SetNillableIsCover(v *bool) *GalleryItemUpdate

SetNillableIsCover sets the "is_cover" field if the given value is not nil.

func (*GalleryItemUpdate) SetNillableTitle

func (_u *GalleryItemUpdate) SetNillableTitle(v *string) *GalleryItemUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*GalleryItemUpdate) SetNillableWeight

func (_u *GalleryItemUpdate) SetNillableWeight(v *int) *GalleryItemUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*GalleryItemUpdate) SetTitle

func (_u *GalleryItemUpdate) SetTitle(v string) *GalleryItemUpdate

SetTitle sets the "title" field.

func (*GalleryItemUpdate) SetWeight

func (_u *GalleryItemUpdate) SetWeight(v int) *GalleryItemUpdate

SetWeight sets the "weight" field.

func (*GalleryItemUpdate) Where

Where appends a list predicates to the GalleryItemUpdate builder.

type GalleryItemUpdateOne

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

GalleryItemUpdateOne is the builder for updating a single GalleryItem entity.

func (*GalleryItemUpdateOne) AddWeight

func (_u *GalleryItemUpdateOne) AddWeight(v int) *GalleryItemUpdateOne

AddWeight adds value to the "weight" field.

func (*GalleryItemUpdateOne) ClearDescription

func (_u *GalleryItemUpdateOne) ClearDescription() *GalleryItemUpdateOne

ClearDescription clears the value of the "description" field.

func (*GalleryItemUpdateOne) ClearFile

func (_u *GalleryItemUpdateOne) ClearFile() *GalleryItemUpdateOne

ClearFile clears the "file" edge to the File entity.

func (*GalleryItemUpdateOne) ClearGallery

func (_u *GalleryItemUpdateOne) ClearGallery() *GalleryItemUpdateOne

ClearGallery clears the "gallery" edge to the Gallery entity.

func (*GalleryItemUpdateOne) ClearTitle

func (_u *GalleryItemUpdateOne) ClearTitle() *GalleryItemUpdateOne

ClearTitle clears the value of the "title" field.

func (*GalleryItemUpdateOne) ClearWeight

func (_u *GalleryItemUpdateOne) ClearWeight() *GalleryItemUpdateOne

ClearWeight clears the value of the "weight" field.

func (*GalleryItemUpdateOne) Exec

func (_u *GalleryItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GalleryItemUpdateOne) ExecX

func (_u *GalleryItemUpdateOne) ExecX(ctx context.Context)

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

func (*GalleryItemUpdateOne) Mutation

func (_u *GalleryItemUpdateOne) Mutation() *GalleryItemMutation

Mutation returns the GalleryItemMutation object of the builder.

func (*GalleryItemUpdateOne) Save

Save executes the query and returns the updated GalleryItem entity.

func (*GalleryItemUpdateOne) SaveX

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

func (*GalleryItemUpdateOne) Select

func (_u *GalleryItemUpdateOne) Select(field string, fields ...string) *GalleryItemUpdateOne

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

func (*GalleryItemUpdateOne) SetDescription

func (_u *GalleryItemUpdateOne) SetDescription(v string) *GalleryItemUpdateOne

SetDescription sets the "description" field.

func (*GalleryItemUpdateOne) SetFid

SetFid sets the "fid" field.

func (*GalleryItemUpdateOne) SetFile

SetFile sets the "file" edge to the File entity.

func (*GalleryItemUpdateOne) SetFileID

func (_u *GalleryItemUpdateOne) SetFileID(id int) *GalleryItemUpdateOne

SetFileID sets the "file" edge to the File entity by ID.

func (*GalleryItemUpdateOne) SetGallery

SetGallery sets the "gallery" edge to the Gallery entity.

func (*GalleryItemUpdateOne) SetGalleryID

func (_u *GalleryItemUpdateOne) SetGalleryID(v int) *GalleryItemUpdateOne

SetGalleryID sets the "gallery_id" field.

func (*GalleryItemUpdateOne) SetIsCover

func (_u *GalleryItemUpdateOne) SetIsCover(v bool) *GalleryItemUpdateOne

SetIsCover sets the "is_cover" field.

func (*GalleryItemUpdateOne) SetNillableDescription

func (_u *GalleryItemUpdateOne) SetNillableDescription(v *string) *GalleryItemUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GalleryItemUpdateOne) SetNillableFid

func (_u *GalleryItemUpdateOne) SetNillableFid(v *int) *GalleryItemUpdateOne

SetNillableFid sets the "fid" field if the given value is not nil.

func (*GalleryItemUpdateOne) SetNillableGalleryID

func (_u *GalleryItemUpdateOne) SetNillableGalleryID(v *int) *GalleryItemUpdateOne

SetNillableGalleryID sets the "gallery_id" field if the given value is not nil.

func (*GalleryItemUpdateOne) SetNillableIsCover

func (_u *GalleryItemUpdateOne) SetNillableIsCover(v *bool) *GalleryItemUpdateOne

SetNillableIsCover sets the "is_cover" field if the given value is not nil.

func (*GalleryItemUpdateOne) SetNillableTitle

func (_u *GalleryItemUpdateOne) SetNillableTitle(v *string) *GalleryItemUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*GalleryItemUpdateOne) SetNillableWeight

func (_u *GalleryItemUpdateOne) SetNillableWeight(v *int) *GalleryItemUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*GalleryItemUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*GalleryItemUpdateOne) SetWeight

func (_u *GalleryItemUpdateOne) SetWeight(v int) *GalleryItemUpdateOne

SetWeight sets the "weight" field.

func (*GalleryItemUpdateOne) Where

Where appends a list predicates to the GalleryItemUpdate builder.

type GalleryItems

type GalleryItems []*GalleryItem

GalleryItems is a parsable slice of GalleryItem.

type GalleryMutation

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

GalleryMutation represents an operation that mutates the Gallery nodes in the graph.

func (*GalleryMutation) AddField

func (m *GalleryMutation) 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 (*GalleryMutation) AddItemIDs

func (m *GalleryMutation) AddItemIDs(ids ...int)

AddItemIDs adds the "items" edge to the GalleryItem entity by ids.

func (*GalleryMutation) AddWeight

func (m *GalleryMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*GalleryMutation) AddedEdges

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

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

func (*GalleryMutation) AddedField

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

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

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

func (*GalleryMutation) AddedIDs

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

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

func (*GalleryMutation) AddedWeight

func (m *GalleryMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*GalleryMutation) ClearDescription

func (m *GalleryMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*GalleryMutation) ClearEdge

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

func (m *GalleryMutation) 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 (*GalleryMutation) ClearItems

func (m *GalleryMutation) ClearItems()

ClearItems clears the "items" edge to the GalleryItem entity.

func (*GalleryMutation) ClearNode

func (m *GalleryMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*GalleryMutation) ClearStatus

func (m *GalleryMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*GalleryMutation) ClearTitle

func (m *GalleryMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*GalleryMutation) ClearWeight

func (m *GalleryMutation) ClearWeight()

ClearWeight clears the value of the "weight" field.

func (*GalleryMutation) ClearedEdges

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

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

func (*GalleryMutation) ClearedFields

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

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

func (GalleryMutation) Client

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

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

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

func (*GalleryMutation) Description

func (m *GalleryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*GalleryMutation) DescriptionCleared

func (m *GalleryMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*GalleryMutation) EdgeCleared

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

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

func (*GalleryMutation) Field

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

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

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

func (*GalleryMutation) Fields

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

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

func (m *GalleryMutation) 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 (*GalleryMutation) ItemsCleared

func (m *GalleryMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the GalleryItem entity was cleared.

func (*GalleryMutation) ItemsIDs

func (m *GalleryMutation) ItemsIDs() (ids []int)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*GalleryMutation) Nid

func (m *GalleryMutation) Nid() (r int, exists bool)

Nid returns the value of the "nid" field in the mutation.

func (*GalleryMutation) NodeCleared

func (m *GalleryMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*GalleryMutation) NodeID

func (m *GalleryMutation) NodeID() (id int, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*GalleryMutation) NodeIDs

func (m *GalleryMutation) NodeIDs() (ids []int)

NodeIDs returns the "node" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodeID instead. It exists only for internal usage by the builders.

func (*GalleryMutation) OldCreatedAt

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

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

func (m *GalleryMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Gallery entity. If the Gallery 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 (*GalleryMutation) OldField

func (m *GalleryMutation) 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 (*GalleryMutation) OldNid

func (m *GalleryMutation) OldNid(ctx context.Context) (v int, err error)

OldNid returns the old "nid" field's value of the Gallery entity. If the Gallery 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 (*GalleryMutation) OldPreviewMediumStyle

func (m *GalleryMutation) OldPreviewMediumStyle(ctx context.Context) (v string, err error)

OldPreviewMediumStyle returns the old "preview_medium_style" field's value of the Gallery entity. If the Gallery 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 (*GalleryMutation) OldPreviewSmallStyle

func (m *GalleryMutation) OldPreviewSmallStyle(ctx context.Context) (v string, err error)

OldPreviewSmallStyle returns the old "preview_small_style" field's value of the Gallery entity. If the Gallery 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 (*GalleryMutation) OldStatus

func (m *GalleryMutation) OldStatus(ctx context.Context) (v bool, err error)

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

func (m *GalleryMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Gallery entity. If the Gallery 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 (*GalleryMutation) OldUpdatedAt

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

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

func (m *GalleryMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the Gallery entity. If the Gallery 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 (*GalleryMutation) Op

func (m *GalleryMutation) Op() Op

Op returns the operation name.

func (*GalleryMutation) PreviewMediumStyle

func (m *GalleryMutation) PreviewMediumStyle() (r string, exists bool)

PreviewMediumStyle returns the value of the "preview_medium_style" field in the mutation.

func (*GalleryMutation) PreviewSmallStyle

func (m *GalleryMutation) PreviewSmallStyle() (r string, exists bool)

PreviewSmallStyle returns the value of the "preview_small_style" field in the mutation.

func (*GalleryMutation) RemoveItemIDs

func (m *GalleryMutation) RemoveItemIDs(ids ...int)

RemoveItemIDs removes the "items" edge to the GalleryItem entity by IDs.

func (*GalleryMutation) RemovedEdges

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

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

func (*GalleryMutation) RemovedIDs

func (m *GalleryMutation) 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 (*GalleryMutation) RemovedItemsIDs

func (m *GalleryMutation) RemovedItemsIDs() (ids []int)

RemovedItems returns the removed IDs of the "items" edge to the GalleryItem entity.

func (*GalleryMutation) ResetCreatedAt

func (m *GalleryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GalleryMutation) ResetDescription

func (m *GalleryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GalleryMutation) ResetEdge

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

func (m *GalleryMutation) 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 (*GalleryMutation) ResetItems

func (m *GalleryMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*GalleryMutation) ResetNid

func (m *GalleryMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*GalleryMutation) ResetNode

func (m *GalleryMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*GalleryMutation) ResetPreviewMediumStyle

func (m *GalleryMutation) ResetPreviewMediumStyle()

ResetPreviewMediumStyle resets all changes to the "preview_medium_style" field.

func (*GalleryMutation) ResetPreviewSmallStyle

func (m *GalleryMutation) ResetPreviewSmallStyle()

ResetPreviewSmallStyle resets all changes to the "preview_small_style" field.

func (*GalleryMutation) ResetStatus

func (m *GalleryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*GalleryMutation) ResetTitle

func (m *GalleryMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*GalleryMutation) ResetUpdatedAt

func (m *GalleryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GalleryMutation) ResetWeight

func (m *GalleryMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*GalleryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GalleryMutation) SetDescription

func (m *GalleryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GalleryMutation) SetField

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

func (m *GalleryMutation) SetID(id int)

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

func (*GalleryMutation) SetNid

func (m *GalleryMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*GalleryMutation) SetNodeID

func (m *GalleryMutation) SetNodeID(id int)

SetNodeID sets the "node" edge to the Node entity by id.

func (*GalleryMutation) SetOp

func (m *GalleryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GalleryMutation) SetPreviewMediumStyle

func (m *GalleryMutation) SetPreviewMediumStyle(s string)

SetPreviewMediumStyle sets the "preview_medium_style" field.

func (*GalleryMutation) SetPreviewSmallStyle

func (m *GalleryMutation) SetPreviewSmallStyle(s string)

SetPreviewSmallStyle sets the "preview_small_style" field.

func (*GalleryMutation) SetStatus

func (m *GalleryMutation) SetStatus(b bool)

SetStatus sets the "status" field.

func (*GalleryMutation) SetTitle

func (m *GalleryMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*GalleryMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GalleryMutation) SetWeight

func (m *GalleryMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (*GalleryMutation) Status

func (m *GalleryMutation) Status() (r bool, exists bool)

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

func (*GalleryMutation) StatusCleared

func (m *GalleryMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*GalleryMutation) Title

func (m *GalleryMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*GalleryMutation) TitleCleared

func (m *GalleryMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (GalleryMutation) Tx

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

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

func (*GalleryMutation) Type

func (m *GalleryMutation) Type() string

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

func (*GalleryMutation) UpdatedAt

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

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

func (*GalleryMutation) Weight

func (m *GalleryMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*GalleryMutation) WeightCleared

func (m *GalleryMutation) WeightCleared() bool

WeightCleared returns if the "weight" field was cleared in this mutation.

func (*GalleryMutation) Where

func (m *GalleryMutation) Where(ps ...predicate.Gallery)

Where appends a list predicates to the GalleryMutation builder.

func (*GalleryMutation) WhereP

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

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

type GalleryNode

type GalleryNode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Nid holds the value of the "nid" field.
	Nid int `json:"nid,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GalleryNodeQuery when eager-loading is set.
	Edges GalleryNodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

GalleryNode is the model entity for the GalleryNode schema.

func (*GalleryNode) QueryNode

func (_m *GalleryNode) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the GalleryNode entity.

func (*GalleryNode) String

func (_m *GalleryNode) String() string

String implements the fmt.Stringer.

func (*GalleryNode) Unwrap

func (_m *GalleryNode) Unwrap() *GalleryNode

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

func (_m *GalleryNode) Update() *GalleryNodeUpdateOne

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

func (*GalleryNode) Value

func (_m *GalleryNode) Value(name string) (ent.Value, error)

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

type GalleryNodeClient

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

GalleryNodeClient is a client for the GalleryNode schema.

func NewGalleryNodeClient

func NewGalleryNodeClient(c config) *GalleryNodeClient

NewGalleryNodeClient returns a client for the GalleryNode from the given config.

func (*GalleryNodeClient) Create

func (c *GalleryNodeClient) Create() *GalleryNodeCreate

Create returns a builder for creating a GalleryNode entity.

func (*GalleryNodeClient) CreateBulk

func (c *GalleryNodeClient) CreateBulk(builders ...*GalleryNodeCreate) *GalleryNodeCreateBulk

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

func (*GalleryNodeClient) Delete

func (c *GalleryNodeClient) Delete() *GalleryNodeDelete

Delete returns a delete builder for GalleryNode.

func (*GalleryNodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GalleryNodeClient) DeleteOneID

func (c *GalleryNodeClient) DeleteOneID(id int) *GalleryNodeDeleteOne

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

func (*GalleryNodeClient) Get

func (c *GalleryNodeClient) Get(ctx context.Context, id int) (*GalleryNode, error)

Get returns a GalleryNode entity by its id.

func (*GalleryNodeClient) GetX

func (c *GalleryNodeClient) GetX(ctx context.Context, id int) *GalleryNode

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

func (*GalleryNodeClient) Hooks

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

Hooks returns the client hooks.

func (*GalleryNodeClient) Intercept

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

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

func (*GalleryNodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GalleryNodeClient) MapCreateBulk

func (c *GalleryNodeClient) MapCreateBulk(slice any, setFunc func(*GalleryNodeCreate, int)) *GalleryNodeCreateBulk

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 (*GalleryNodeClient) Query

func (c *GalleryNodeClient) Query() *GalleryNodeQuery

Query returns a query builder for GalleryNode.

func (*GalleryNodeClient) QueryNode

func (c *GalleryNodeClient) QueryNode(_m *GalleryNode) *NodeQuery

QueryNode queries the node edge of a GalleryNode.

func (*GalleryNodeClient) Update

func (c *GalleryNodeClient) Update() *GalleryNodeUpdate

Update returns an update builder for GalleryNode.

func (*GalleryNodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GalleryNodeClient) UpdateOneID

func (c *GalleryNodeClient) UpdateOneID(id int) *GalleryNodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GalleryNodeClient) Use

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

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

type GalleryNodeCreate

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

GalleryNodeCreate is the builder for creating a GalleryNode entity.

func (*GalleryNodeCreate) Exec

func (_c *GalleryNodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryNodeCreate) ExecX

func (_c *GalleryNodeCreate) ExecX(ctx context.Context)

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

func (*GalleryNodeCreate) Mutation

func (_c *GalleryNodeCreate) Mutation() *GalleryNodeMutation

Mutation returns the GalleryNodeMutation object of the builder.

func (*GalleryNodeCreate) Save

Save creates the GalleryNode in the database.

func (*GalleryNodeCreate) SaveX

func (_c *GalleryNodeCreate) SaveX(ctx context.Context) *GalleryNode

SaveX calls Save and panics if Save returns an error.

func (*GalleryNodeCreate) SetID

func (_c *GalleryNodeCreate) SetID(v int) *GalleryNodeCreate

SetID sets the "id" field.

func (*GalleryNodeCreate) SetNid

func (_c *GalleryNodeCreate) SetNid(v int) *GalleryNodeCreate

SetNid sets the "nid" field.

func (*GalleryNodeCreate) SetNode

func (_c *GalleryNodeCreate) SetNode(v *Node) *GalleryNodeCreate

SetNode sets the "node" edge to the Node entity.

func (*GalleryNodeCreate) SetNodeID

func (_c *GalleryNodeCreate) SetNodeID(id int) *GalleryNodeCreate

SetNodeID sets the "node" edge to the Node entity by ID.

type GalleryNodeCreateBulk

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

GalleryNodeCreateBulk is the builder for creating many GalleryNode entities in bulk.

func (*GalleryNodeCreateBulk) Exec

Exec executes the query.

func (*GalleryNodeCreateBulk) ExecX

func (_c *GalleryNodeCreateBulk) ExecX(ctx context.Context)

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

func (*GalleryNodeCreateBulk) Save

Save creates the GalleryNode entities in the database.

func (*GalleryNodeCreateBulk) SaveX

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

type GalleryNodeDelete

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

GalleryNodeDelete is the builder for deleting a GalleryNode entity.

func (*GalleryNodeDelete) Exec

func (_d *GalleryNodeDelete) Exec(ctx context.Context) (int, error)

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

func (*GalleryNodeDelete) ExecX

func (_d *GalleryNodeDelete) ExecX(ctx context.Context) int

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

func (*GalleryNodeDelete) Where

Where appends a list predicates to the GalleryNodeDelete builder.

type GalleryNodeDeleteOne

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

GalleryNodeDeleteOne is the builder for deleting a single GalleryNode entity.

func (*GalleryNodeDeleteOne) Exec

func (_d *GalleryNodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GalleryNodeDeleteOne) ExecX

func (_d *GalleryNodeDeleteOne) ExecX(ctx context.Context)

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

func (*GalleryNodeDeleteOne) Where

Where appends a list predicates to the GalleryNodeDelete builder.

type GalleryNodeEdges

type GalleryNodeEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

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

func (GalleryNodeEdges) NodeOrErr

func (e GalleryNodeEdges) NodeOrErr() (*Node, error)

NodeOrErr returns the Node value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GalleryNodeGroupBy

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

GalleryNodeGroupBy is the group-by builder for GalleryNode entities.

func (*GalleryNodeGroupBy) Aggregate

func (_g *GalleryNodeGroupBy) Aggregate(fns ...AggregateFunc) *GalleryNodeGroupBy

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

func (*GalleryNodeGroupBy) Bool

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

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

func (*GalleryNodeGroupBy) BoolX

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

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

func (*GalleryNodeGroupBy) Bools

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

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

func (*GalleryNodeGroupBy) BoolsX

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

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

func (*GalleryNodeGroupBy) Float64

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

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

func (*GalleryNodeGroupBy) Float64X

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

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

func (*GalleryNodeGroupBy) Float64s

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

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

func (*GalleryNodeGroupBy) Float64sX

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

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

func (*GalleryNodeGroupBy) Int

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

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

func (*GalleryNodeGroupBy) IntX

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

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

func (*GalleryNodeGroupBy) Ints

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

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

func (*GalleryNodeGroupBy) IntsX

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

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

func (*GalleryNodeGroupBy) Scan

func (_g *GalleryNodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*GalleryNodeGroupBy) ScanX

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

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

func (*GalleryNodeGroupBy) String

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

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

func (*GalleryNodeGroupBy) StringX

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

StringX is like String, but panics if an error occurs.

func (*GalleryNodeGroupBy) Strings

func (s *GalleryNodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GalleryNodeGroupBy) StringsX

func (s *GalleryNodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GalleryNodeMutation

type GalleryNodeMutation struct {
	// contains filtered or unexported fields
}

GalleryNodeMutation represents an operation that mutates the GalleryNode nodes in the graph.

func (*GalleryNodeMutation) AddField

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) AddedEdges

func (m *GalleryNodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GalleryNodeMutation) AddedField

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) AddedFields

func (m *GalleryNodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GalleryNodeMutation) AddedIDs

func (m *GalleryNodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GalleryNodeMutation) ClearEdge

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) ClearField

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) ClearNode

func (m *GalleryNodeMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*GalleryNodeMutation) ClearedEdges

func (m *GalleryNodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GalleryNodeMutation) ClearedFields

func (m *GalleryNodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GalleryNodeMutation) Client

func (m GalleryNodeMutation) 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 (*GalleryNodeMutation) EdgeCleared

func (m *GalleryNodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GalleryNodeMutation) Field

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) FieldCleared

func (m *GalleryNodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GalleryNodeMutation) Fields

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) ID

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) IDs

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) Nid

func (m *GalleryNodeMutation) Nid() (r int, exists bool)

Nid returns the value of the "nid" field in the mutation.

func (*GalleryNodeMutation) NodeCleared

func (m *GalleryNodeMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*GalleryNodeMutation) NodeID

func (m *GalleryNodeMutation) NodeID() (id int, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*GalleryNodeMutation) NodeIDs

func (m *GalleryNodeMutation) NodeIDs() (ids []int)

NodeIDs returns the "node" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodeID instead. It exists only for internal usage by the builders.

func (*GalleryNodeMutation) OldField

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) OldNid

func (m *GalleryNodeMutation) OldNid(ctx context.Context) (v int, err error)

OldNid returns the old "nid" field's value of the GalleryNode entity. If the GalleryNode 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 (*GalleryNodeMutation) Op

func (m *GalleryNodeMutation) Op() Op

Op returns the operation name.

func (*GalleryNodeMutation) RemovedEdges

func (m *GalleryNodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GalleryNodeMutation) RemovedIDs

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) ResetEdge

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) ResetField

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) ResetNid

func (m *GalleryNodeMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*GalleryNodeMutation) ResetNode

func (m *GalleryNodeMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*GalleryNodeMutation) SetField

func (m *GalleryNodeMutation) 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 (*GalleryNodeMutation) SetID

func (m *GalleryNodeMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of GalleryNode entities.

func (*GalleryNodeMutation) SetNid

func (m *GalleryNodeMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*GalleryNodeMutation) SetNodeID

func (m *GalleryNodeMutation) SetNodeID(id int)

SetNodeID sets the "node" edge to the Node entity by id.

func (*GalleryNodeMutation) SetOp

func (m *GalleryNodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (GalleryNodeMutation) Tx

func (m GalleryNodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GalleryNodeMutation) Type

func (m *GalleryNodeMutation) Type() string

Type returns the node type of this mutation (GalleryNode).

func (*GalleryNodeMutation) Where

func (m *GalleryNodeMutation) Where(ps ...predicate.GalleryNode)

Where appends a list predicates to the GalleryNodeMutation builder.

func (*GalleryNodeMutation) WhereP

func (m *GalleryNodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GalleryNodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GalleryNodeQuery

type GalleryNodeQuery struct {
	// contains filtered or unexported fields
}

GalleryNodeQuery is the builder for querying GalleryNode entities.

func (*GalleryNodeQuery) Aggregate

func (_q *GalleryNodeQuery) Aggregate(fns ...AggregateFunc) *GalleryNodeSelect

Aggregate returns a GalleryNodeSelect configured with the given aggregations.

func (*GalleryNodeQuery) All

func (_q *GalleryNodeQuery) All(ctx context.Context) ([]*GalleryNode, error)

All executes the query and returns a list of GalleryNodes.

func (*GalleryNodeQuery) AllX

func (_q *GalleryNodeQuery) AllX(ctx context.Context) []*GalleryNode

AllX is like All, but panics if an error occurs.

func (*GalleryNodeQuery) Clone

func (_q *GalleryNodeQuery) Clone() *GalleryNodeQuery

Clone returns a duplicate of the GalleryNodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GalleryNodeQuery) Count

func (_q *GalleryNodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GalleryNodeQuery) CountX

func (_q *GalleryNodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GalleryNodeQuery) Exist

func (_q *GalleryNodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GalleryNodeQuery) ExistX

func (_q *GalleryNodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GalleryNodeQuery) First

func (_q *GalleryNodeQuery) First(ctx context.Context) (*GalleryNode, error)

First returns the first GalleryNode entity from the query. Returns a *NotFoundError when no GalleryNode was found.

func (*GalleryNodeQuery) FirstID

func (_q *GalleryNodeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GalleryNode ID from the query. Returns a *NotFoundError when no GalleryNode ID was found.

func (*GalleryNodeQuery) FirstIDX

func (_q *GalleryNodeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GalleryNodeQuery) FirstX

func (_q *GalleryNodeQuery) FirstX(ctx context.Context) *GalleryNode

FirstX is like First, but panics if an error occurs.

func (*GalleryNodeQuery) GroupBy

func (_q *GalleryNodeQuery) GroupBy(field string, fields ...string) *GalleryNodeGroupBy

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 {
	Nid int `json:"nid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GalleryNode.Query().
	GroupBy(gallerynode.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*GalleryNodeQuery) IDs

func (_q *GalleryNodeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GalleryNode IDs.

func (*GalleryNodeQuery) IDsX

func (_q *GalleryNodeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GalleryNodeQuery) Limit

func (_q *GalleryNodeQuery) Limit(limit int) *GalleryNodeQuery

Limit the number of records to be returned by this query.

func (*GalleryNodeQuery) Offset

func (_q *GalleryNodeQuery) Offset(offset int) *GalleryNodeQuery

Offset to start from.

func (*GalleryNodeQuery) Only

func (_q *GalleryNodeQuery) Only(ctx context.Context) (*GalleryNode, error)

Only returns a single GalleryNode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GalleryNode entity is found. Returns a *NotFoundError when no GalleryNode entities are found.

func (*GalleryNodeQuery) OnlyID

func (_q *GalleryNodeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GalleryNode ID in the query. Returns a *NotSingularError when more than one GalleryNode ID is found. Returns a *NotFoundError when no entities are found.

func (*GalleryNodeQuery) OnlyIDX

func (_q *GalleryNodeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GalleryNodeQuery) OnlyX

func (_q *GalleryNodeQuery) OnlyX(ctx context.Context) *GalleryNode

OnlyX is like Only, but panics if an error occurs.

func (*GalleryNodeQuery) Order

Order specifies how the records should be ordered.

func (*GalleryNodeQuery) QueryNode

func (_q *GalleryNodeQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*GalleryNodeQuery) Select

func (_q *GalleryNodeQuery) Select(fields ...string) *GalleryNodeSelect

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 {
	Nid int `json:"nid,omitempty"`
}

client.GalleryNode.Query().
	Select(gallerynode.FieldNid).
	Scan(ctx, &v)

func (*GalleryNodeQuery) Unique

func (_q *GalleryNodeQuery) Unique(unique bool) *GalleryNodeQuery

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 (*GalleryNodeQuery) Where

Where adds a new predicate for the GalleryNodeQuery builder.

func (*GalleryNodeQuery) WithNode

func (_q *GalleryNodeQuery) WithNode(opts ...func(*NodeQuery)) *GalleryNodeQuery

WithNode tells the query-builder to eager-load the nodes that are connected to the "node" edge. The optional arguments are used to configure the query builder of the edge.

type GalleryNodeSelect

type GalleryNodeSelect struct {
	*GalleryNodeQuery
	// contains filtered or unexported fields
}

GalleryNodeSelect is the builder for selecting fields of GalleryNode entities.

func (*GalleryNodeSelect) Aggregate

func (_s *GalleryNodeSelect) Aggregate(fns ...AggregateFunc) *GalleryNodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GalleryNodeSelect) Bool

func (s *GalleryNodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) BoolX

func (s *GalleryNodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GalleryNodeSelect) Bools

func (s *GalleryNodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) BoolsX

func (s *GalleryNodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GalleryNodeSelect) Float64

func (s *GalleryNodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) Float64X

func (s *GalleryNodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GalleryNodeSelect) Float64s

func (s *GalleryNodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) Float64sX

func (s *GalleryNodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GalleryNodeSelect) Int

func (s *GalleryNodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) IntX

func (s *GalleryNodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GalleryNodeSelect) Ints

func (s *GalleryNodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) IntsX

func (s *GalleryNodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GalleryNodeSelect) Scan

func (_s *GalleryNodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GalleryNodeSelect) ScanX

func (s *GalleryNodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GalleryNodeSelect) String

func (s *GalleryNodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) StringX

func (s *GalleryNodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GalleryNodeSelect) Strings

func (s *GalleryNodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GalleryNodeSelect) StringsX

func (s *GalleryNodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GalleryNodeUpdate

type GalleryNodeUpdate struct {
	// contains filtered or unexported fields
}

GalleryNodeUpdate is the builder for updating GalleryNode entities.

func (*GalleryNodeUpdate) ClearNode

func (_u *GalleryNodeUpdate) ClearNode() *GalleryNodeUpdate

ClearNode clears the "node" edge to the Node entity.

func (*GalleryNodeUpdate) Exec

func (_u *GalleryNodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryNodeUpdate) ExecX

func (_u *GalleryNodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GalleryNodeUpdate) Mutation

func (_u *GalleryNodeUpdate) Mutation() *GalleryNodeMutation

Mutation returns the GalleryNodeMutation object of the builder.

func (*GalleryNodeUpdate) Save

func (_u *GalleryNodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GalleryNodeUpdate) SaveX

func (_u *GalleryNodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GalleryNodeUpdate) SetNid

func (_u *GalleryNodeUpdate) SetNid(v int) *GalleryNodeUpdate

SetNid sets the "nid" field.

func (*GalleryNodeUpdate) SetNillableNid

func (_u *GalleryNodeUpdate) SetNillableNid(v *int) *GalleryNodeUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*GalleryNodeUpdate) SetNode

func (_u *GalleryNodeUpdate) SetNode(v *Node) *GalleryNodeUpdate

SetNode sets the "node" edge to the Node entity.

func (*GalleryNodeUpdate) SetNodeID

func (_u *GalleryNodeUpdate) SetNodeID(id int) *GalleryNodeUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*GalleryNodeUpdate) Where

Where appends a list predicates to the GalleryNodeUpdate builder.

type GalleryNodeUpdateOne

type GalleryNodeUpdateOne struct {
	// contains filtered or unexported fields
}

GalleryNodeUpdateOne is the builder for updating a single GalleryNode entity.

func (*GalleryNodeUpdateOne) ClearNode

func (_u *GalleryNodeUpdateOne) ClearNode() *GalleryNodeUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*GalleryNodeUpdateOne) Exec

func (_u *GalleryNodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GalleryNodeUpdateOne) ExecX

func (_u *GalleryNodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GalleryNodeUpdateOne) Mutation

func (_u *GalleryNodeUpdateOne) Mutation() *GalleryNodeMutation

Mutation returns the GalleryNodeMutation object of the builder.

func (*GalleryNodeUpdateOne) Save

Save executes the query and returns the updated GalleryNode entity.

func (*GalleryNodeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GalleryNodeUpdateOne) Select

func (_u *GalleryNodeUpdateOne) Select(field string, fields ...string) *GalleryNodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GalleryNodeUpdateOne) SetNid

SetNid sets the "nid" field.

func (*GalleryNodeUpdateOne) SetNillableNid

func (_u *GalleryNodeUpdateOne) SetNillableNid(v *int) *GalleryNodeUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*GalleryNodeUpdateOne) SetNode

SetNode sets the "node" edge to the Node entity.

func (*GalleryNodeUpdateOne) SetNodeID

func (_u *GalleryNodeUpdateOne) SetNodeID(id int) *GalleryNodeUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*GalleryNodeUpdateOne) Where

Where appends a list predicates to the GalleryNodeUpdate builder.

type GalleryNodes

type GalleryNodes []*GalleryNode

GalleryNodes is a parsable slice of GalleryNode.

type GalleryQuery

type GalleryQuery struct {
	// contains filtered or unexported fields
}

GalleryQuery is the builder for querying Gallery entities.

func (*GalleryQuery) Aggregate

func (_q *GalleryQuery) Aggregate(fns ...AggregateFunc) *GallerySelect

Aggregate returns a GallerySelect configured with the given aggregations.

func (*GalleryQuery) All

func (_q *GalleryQuery) All(ctx context.Context) ([]*Gallery, error)

All executes the query and returns a list of Galleries.

func (*GalleryQuery) AllX

func (_q *GalleryQuery) AllX(ctx context.Context) []*Gallery

AllX is like All, but panics if an error occurs.

func (*GalleryQuery) Clone

func (_q *GalleryQuery) Clone() *GalleryQuery

Clone returns a duplicate of the GalleryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GalleryQuery) Count

func (_q *GalleryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GalleryQuery) CountX

func (_q *GalleryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GalleryQuery) Exist

func (_q *GalleryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GalleryQuery) ExistX

func (_q *GalleryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GalleryQuery) First

func (_q *GalleryQuery) First(ctx context.Context) (*Gallery, error)

First returns the first Gallery entity from the query. Returns a *NotFoundError when no Gallery was found.

func (*GalleryQuery) FirstID

func (_q *GalleryQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Gallery ID from the query. Returns a *NotFoundError when no Gallery ID was found.

func (*GalleryQuery) FirstIDX

func (_q *GalleryQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GalleryQuery) FirstX

func (_q *GalleryQuery) FirstX(ctx context.Context) *Gallery

FirstX is like First, but panics if an error occurs.

func (*GalleryQuery) GroupBy

func (_q *GalleryQuery) GroupBy(field string, fields ...string) *GalleryGroupBy

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 {
	Nid int `json:"nid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Gallery.Query().
	GroupBy(gallery.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*GalleryQuery) IDs

func (_q *GalleryQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Gallery IDs.

func (*GalleryQuery) IDsX

func (_q *GalleryQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GalleryQuery) Limit

func (_q *GalleryQuery) Limit(limit int) *GalleryQuery

Limit the number of records to be returned by this query.

func (*GalleryQuery) Offset

func (_q *GalleryQuery) Offset(offset int) *GalleryQuery

Offset to start from.

func (*GalleryQuery) Only

func (_q *GalleryQuery) Only(ctx context.Context) (*Gallery, error)

Only returns a single Gallery entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Gallery entity is found. Returns a *NotFoundError when no Gallery entities are found.

func (*GalleryQuery) OnlyID

func (_q *GalleryQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Gallery ID in the query. Returns a *NotSingularError when more than one Gallery ID is found. Returns a *NotFoundError when no entities are found.

func (*GalleryQuery) OnlyIDX

func (_q *GalleryQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GalleryQuery) OnlyX

func (_q *GalleryQuery) OnlyX(ctx context.Context) *Gallery

OnlyX is like Only, but panics if an error occurs.

func (*GalleryQuery) Order

func (_q *GalleryQuery) Order(o ...gallery.OrderOption) *GalleryQuery

Order specifies how the records should be ordered.

func (*GalleryQuery) QueryItems

func (_q *GalleryQuery) QueryItems() *GalleryItemQuery

QueryItems chains the current query on the "items" edge.

func (*GalleryQuery) QueryNode

func (_q *GalleryQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*GalleryQuery) Select

func (_q *GalleryQuery) Select(fields ...string) *GallerySelect

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 {
	Nid int `json:"nid,omitempty"`
}

client.Gallery.Query().
	Select(gallery.FieldNid).
	Scan(ctx, &v)

func (*GalleryQuery) Unique

func (_q *GalleryQuery) Unique(unique bool) *GalleryQuery

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 (*GalleryQuery) Where

func (_q *GalleryQuery) Where(ps ...predicate.Gallery) *GalleryQuery

Where adds a new predicate for the GalleryQuery builder.

func (*GalleryQuery) WithItems

func (_q *GalleryQuery) WithItems(opts ...func(*GalleryItemQuery)) *GalleryQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" edge. The optional arguments are used to configure the query builder of the edge.

func (*GalleryQuery) WithNode

func (_q *GalleryQuery) WithNode(opts ...func(*NodeQuery)) *GalleryQuery

WithNode tells the query-builder to eager-load the nodes that are connected to the "node" edge. The optional arguments are used to configure the query builder of the edge.

type GallerySelect

type GallerySelect struct {
	*GalleryQuery
	// contains filtered or unexported fields
}

GallerySelect is the builder for selecting fields of Gallery entities.

func (*GallerySelect) Aggregate

func (_s *GallerySelect) Aggregate(fns ...AggregateFunc) *GallerySelect

Aggregate adds the given aggregation functions to the selector query.

func (*GallerySelect) Bool

func (s *GallerySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GallerySelect) BoolX

func (s *GallerySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GallerySelect) Bools

func (s *GallerySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GallerySelect) BoolsX

func (s *GallerySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GallerySelect) Float64

func (s *GallerySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GallerySelect) Float64X

func (s *GallerySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GallerySelect) Float64s

func (s *GallerySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GallerySelect) Float64sX

func (s *GallerySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GallerySelect) Int

func (s *GallerySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GallerySelect) IntX

func (s *GallerySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GallerySelect) Ints

func (s *GallerySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GallerySelect) IntsX

func (s *GallerySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GallerySelect) Scan

func (_s *GallerySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GallerySelect) ScanX

func (s *GallerySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GallerySelect) String

func (s *GallerySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GallerySelect) StringX

func (s *GallerySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GallerySelect) Strings

func (s *GallerySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GallerySelect) StringsX

func (s *GallerySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GalleryUpdate

type GalleryUpdate struct {
	// contains filtered or unexported fields
}

GalleryUpdate is the builder for updating Gallery entities.

func (*GalleryUpdate) AddItemIDs

func (_u *GalleryUpdate) AddItemIDs(ids ...int) *GalleryUpdate

AddItemIDs adds the "items" edge to the GalleryItem entity by IDs.

func (*GalleryUpdate) AddItems

func (_u *GalleryUpdate) AddItems(v ...*GalleryItem) *GalleryUpdate

AddItems adds the "items" edges to the GalleryItem entity.

func (*GalleryUpdate) AddWeight

func (_u *GalleryUpdate) AddWeight(v int) *GalleryUpdate

AddWeight adds value to the "weight" field.

func (*GalleryUpdate) ClearDescription

func (_u *GalleryUpdate) ClearDescription() *GalleryUpdate

ClearDescription clears the value of the "description" field.

func (*GalleryUpdate) ClearItems

func (_u *GalleryUpdate) ClearItems() *GalleryUpdate

ClearItems clears all "items" edges to the GalleryItem entity.

func (*GalleryUpdate) ClearNode

func (_u *GalleryUpdate) ClearNode() *GalleryUpdate

ClearNode clears the "node" edge to the Node entity.

func (*GalleryUpdate) ClearStatus

func (_u *GalleryUpdate) ClearStatus() *GalleryUpdate

ClearStatus clears the value of the "status" field.

func (*GalleryUpdate) ClearTitle

func (_u *GalleryUpdate) ClearTitle() *GalleryUpdate

ClearTitle clears the value of the "title" field.

func (*GalleryUpdate) ClearWeight

func (_u *GalleryUpdate) ClearWeight() *GalleryUpdate

ClearWeight clears the value of the "weight" field.

func (*GalleryUpdate) Exec

func (_u *GalleryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GalleryUpdate) ExecX

func (_u *GalleryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GalleryUpdate) Mutation

func (_u *GalleryUpdate) Mutation() *GalleryMutation

Mutation returns the GalleryMutation object of the builder.

func (*GalleryUpdate) RemoveItemIDs

func (_u *GalleryUpdate) RemoveItemIDs(ids ...int) *GalleryUpdate

RemoveItemIDs removes the "items" edge to GalleryItem entities by IDs.

func (*GalleryUpdate) RemoveItems

func (_u *GalleryUpdate) RemoveItems(v ...*GalleryItem) *GalleryUpdate

RemoveItems removes "items" edges to GalleryItem entities.

func (*GalleryUpdate) Save

func (_u *GalleryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GalleryUpdate) SaveX

func (_u *GalleryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GalleryUpdate) SetDescription

func (_u *GalleryUpdate) SetDescription(v string) *GalleryUpdate

SetDescription sets the "description" field.

func (*GalleryUpdate) SetNid

func (_u *GalleryUpdate) SetNid(v int) *GalleryUpdate

SetNid sets the "nid" field.

func (*GalleryUpdate) SetNillableDescription

func (_u *GalleryUpdate) SetNillableDescription(v *string) *GalleryUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GalleryUpdate) SetNillableNid

func (_u *GalleryUpdate) SetNillableNid(v *int) *GalleryUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*GalleryUpdate) SetNillablePreviewMediumStyle

func (_u *GalleryUpdate) SetNillablePreviewMediumStyle(v *string) *GalleryUpdate

SetNillablePreviewMediumStyle sets the "preview_medium_style" field if the given value is not nil.

func (*GalleryUpdate) SetNillablePreviewSmallStyle

func (_u *GalleryUpdate) SetNillablePreviewSmallStyle(v *string) *GalleryUpdate

SetNillablePreviewSmallStyle sets the "preview_small_style" field if the given value is not nil.

func (*GalleryUpdate) SetNillableStatus

func (_u *GalleryUpdate) SetNillableStatus(v *bool) *GalleryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*GalleryUpdate) SetNillableTitle

func (_u *GalleryUpdate) SetNillableTitle(v *string) *GalleryUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*GalleryUpdate) SetNillableWeight

func (_u *GalleryUpdate) SetNillableWeight(v *int) *GalleryUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*GalleryUpdate) SetNode

func (_u *GalleryUpdate) SetNode(v *Node) *GalleryUpdate

SetNode sets the "node" edge to the Node entity.

func (*GalleryUpdate) SetNodeID

func (_u *GalleryUpdate) SetNodeID(id int) *GalleryUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*GalleryUpdate) SetPreviewMediumStyle

func (_u *GalleryUpdate) SetPreviewMediumStyle(v string) *GalleryUpdate

SetPreviewMediumStyle sets the "preview_medium_style" field.

func (*GalleryUpdate) SetPreviewSmallStyle

func (_u *GalleryUpdate) SetPreviewSmallStyle(v string) *GalleryUpdate

SetPreviewSmallStyle sets the "preview_small_style" field.

func (*GalleryUpdate) SetStatus

func (_u *GalleryUpdate) SetStatus(v bool) *GalleryUpdate

SetStatus sets the "status" field.

func (*GalleryUpdate) SetTitle

func (_u *GalleryUpdate) SetTitle(v string) *GalleryUpdate

SetTitle sets the "title" field.

func (*GalleryUpdate) SetUpdatedAt

func (_u *GalleryUpdate) SetUpdatedAt(v time.Time) *GalleryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GalleryUpdate) SetWeight

func (_u *GalleryUpdate) SetWeight(v int) *GalleryUpdate

SetWeight sets the "weight" field.

func (*GalleryUpdate) Where

func (_u *GalleryUpdate) Where(ps ...predicate.Gallery) *GalleryUpdate

Where appends a list predicates to the GalleryUpdate builder.

type GalleryUpdateOne

type GalleryUpdateOne struct {
	// contains filtered or unexported fields
}

GalleryUpdateOne is the builder for updating a single Gallery entity.

func (*GalleryUpdateOne) AddItemIDs

func (_u *GalleryUpdateOne) AddItemIDs(ids ...int) *GalleryUpdateOne

AddItemIDs adds the "items" edge to the GalleryItem entity by IDs.

func (*GalleryUpdateOne) AddItems

func (_u *GalleryUpdateOne) AddItems(v ...*GalleryItem) *GalleryUpdateOne

AddItems adds the "items" edges to the GalleryItem entity.

func (*GalleryUpdateOne) AddWeight

func (_u *GalleryUpdateOne) AddWeight(v int) *GalleryUpdateOne

AddWeight adds value to the "weight" field.

func (*GalleryUpdateOne) ClearDescription

func (_u *GalleryUpdateOne) ClearDescription() *GalleryUpdateOne

ClearDescription clears the value of the "description" field.

func (*GalleryUpdateOne) ClearItems

func (_u *GalleryUpdateOne) ClearItems() *GalleryUpdateOne

ClearItems clears all "items" edges to the GalleryItem entity.

func (*GalleryUpdateOne) ClearNode

func (_u *GalleryUpdateOne) ClearNode() *GalleryUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*GalleryUpdateOne) ClearStatus

func (_u *GalleryUpdateOne) ClearStatus() *GalleryUpdateOne

ClearStatus clears the value of the "status" field.

func (*GalleryUpdateOne) ClearTitle

func (_u *GalleryUpdateOne) ClearTitle() *GalleryUpdateOne

ClearTitle clears the value of the "title" field.

func (*GalleryUpdateOne) ClearWeight

func (_u *GalleryUpdateOne) ClearWeight() *GalleryUpdateOne

ClearWeight clears the value of the "weight" field.

func (*GalleryUpdateOne) Exec

func (_u *GalleryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GalleryUpdateOne) ExecX

func (_u *GalleryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GalleryUpdateOne) Mutation

func (_u *GalleryUpdateOne) Mutation() *GalleryMutation

Mutation returns the GalleryMutation object of the builder.

func (*GalleryUpdateOne) RemoveItemIDs

func (_u *GalleryUpdateOne) RemoveItemIDs(ids ...int) *GalleryUpdateOne

RemoveItemIDs removes the "items" edge to GalleryItem entities by IDs.

func (*GalleryUpdateOne) RemoveItems

func (_u *GalleryUpdateOne) RemoveItems(v ...*GalleryItem) *GalleryUpdateOne

RemoveItems removes "items" edges to GalleryItem entities.

func (*GalleryUpdateOne) Save

func (_u *GalleryUpdateOne) Save(ctx context.Context) (*Gallery, error)

Save executes the query and returns the updated Gallery entity.

func (*GalleryUpdateOne) SaveX

func (_u *GalleryUpdateOne) SaveX(ctx context.Context) *Gallery

SaveX is like Save, but panics if an error occurs.

func (*GalleryUpdateOne) Select

func (_u *GalleryUpdateOne) Select(field string, fields ...string) *GalleryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GalleryUpdateOne) SetDescription

func (_u *GalleryUpdateOne) SetDescription(v string) *GalleryUpdateOne

SetDescription sets the "description" field.

func (*GalleryUpdateOne) SetNid

func (_u *GalleryUpdateOne) SetNid(v int) *GalleryUpdateOne

SetNid sets the "nid" field.

func (*GalleryUpdateOne) SetNillableDescription

func (_u *GalleryUpdateOne) SetNillableDescription(v *string) *GalleryUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GalleryUpdateOne) SetNillableNid

func (_u *GalleryUpdateOne) SetNillableNid(v *int) *GalleryUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*GalleryUpdateOne) SetNillablePreviewMediumStyle

func (_u *GalleryUpdateOne) SetNillablePreviewMediumStyle(v *string) *GalleryUpdateOne

SetNillablePreviewMediumStyle sets the "preview_medium_style" field if the given value is not nil.

func (*GalleryUpdateOne) SetNillablePreviewSmallStyle

func (_u *GalleryUpdateOne) SetNillablePreviewSmallStyle(v *string) *GalleryUpdateOne

SetNillablePreviewSmallStyle sets the "preview_small_style" field if the given value is not nil.

func (*GalleryUpdateOne) SetNillableStatus

func (_u *GalleryUpdateOne) SetNillableStatus(v *bool) *GalleryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*GalleryUpdateOne) SetNillableTitle

func (_u *GalleryUpdateOne) SetNillableTitle(v *string) *GalleryUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*GalleryUpdateOne) SetNillableWeight

func (_u *GalleryUpdateOne) SetNillableWeight(v *int) *GalleryUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*GalleryUpdateOne) SetNode

func (_u *GalleryUpdateOne) SetNode(v *Node) *GalleryUpdateOne

SetNode sets the "node" edge to the Node entity.

func (*GalleryUpdateOne) SetNodeID

func (_u *GalleryUpdateOne) SetNodeID(id int) *GalleryUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*GalleryUpdateOne) SetPreviewMediumStyle

func (_u *GalleryUpdateOne) SetPreviewMediumStyle(v string) *GalleryUpdateOne

SetPreviewMediumStyle sets the "preview_medium_style" field.

func (*GalleryUpdateOne) SetPreviewSmallStyle

func (_u *GalleryUpdateOne) SetPreviewSmallStyle(v string) *GalleryUpdateOne

SetPreviewSmallStyle sets the "preview_small_style" field.

func (*GalleryUpdateOne) SetStatus

func (_u *GalleryUpdateOne) SetStatus(v bool) *GalleryUpdateOne

SetStatus sets the "status" field.

func (*GalleryUpdateOne) SetTitle

func (_u *GalleryUpdateOne) SetTitle(v string) *GalleryUpdateOne

SetTitle sets the "title" field.

func (*GalleryUpdateOne) SetUpdatedAt

func (_u *GalleryUpdateOne) SetUpdatedAt(v time.Time) *GalleryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GalleryUpdateOne) SetWeight

func (_u *GalleryUpdateOne) SetWeight(v int) *GalleryUpdateOne

SetWeight sets the "weight" field.

func (*GalleryUpdateOne) Where

Where appends a list predicates to the GalleryUpdate builder.

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 Node

type Node struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Node is the model entity for the Node schema.

func (*Node) String

func (_m *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (_m *Node) Unwrap() *Node

Unwrap unwraps the Node 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 (*Node) Update

func (_m *Node) Update() *NodeUpdateOne

Update returns a builder for updating this Node. Note that you need to call Node.Unwrap() before calling this method if this Node was returned from a transaction, and the transaction was committed or rolled back.

func (*Node) Value

func (_m *Node) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Node. This includes values selected through modifiers, order, etc.

type NodeClient

type NodeClient struct {
	// contains filtered or unexported fields
}

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

NewNodeClient returns a client for the Node from the given config.

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk

CreateBulk returns a builder for creating a bulk of Node entities.

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

func (c *NodeClient) DeleteOne(_m *Node) *NodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NodeClient) Get

func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)

Get returns a Node entity by its id.

func (*NodeClient) GetX

func (c *NodeClient) GetX(ctx context.Context, id int) *Node

GetX is like Get, but panics if an error occurs.

func (*NodeClient) Hooks

func (c *NodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NodeClient) Intercept

func (c *NodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `node.Intercept(f(g(h())))`.

func (*NodeClient) Interceptors

func (c *NodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk

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 (*NodeClient) Query

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

func (c *NodeClient) UpdateOne(_m *Node) *NodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

func (c *NodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `node.Hooks(f(g(h())))`.

type NodeCreate

type NodeCreate struct {
	// contains filtered or unexported fields
}

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) Exec

func (_c *NodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreate) ExecX

func (_c *NodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeCreate) Mutation

func (_c *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) Save

func (_c *NodeCreate) Save(ctx context.Context) (*Node, error)

Save creates the Node in the database.

func (*NodeCreate) SaveX

func (_c *NodeCreate) SaveX(ctx context.Context) *Node

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetID

func (_c *NodeCreate) SetID(v int) *NodeCreate

SetID sets the "id" field.

type NodeCreateBulk

type NodeCreateBulk struct {
	// contains filtered or unexported fields
}

NodeCreateBulk is the builder for creating many Node entities in bulk.

func (*NodeCreateBulk) Exec

func (_c *NodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreateBulk) ExecX

func (_c *NodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeCreateBulk) Save

func (_c *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error)

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

func (_c *NodeCreateBulk) SaveX(ctx context.Context) []*Node

SaveX is like Save, but panics if an error occurs.

type NodeDelete

type NodeDelete struct {
	// contains filtered or unexported fields
}

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

func (_d *NodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NodeDelete) ExecX

func (_d *NodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NodeDelete) Where

func (_d *NodeDelete) Where(ps ...predicate.Node) *NodeDelete

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

type NodeDeleteOne struct {
	// contains filtered or unexported fields
}

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

func (_d *NodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

func (_d *NodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeDeleteOne) Where

func (_d *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne

Where appends a list predicates to the NodeDelete builder.

type NodeGroupBy

type NodeGroupBy struct {
	// contains filtered or unexported fields
}

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

func (_g *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NodeGroupBy) Bool

func (s *NodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) BoolX

func (s *NodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NodeGroupBy) Bools

func (s *NodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) BoolsX

func (s *NodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NodeGroupBy) Float64

func (s *NodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) Float64X

func (s *NodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NodeGroupBy) Float64s

func (s *NodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) Float64sX

func (s *NodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NodeGroupBy) Int

func (s *NodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) IntX

func (s *NodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NodeGroupBy) Ints

func (s *NodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) IntsX

func (s *NodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NodeGroupBy) Scan

func (_g *NodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NodeGroupBy) ScanX

func (s *NodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NodeGroupBy) String

func (s *NodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) StringX

func (s *NodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NodeGroupBy) Strings

func (s *NodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) StringsX

func (s *NodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NodeMutation

type NodeMutation struct {
	// contains filtered or unexported fields
}

NodeMutation represents an operation that mutates the Node nodes in the graph.

func (*NodeMutation) AddField

func (m *NodeMutation) 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 (*NodeMutation) AddedEdges

func (m *NodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NodeMutation) AddedField

func (m *NodeMutation) 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 (*NodeMutation) AddedFields

func (m *NodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NodeMutation) AddedIDs

func (m *NodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NodeMutation) ClearEdge

func (m *NodeMutation) 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 (*NodeMutation) ClearField

func (m *NodeMutation) 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 (*NodeMutation) ClearedEdges

func (m *NodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NodeMutation) ClearedFields

func (m *NodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NodeMutation) Client

func (m NodeMutation) 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 (*NodeMutation) EdgeCleared

func (m *NodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NodeMutation) Field

func (m *NodeMutation) 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 (*NodeMutation) FieldCleared

func (m *NodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NodeMutation) Fields

func (m *NodeMutation) 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 (*NodeMutation) ID

func (m *NodeMutation) 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 (*NodeMutation) IDs

func (m *NodeMutation) 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 (*NodeMutation) OldField

func (m *NodeMutation) 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 (*NodeMutation) Op

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) RemovedEdges

func (m *NodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NodeMutation) RemovedIDs

func (m *NodeMutation) 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 (*NodeMutation) ResetEdge

func (m *NodeMutation) 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 (*NodeMutation) ResetField

func (m *NodeMutation) 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 (*NodeMutation) SetField

func (m *NodeMutation) 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 (*NodeMutation) SetID

func (m *NodeMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Node entities.

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (NodeMutation) Tx

func (m NodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

Type returns the node type of this mutation (Node).

func (*NodeMutation) Where

func (m *NodeMutation) Where(ps ...predicate.Node)

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

func (m *NodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NodeQuery

type NodeQuery struct {
	// contains filtered or unexported fields
}

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

func (_q *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

func (_q *NodeQuery) All(ctx context.Context) ([]*Node, error)

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

func (_q *NodeQuery) AllX(ctx context.Context) []*Node

AllX is like All, but panics if an error occurs.

func (*NodeQuery) Clone

func (_q *NodeQuery) Clone() *NodeQuery

Clone returns a duplicate of the NodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NodeQuery) Count

func (_q *NodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeQuery) CountX

func (_q *NodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NodeQuery) Exist

func (_q *NodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NodeQuery) ExistX

func (_q *NodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NodeQuery) First

func (_q *NodeQuery) First(ctx context.Context) (*Node, error)

First returns the first Node entity from the query. Returns a *NotFoundError when no Node was found.

func (*NodeQuery) FirstID

func (_q *NodeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Node ID from the query. Returns a *NotFoundError when no Node ID was found.

func (*NodeQuery) FirstIDX

func (_q *NodeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NodeQuery) FirstX

func (_q *NodeQuery) FirstX(ctx context.Context) *Node

FirstX is like First, but panics if an error occurs.

func (*NodeQuery) GroupBy

func (_q *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy

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.

func (*NodeQuery) IDs

func (_q *NodeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Node IDs.

func (*NodeQuery) IDsX

func (_q *NodeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NodeQuery) Limit

func (_q *NodeQuery) Limit(limit int) *NodeQuery

Limit the number of records to be returned by this query.

func (*NodeQuery) Offset

func (_q *NodeQuery) Offset(offset int) *NodeQuery

Offset to start from.

func (*NodeQuery) Only

func (_q *NodeQuery) Only(ctx context.Context) (*Node, error)

Only returns a single Node entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Node entity is found. Returns a *NotFoundError when no Node entities are found.

func (*NodeQuery) OnlyID

func (_q *NodeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Node ID in the query. Returns a *NotSingularError when more than one Node ID is found. Returns a *NotFoundError when no entities are found.

func (*NodeQuery) OnlyIDX

func (_q *NodeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NodeQuery) OnlyX

func (_q *NodeQuery) OnlyX(ctx context.Context) *Node

OnlyX is like Only, but panics if an error occurs.

func (*NodeQuery) Order

func (_q *NodeQuery) Order(o ...node.OrderOption) *NodeQuery

Order specifies how the records should be ordered.

func (*NodeQuery) Select

func (_q *NodeQuery) Select(fields ...string) *NodeSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*NodeQuery) Unique

func (_q *NodeQuery) Unique(unique bool) *NodeQuery

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 (*NodeQuery) Where

func (_q *NodeQuery) Where(ps ...predicate.Node) *NodeQuery

Where adds a new predicate for the NodeQuery builder.

type NodeSelect

type NodeSelect struct {
	*NodeQuery
	// contains filtered or unexported fields
}

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

func (_s *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

func (s *NodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NodeSelect) BoolX

func (s *NodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NodeSelect) Bools

func (s *NodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NodeSelect) BoolsX

func (s *NodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NodeSelect) Float64

func (s *NodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NodeSelect) Float64X

func (s *NodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NodeSelect) Float64s

func (s *NodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NodeSelect) Float64sX

func (s *NodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NodeSelect) Int

func (s *NodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NodeSelect) IntX

func (s *NodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NodeSelect) Ints

func (s *NodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NodeSelect) IntsX

func (s *NodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NodeSelect) Scan

func (_s *NodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NodeSelect) ScanX

func (s *NodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NodeSelect) String

func (s *NodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NodeSelect) StringX

func (s *NodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NodeSelect) Strings

func (s *NodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NodeSelect) StringsX

func (s *NodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NodeUpdate

type NodeUpdate struct {
	// contains filtered or unexported fields
}

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) Exec

func (_u *NodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpdate) ExecX

func (_u *NodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeUpdate) Mutation

func (_u *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) Save

func (_u *NodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NodeUpdate) SaveX

func (_u *NodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NodeUpdate) Where

func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

type NodeUpdateOne struct {
	// contains filtered or unexported fields
}

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) Exec

func (_u *NodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

func (_u *NodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeUpdateOne) Mutation

func (_u *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) Save

func (_u *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (_u *NodeUpdateOne) SaveX(ctx context.Context) *Node

SaveX is like Save, but panics if an error occurs.

func (*NodeUpdateOne) Select

func (_u *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NodeUpdateOne) Where

func (_u *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

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.

func (*NotFoundError) Is

func (e *NotFoundError) Is(target error) bool

Is makes errors.Is(err, schemakit.ErrEntityNotFound) true for ent's not-found errors, so the engine recognizes the module's missing record as it does the core's (its handlers answer 404).

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 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 {

	// ContentTypeDef is the client for interacting with the ContentTypeDef builders.
	ContentTypeDef *ContentTypeDefClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Gallery is the client for interacting with the Gallery builders.
	Gallery *GalleryClient
	// GalleryContentType is the client for interacting with the GalleryContentType builders.
	GalleryContentType *GalleryContentTypeClient
	// GalleryItem is the client for interacting with the GalleryItem builders.
	GalleryItem *GalleryItemClient
	// GalleryNode is the client for interacting with the GalleryNode builders.
	GalleryNode *GalleryNodeClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL