ent

package
v0.0.0-...-eeb60d1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeFile     = "File"
	TypeFiletype = "Filetype"
	TypeTag      = "Tag"
	TypeUser     = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// File is the client for interacting with the File builders.
	File *FileClient
	// Filetype is the client for interacting with the Filetype builders.
	Filetype *FiletypeClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	File.
	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 File

type File struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID string `json:"uuid,omitempty"`
	// Size holds the value of the "size" field.
	Size int `json:"size,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileQuery when eager-loading is set.
	Edges FileEdges `json:"edges"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) QueryFiletype

func (f *File) QueryFiletype() *FiletypeQuery

QueryFiletype queries the "filetype" edge of the File entity.

func (*File) QueryTags

func (f *File) QueryTags() *TagQuery

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

func (*File) QueryUser

func (f *File) QueryUser() *UserQuery

QueryUser queries the "user" edge of the File entity.

func (*File) String

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap

func (f *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 (f *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 (f *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(f *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) QueryFiletype

func (c *FileClient) QueryFiletype(f *File) *FiletypeQuery

QueryFiletype queries the filetype edge of a File.

func (*FileClient) QueryTags

func (c *FileClient) QueryTags(f *File) *TagQuery

QueryTags queries the tags edge of a File.

func (*FileClient) QueryUser

func (c *FileClient) QueryUser(f *File) *UserQuery

QueryUser queries the user edge of a File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(f *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) AddTagIDs

func (fc *FileCreate) AddTagIDs(ids ...string) *FileCreate

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

func (*FileCreate) AddTags

func (fc *FileCreate) AddTags(t ...*Tag) *FileCreate

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

func (*FileCreate) Exec

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

Exec executes the query.

func (*FileCreate) ExecX

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

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

func (*FileCreate) Mutation

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) OnConflict

func (fc *FileCreate) OnConflict(opts ...sql.ConflictOption) *FileUpsertOne

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

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

func (*FileCreate) OnConflictColumns

func (fc *FileCreate) OnConflictColumns(columns ...string) *FileUpsertOne

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

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

func (*FileCreate) Save

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

Save creates the File in the database.

func (*FileCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FileCreate) SetDeletedAt

func (fc *FileCreate) SetDeletedAt(t time.Time) *FileCreate

SetDeletedAt sets the "deleted_at" field.

func (*FileCreate) SetFiletype

func (fc *FileCreate) SetFiletype(f *Filetype) *FileCreate

SetFiletype sets the "filetype" edge to the Filetype entity.

func (*FileCreate) SetFiletypeID

func (fc *FileCreate) SetFiletypeID(id string) *FileCreate

SetFiletypeID sets the "filetype" edge to the Filetype entity by ID.

func (*FileCreate) SetName

func (fc *FileCreate) SetName(s string) *FileCreate

SetName sets the "name" field.

func (*FileCreate) SetNillableCreatedAt

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

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

func (*FileCreate) SetNillableDeletedAt

func (fc *FileCreate) SetNillableDeletedAt(t *time.Time) *FileCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FileCreate) SetNillableUpdatedAt

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

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

func (*FileCreate) SetSize

func (fc *FileCreate) SetSize(i int) *FileCreate

SetSize sets the "size" field.

func (*FileCreate) SetType

func (fc *FileCreate) SetType(s string) *FileCreate

SetType sets the "type" field.

func (*FileCreate) SetUUID

func (fc *FileCreate) SetUUID(s string) *FileCreate

SetUUID sets the "uuid" field.

func (*FileCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileCreate) SetUser

func (fc *FileCreate) SetUser(u *User) *FileCreate

SetUser sets the "user" edge to the User entity.

func (*FileCreate) SetUserID

func (fc *FileCreate) SetUserID(i int) *FileCreate

SetUserID sets the "user_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 (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecX

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

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

func (*FileCreateBulk) OnConflict

func (fcb *FileCreateBulk) OnConflict(opts ...sql.ConflictOption) *FileUpsertBulk

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

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

func (*FileCreateBulk) OnConflictColumns

func (fcb *FileCreateBulk) OnConflictColumns(columns ...string) *FileUpsertBulk

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

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

func (*FileCreateBulk) Save

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

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (fcb *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 (fd *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecX

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

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

func (*FileDelete) Where

func (fd *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 (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

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

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

func (*FileDeleteOne) Where

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

Where appends a list predicates to the FileDelete builder.

type FileEdges

type FileEdges struct {
	// User holds the value of the user edge.
	User *User `json:"files"`
	// Filetype holds the value of the filetype edge.
	Filetype *Filetype `json:"files"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (FileEdges) FiletypeOrErr

func (e FileEdges) FiletypeOrErr() (*Filetype, error)

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

func (FileEdges) TagsOrErr

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

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

func (FileEdges) UserOrErr

func (e FileEdges) UserOrErr() (*User, error)

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

type FileGroupBy

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (fgb *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 (fgb *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) AddSize

func (m *FileMutation) AddSize(i int)

AddSize adds i to the "size" field.

func (*FileMutation) AddTagIDs

func (m *FileMutation) AddTagIDs(ids ...string)

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

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

func (m *FileMutation) AddedSize() (r int, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*FileMutation) ClearCreatedAt

func (m *FileMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*FileMutation) ClearDeletedAt

func (m *FileMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

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

func (m *FileMutation) ClearFiletype()

ClearFiletype clears the "filetype" edge to the Filetype entity.

func (*FileMutation) ClearTags

func (m *FileMutation) ClearTags()

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

func (*FileMutation) ClearUser

func (m *FileMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

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

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

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

func (*FileMutation) CreatedAtCleared

func (m *FileMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*FileMutation) DeletedAt

func (m *FileMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*FileMutation) DeletedAtCleared

func (m *FileMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

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

func (m *FileMutation) FiletypeCleared() bool

FiletypeCleared reports if the "filetype" edge to the Filetype entity was cleared.

func (*FileMutation) FiletypeID

func (m *FileMutation) FiletypeID() (id string, exists bool)

FiletypeID returns the "filetype" edge ID in the mutation.

func (*FileMutation) FiletypeIDs

func (m *FileMutation) FiletypeIDs() (ids []string)

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

func (*FileMutation) GetType

func (m *FileMutation) GetType() (r string, exists bool)

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

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

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

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

func (*FileMutation) OldCreatedAt

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

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

func (m *FileMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the File entity. If the File 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 (*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) OldName

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

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

func (m *FileMutation) OldSize(ctx context.Context) (v int, err error)

OldSize returns the old "size" field's value of the File entity. If the File 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 (*FileMutation) OldType

func (m *FileMutation) OldType(ctx context.Context) (v string, err error)

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

func (m *FileMutation) OldUUID(ctx context.Context) (v string, err error)

OldUUID returns the old "uuid" field's value of the File entity. If the File 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 (*FileMutation) OldUpdatedAt

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

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

func (m *FileMutation) OldUserID(ctx context.Context) (v int, err error)

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

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) RemoveTagIDs

func (m *FileMutation) RemoveTagIDs(ids ...string)

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

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

func (m *FileMutation) RemovedTagsIDs() (ids []string)

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

func (*FileMutation) ResetCreatedAt

func (m *FileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FileMutation) ResetDeletedAt

func (m *FileMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

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

func (m *FileMutation) ResetFiletype()

ResetFiletype resets all changes to the "filetype" edge.

func (*FileMutation) ResetName

func (m *FileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileMutation) ResetSize

func (m *FileMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*FileMutation) ResetTags

func (m *FileMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*FileMutation) ResetType

func (m *FileMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*FileMutation) ResetUUID

func (m *FileMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*FileMutation) ResetUpdatedAt

func (m *FileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FileMutation) ResetUser

func (m *FileMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*FileMutation) ResetUserID

func (m *FileMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*FileMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FileMutation) SetDeletedAt

func (m *FileMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

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

func (m *FileMutation) SetFiletypeID(id string)

SetFiletypeID sets the "filetype" edge to the Filetype entity by id.

func (*FileMutation) SetName

func (m *FileMutation) SetName(s string)

SetName sets the "name" field.

func (*FileMutation) SetOp

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileMutation) SetSize

func (m *FileMutation) SetSize(i int)

SetSize sets the "size" field.

func (*FileMutation) SetType

func (m *FileMutation) SetType(s string)

SetType sets the "type" field.

func (*FileMutation) SetUUID

func (m *FileMutation) SetUUID(s string)

SetUUID sets the "uuid" field.

func (*FileMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileMutation) SetUserID

func (m *FileMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*FileMutation) Size

func (m *FileMutation) Size() (r int, exists bool)

Size returns the value of the "size" field in the mutation.

func (*FileMutation) TagsCleared

func (m *FileMutation) TagsCleared() bool

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

func (*FileMutation) TagsIDs

func (m *FileMutation) TagsIDs() (ids []string)

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

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

func (m *FileMutation) UUID() (r string, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*FileMutation) UpdatedAt

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

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

func (*FileMutation) UserCleared

func (m *FileMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*FileMutation) UserID

func (m *FileMutation) UserID() (r int, exists bool)

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

func (*FileMutation) UserIDs

func (m *FileMutation) UserIDs() (ids []int)

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

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 (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

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

All executes the query and returns a list of Files.

func (*FileQuery) AllX

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

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

func (*FileQuery) Clone

func (fq *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 (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

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

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

func (*FileQuery) Exist

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

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

func (*FileQuery) ExistX

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

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

func (*FileQuery) First

func (fq *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 (fq *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 (fq *FileQuery) FirstIDX(ctx context.Context) int

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

func (*FileQuery) FirstX

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

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

func (*FileQuery) ForShare

func (fq *FileQuery) ForShare(opts ...sql.LockOption) *FileQuery

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

func (*FileQuery) ForUpdate

func (fq *FileQuery) ForUpdate(opts ...sql.LockOption) *FileQuery

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

func (*FileQuery) GroupBy

func (fq *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.

Example:

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

client.File.Query().
	GroupBy(file.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs

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

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

func (*FileQuery) IDsX

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

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

func (*FileQuery) Limit

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

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

func (*FileQuery) Offset

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

Offset to start from.

func (*FileQuery) Only

func (fq *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 (fq *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 (fq *FileQuery) OnlyIDX(ctx context.Context) int

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

func (*FileQuery) OnlyX

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

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

func (*FileQuery) Order

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

Order specifies how the records should be ordered.

func (*FileQuery) QueryFiletype

func (fq *FileQuery) QueryFiletype() *FiletypeQuery

QueryFiletype chains the current query on the "filetype" edge.

func (*FileQuery) QueryTags

func (fq *FileQuery) QueryTags() *TagQuery

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

func (*FileQuery) QueryUser

func (fq *FileQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*FileQuery) Select

func (fq *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.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.File.Query().
	Select(file.FieldName).
	Scan(ctx, &v)

func (*FileQuery) Unique

func (fq *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 (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WithFiletype

func (fq *FileQuery) WithFiletype(opts ...func(*FiletypeQuery)) *FileQuery

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

func (*FileQuery) WithTags

func (fq *FileQuery) WithTags(opts ...func(*TagQuery)) *FileQuery

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

func (*FileQuery) WithUser

func (fq *FileQuery) WithUser(opts ...func(*UserQuery)) *FileQuery

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

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 (fs *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 (fs *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) AddSize

func (fu *FileUpdate) AddSize(i int) *FileUpdate

AddSize adds i to the "size" field.

func (*FileUpdate) AddTagIDs

func (fu *FileUpdate) AddTagIDs(ids ...string) *FileUpdate

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

func (*FileUpdate) AddTags

func (fu *FileUpdate) AddTags(t ...*Tag) *FileUpdate

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

func (*FileUpdate) ClearCreatedAt

func (fu *FileUpdate) ClearCreatedAt() *FileUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpdate) ClearDeletedAt

func (fu *FileUpdate) ClearDeletedAt() *FileUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FileUpdate) ClearFiletype

func (fu *FileUpdate) ClearFiletype() *FileUpdate

ClearFiletype clears the "filetype" edge to the Filetype entity.

func (*FileUpdate) ClearTags

func (fu *FileUpdate) ClearTags() *FileUpdate

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

func (*FileUpdate) ClearUser

func (fu *FileUpdate) ClearUser() *FileUpdate

ClearUser clears the "user" edge to the User entity.

func (*FileUpdate) Exec

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

Exec executes the query.

func (*FileUpdate) ExecX

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

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

func (*FileUpdate) Mutation

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) RemoveTagIDs

func (fu *FileUpdate) RemoveTagIDs(ids ...string) *FileUpdate

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

func (*FileUpdate) RemoveTags

func (fu *FileUpdate) RemoveTags(t ...*Tag) *FileUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*FileUpdate) Save

func (fu *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 (fu *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) SetCreatedAt

func (fu *FileUpdate) SetCreatedAt(t time.Time) *FileUpdate

SetCreatedAt sets the "created_at" field.

func (*FileUpdate) SetDeletedAt

func (fu *FileUpdate) SetDeletedAt(t time.Time) *FileUpdate

SetDeletedAt sets the "deleted_at" field.

func (*FileUpdate) SetFiletype

func (fu *FileUpdate) SetFiletype(f *Filetype) *FileUpdate

SetFiletype sets the "filetype" edge to the Filetype entity.

func (*FileUpdate) SetFiletypeID

func (fu *FileUpdate) SetFiletypeID(id string) *FileUpdate

SetFiletypeID sets the "filetype" edge to the Filetype entity by ID.

func (*FileUpdate) SetName

func (fu *FileUpdate) SetName(s string) *FileUpdate

SetName sets the "name" field.

func (*FileUpdate) SetNillableCreatedAt

func (fu *FileUpdate) SetNillableCreatedAt(t *time.Time) *FileUpdate

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

func (*FileUpdate) SetNillableDeletedAt

func (fu *FileUpdate) SetNillableDeletedAt(t *time.Time) *FileUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FileUpdate) SetNillableName

func (fu *FileUpdate) SetNillableName(s *string) *FileUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FileUpdate) SetNillableSize

func (fu *FileUpdate) SetNillableSize(i *int) *FileUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdate) SetNillableType

func (fu *FileUpdate) SetNillableType(s *string) *FileUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*FileUpdate) SetNillableUUID

func (fu *FileUpdate) SetNillableUUID(s *string) *FileUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*FileUpdate) SetNillableUserID

func (fu *FileUpdate) SetNillableUserID(i *int) *FileUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FileUpdate) SetSize

func (fu *FileUpdate) SetSize(i int) *FileUpdate

SetSize sets the "size" field.

func (*FileUpdate) SetType

func (fu *FileUpdate) SetType(s string) *FileUpdate

SetType sets the "type" field.

func (*FileUpdate) SetUUID

func (fu *FileUpdate) SetUUID(s string) *FileUpdate

SetUUID sets the "uuid" field.

func (*FileUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdate) SetUser

func (fu *FileUpdate) SetUser(u *User) *FileUpdate

SetUser sets the "user" edge to the User entity.

func (*FileUpdate) SetUserID

func (fu *FileUpdate) SetUserID(i int) *FileUpdate

SetUserID sets the "user_id" field.

func (*FileUpdate) Where

func (fu *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) AddSize

func (fuo *FileUpdateOne) AddSize(i int) *FileUpdateOne

AddSize adds i to the "size" field.

func (*FileUpdateOne) AddTagIDs

func (fuo *FileUpdateOne) AddTagIDs(ids ...string) *FileUpdateOne

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

func (*FileUpdateOne) AddTags

func (fuo *FileUpdateOne) AddTags(t ...*Tag) *FileUpdateOne

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

func (*FileUpdateOne) ClearCreatedAt

func (fuo *FileUpdateOne) ClearCreatedAt() *FileUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpdateOne) ClearDeletedAt

func (fuo *FileUpdateOne) ClearDeletedAt() *FileUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FileUpdateOne) ClearFiletype

func (fuo *FileUpdateOne) ClearFiletype() *FileUpdateOne

ClearFiletype clears the "filetype" edge to the Filetype entity.

func (*FileUpdateOne) ClearTags

func (fuo *FileUpdateOne) ClearTags() *FileUpdateOne

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

func (*FileUpdateOne) ClearUser

func (fuo *FileUpdateOne) ClearUser() *FileUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*FileUpdateOne) Exec

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

Exec executes the query on the entity.

func (*FileUpdateOne) ExecX

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

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

func (*FileUpdateOne) Mutation

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) RemoveTagIDs

func (fuo *FileUpdateOne) RemoveTagIDs(ids ...string) *FileUpdateOne

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

func (*FileUpdateOne) RemoveTags

func (fuo *FileUpdateOne) RemoveTags(t ...*Tag) *FileUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*FileUpdateOne) Save

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

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

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

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

func (*FileUpdateOne) Select

func (fuo *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) SetCreatedAt

func (fuo *FileUpdateOne) SetCreatedAt(t time.Time) *FileUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FileUpdateOne) SetDeletedAt

func (fuo *FileUpdateOne) SetDeletedAt(t time.Time) *FileUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*FileUpdateOne) SetFiletype

func (fuo *FileUpdateOne) SetFiletype(f *Filetype) *FileUpdateOne

SetFiletype sets the "filetype" edge to the Filetype entity.

func (*FileUpdateOne) SetFiletypeID

func (fuo *FileUpdateOne) SetFiletypeID(id string) *FileUpdateOne

SetFiletypeID sets the "filetype" edge to the Filetype entity by ID.

func (*FileUpdateOne) SetName

func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne

SetName sets the "name" field.

func (*FileUpdateOne) SetNillableCreatedAt

func (fuo *FileUpdateOne) SetNillableCreatedAt(t *time.Time) *FileUpdateOne

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

func (*FileUpdateOne) SetNillableDeletedAt

func (fuo *FileUpdateOne) SetNillableDeletedAt(t *time.Time) *FileUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FileUpdateOne) SetNillableName

func (fuo *FileUpdateOne) SetNillableName(s *string) *FileUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FileUpdateOne) SetNillableSize

func (fuo *FileUpdateOne) SetNillableSize(i *int) *FileUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdateOne) SetNillableType

func (fuo *FileUpdateOne) SetNillableType(s *string) *FileUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*FileUpdateOne) SetNillableUUID

func (fuo *FileUpdateOne) SetNillableUUID(s *string) *FileUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*FileUpdateOne) SetNillableUserID

func (fuo *FileUpdateOne) SetNillableUserID(i *int) *FileUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FileUpdateOne) SetSize

func (fuo *FileUpdateOne) SetSize(i int) *FileUpdateOne

SetSize sets the "size" field.

func (*FileUpdateOne) SetType

func (fuo *FileUpdateOne) SetType(s string) *FileUpdateOne

SetType sets the "type" field.

func (*FileUpdateOne) SetUUID

func (fuo *FileUpdateOne) SetUUID(s string) *FileUpdateOne

SetUUID sets the "uuid" field.

func (*FileUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdateOne) SetUser

func (fuo *FileUpdateOne) SetUser(u *User) *FileUpdateOne

SetUser sets the "user" edge to the User entity.

func (*FileUpdateOne) SetUserID

func (fuo *FileUpdateOne) SetUserID(i int) *FileUpdateOne

SetUserID sets the "user_id" field.

func (*FileUpdateOne) Where

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

Where appends a list predicates to the FileUpdate builder.

type FileUpsert

type FileUpsert struct {
	*sql.UpdateSet
}

FileUpsert is the "OnConflict" setter.

func (*FileUpsert) AddSize

func (u *FileUpsert) AddSize(v int) *FileUpsert

AddSize adds v to the "size" field.

func (*FileUpsert) ClearCreatedAt

func (u *FileUpsert) ClearCreatedAt() *FileUpsert

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpsert) ClearDeletedAt

func (u *FileUpsert) ClearDeletedAt() *FileUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FileUpsert) SetCreatedAt

func (u *FileUpsert) SetCreatedAt(v time.Time) *FileUpsert

SetCreatedAt sets the "created_at" field.

func (*FileUpsert) SetDeletedAt

func (u *FileUpsert) SetDeletedAt(v time.Time) *FileUpsert

SetDeletedAt sets the "deleted_at" field.

func (*FileUpsert) SetName

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

SetName sets the "name" field.

func (*FileUpsert) SetSize

func (u *FileUpsert) SetSize(v int) *FileUpsert

SetSize sets the "size" field.

func (*FileUpsert) SetType

func (u *FileUpsert) SetType(v string) *FileUpsert

SetType sets the "type" field.

func (*FileUpsert) SetUUID

func (u *FileUpsert) SetUUID(v string) *FileUpsert

SetUUID sets the "uuid" field.

func (*FileUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileUpsert) SetUserID

func (u *FileUpsert) SetUserID(v int) *FileUpsert

SetUserID sets the "user_id" field.

func (*FileUpsert) UpdateCreatedAt

func (u *FileUpsert) UpdateCreatedAt() *FileUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FileUpsert) UpdateDeletedAt

func (u *FileUpsert) UpdateDeletedAt() *FileUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FileUpsert) UpdateName

func (u *FileUpsert) UpdateName() *FileUpsert

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

func (*FileUpsert) UpdateSize

func (u *FileUpsert) UpdateSize() *FileUpsert

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsert) UpdateType

func (u *FileUpsert) UpdateType() *FileUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*FileUpsert) UpdateUUID

func (u *FileUpsert) UpdateUUID() *FileUpsert

UpdateUUID sets the "uuid" field to the value that was provided on create.

func (*FileUpsert) UpdateUpdatedAt

func (u *FileUpsert) UpdateUpdatedAt() *FileUpsert

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

func (*FileUpsert) UpdateUserID

func (u *FileUpsert) UpdateUserID() *FileUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type FileUpsertBulk

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

FileUpsertBulk is the builder for "upsert"-ing a bulk of File nodes.

func (*FileUpsertBulk) AddSize

func (u *FileUpsertBulk) AddSize(v int) *FileUpsertBulk

AddSize adds v to the "size" field.

func (*FileUpsertBulk) ClearCreatedAt

func (u *FileUpsertBulk) ClearCreatedAt() *FileUpsertBulk

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpsertBulk) ClearDeletedAt

func (u *FileUpsertBulk) ClearDeletedAt() *FileUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FileUpsertBulk) DoNothing

func (u *FileUpsertBulk) DoNothing() *FileUpsertBulk

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

func (*FileUpsertBulk) Exec

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

Exec executes the query.

func (*FileUpsertBulk) ExecX

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

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

func (*FileUpsertBulk) Ignore

func (u *FileUpsertBulk) Ignore() *FileUpsertBulk

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

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

func (*FileUpsertBulk) SetCreatedAt

func (u *FileUpsertBulk) SetCreatedAt(v time.Time) *FileUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*FileUpsertBulk) SetDeletedAt

func (u *FileUpsertBulk) SetDeletedAt(v time.Time) *FileUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*FileUpsertBulk) SetName

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

SetName sets the "name" field.

func (*FileUpsertBulk) SetSize

func (u *FileUpsertBulk) SetSize(v int) *FileUpsertBulk

SetSize sets the "size" field.

func (*FileUpsertBulk) SetType

func (u *FileUpsertBulk) SetType(v string) *FileUpsertBulk

SetType sets the "type" field.

func (*FileUpsertBulk) SetUUID

func (u *FileUpsertBulk) SetUUID(v string) *FileUpsertBulk

SetUUID sets the "uuid" field.

func (*FileUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileUpsertBulk) SetUserID

func (u *FileUpsertBulk) SetUserID(v int) *FileUpsertBulk

SetUserID sets the "user_id" field.

func (*FileUpsertBulk) Update

func (u *FileUpsertBulk) Update(set func(*FileUpsert)) *FileUpsertBulk

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

func (*FileUpsertBulk) UpdateCreatedAt

func (u *FileUpsertBulk) UpdateCreatedAt() *FileUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateDeletedAt

func (u *FileUpsertBulk) UpdateDeletedAt() *FileUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateName

func (u *FileUpsertBulk) UpdateName() *FileUpsertBulk

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

func (*FileUpsertBulk) UpdateNewValues

func (u *FileUpsertBulk) UpdateNewValues() *FileUpsertBulk

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

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

func (*FileUpsertBulk) UpdateSize

func (u *FileUpsertBulk) UpdateSize() *FileUpsertBulk

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateType

func (u *FileUpsertBulk) UpdateType() *FileUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateUUID

func (u *FileUpsertBulk) UpdateUUID() *FileUpsertBulk

UpdateUUID sets the "uuid" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateUpdatedAt

func (u *FileUpsertBulk) UpdateUpdatedAt() *FileUpsertBulk

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

func (*FileUpsertBulk) UpdateUserID

func (u *FileUpsertBulk) UpdateUserID() *FileUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type FileUpsertOne

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

FileUpsertOne is the builder for "upsert"-ing

one File node.

func (*FileUpsertOne) AddSize

func (u *FileUpsertOne) AddSize(v int) *FileUpsertOne

AddSize adds v to the "size" field.

func (*FileUpsertOne) ClearCreatedAt

func (u *FileUpsertOne) ClearCreatedAt() *FileUpsertOne

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpsertOne) ClearDeletedAt

func (u *FileUpsertOne) ClearDeletedAt() *FileUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FileUpsertOne) DoNothing

func (u *FileUpsertOne) DoNothing() *FileUpsertOne

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

func (*FileUpsertOne) Exec

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

Exec executes the query.

func (*FileUpsertOne) ExecX

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

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

func (*FileUpsertOne) ID

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

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

func (*FileUpsertOne) IDX

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

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

func (*FileUpsertOne) Ignore

func (u *FileUpsertOne) Ignore() *FileUpsertOne

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

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

func (*FileUpsertOne) SetCreatedAt

func (u *FileUpsertOne) SetCreatedAt(v time.Time) *FileUpsertOne

SetCreatedAt sets the "created_at" field.

func (*FileUpsertOne) SetDeletedAt

func (u *FileUpsertOne) SetDeletedAt(v time.Time) *FileUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*FileUpsertOne) SetName

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

SetName sets the "name" field.

func (*FileUpsertOne) SetSize

func (u *FileUpsertOne) SetSize(v int) *FileUpsertOne

SetSize sets the "size" field.

func (*FileUpsertOne) SetType

func (u *FileUpsertOne) SetType(v string) *FileUpsertOne

SetType sets the "type" field.

func (*FileUpsertOne) SetUUID

func (u *FileUpsertOne) SetUUID(v string) *FileUpsertOne

SetUUID sets the "uuid" field.

func (*FileUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileUpsertOne) SetUserID

func (u *FileUpsertOne) SetUserID(v int) *FileUpsertOne

SetUserID sets the "user_id" field.

func (*FileUpsertOne) Update

func (u *FileUpsertOne) Update(set func(*FileUpsert)) *FileUpsertOne

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

func (*FileUpsertOne) UpdateCreatedAt

func (u *FileUpsertOne) UpdateCreatedAt() *FileUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FileUpsertOne) UpdateDeletedAt

func (u *FileUpsertOne) UpdateDeletedAt() *FileUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FileUpsertOne) UpdateName

func (u *FileUpsertOne) UpdateName() *FileUpsertOne

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

func (*FileUpsertOne) UpdateNewValues

func (u *FileUpsertOne) UpdateNewValues() *FileUpsertOne

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

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

func (*FileUpsertOne) UpdateSize

func (u *FileUpsertOne) UpdateSize() *FileUpsertOne

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsertOne) UpdateType

func (u *FileUpsertOne) UpdateType() *FileUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*FileUpsertOne) UpdateUUID

func (u *FileUpsertOne) UpdateUUID() *FileUpsertOne

UpdateUUID sets the "uuid" field to the value that was provided on create.

func (*FileUpsertOne) UpdateUpdatedAt

func (u *FileUpsertOne) UpdateUpdatedAt() *FileUpsertOne

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

func (*FileUpsertOne) UpdateUserID

func (u *FileUpsertOne) UpdateUserID() *FileUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type Files

type Files []*File

Files is a parsable slice of File.

type Filetype

type Filetype struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// AllowedSize holds the value of the "allowed_size" field.
	AllowedSize int `json:"allowed_size,omitempty"`
	// IsBanned holds the value of the "is_banned" field.
	IsBanned bool `json:"is_banned,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 FiletypeQuery when eager-loading is set.
	Edges FiletypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Filetype is the model entity for the Filetype schema.

func (*Filetype) QueryFiles

func (f *Filetype) QueryFiles() *FileQuery

QueryFiles queries the "files" edge of the Filetype entity.

func (*Filetype) String

func (f *Filetype) String() string

String implements the fmt.Stringer.

func (*Filetype) Unwrap

func (f *Filetype) Unwrap() *Filetype

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

func (f *Filetype) Update() *FiletypeUpdateOne

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

func (*Filetype) Value

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

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

type FiletypeClient

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

FiletypeClient is a client for the Filetype schema.

func NewFiletypeClient

func NewFiletypeClient(c config) *FiletypeClient

NewFiletypeClient returns a client for the Filetype from the given config.

func (*FiletypeClient) Create

func (c *FiletypeClient) Create() *FiletypeCreate

Create returns a builder for creating a Filetype entity.

func (*FiletypeClient) CreateBulk

func (c *FiletypeClient) CreateBulk(builders ...*FiletypeCreate) *FiletypeCreateBulk

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

func (*FiletypeClient) Delete

func (c *FiletypeClient) Delete() *FiletypeDelete

Delete returns a delete builder for Filetype.

func (*FiletypeClient) DeleteOne

func (c *FiletypeClient) DeleteOne(f *Filetype) *FiletypeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FiletypeClient) DeleteOneID

func (c *FiletypeClient) DeleteOneID(id string) *FiletypeDeleteOne

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

func (*FiletypeClient) Get

func (c *FiletypeClient) Get(ctx context.Context, id string) (*Filetype, error)

Get returns a Filetype entity by its id.

func (*FiletypeClient) GetX

func (c *FiletypeClient) GetX(ctx context.Context, id string) *Filetype

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

func (*FiletypeClient) Hooks

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

Hooks returns the client hooks.

func (*FiletypeClient) Intercept

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

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

func (*FiletypeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FiletypeClient) MapCreateBulk

func (c *FiletypeClient) MapCreateBulk(slice any, setFunc func(*FiletypeCreate, int)) *FiletypeCreateBulk

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

func (c *FiletypeClient) Query() *FiletypeQuery

Query returns a query builder for Filetype.

func (*FiletypeClient) QueryFiles

func (c *FiletypeClient) QueryFiles(f *Filetype) *FileQuery

QueryFiles queries the files edge of a Filetype.

func (*FiletypeClient) Update

func (c *FiletypeClient) Update() *FiletypeUpdate

Update returns an update builder for Filetype.

func (*FiletypeClient) UpdateOne

func (c *FiletypeClient) UpdateOne(f *Filetype) *FiletypeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FiletypeClient) UpdateOneID

func (c *FiletypeClient) UpdateOneID(id string) *FiletypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FiletypeClient) Use

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

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

type FiletypeCreate

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

FiletypeCreate is the builder for creating a Filetype entity.

func (*FiletypeCreate) AddFileIDs

func (fc *FiletypeCreate) AddFileIDs(ids ...int) *FiletypeCreate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FiletypeCreate) AddFiles

func (fc *FiletypeCreate) AddFiles(f ...*File) *FiletypeCreate

AddFiles adds the "files" edges to the File entity.

func (*FiletypeCreate) Exec

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

Exec executes the query.

func (*FiletypeCreate) ExecX

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

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

func (*FiletypeCreate) Mutation

func (fc *FiletypeCreate) Mutation() *FiletypeMutation

Mutation returns the FiletypeMutation object of the builder.

func (*FiletypeCreate) OnConflict

func (fc *FiletypeCreate) OnConflict(opts ...sql.ConflictOption) *FiletypeUpsertOne

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

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

func (*FiletypeCreate) OnConflictColumns

func (fc *FiletypeCreate) OnConflictColumns(columns ...string) *FiletypeUpsertOne

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

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

func (*FiletypeCreate) Save

func (fc *FiletypeCreate) Save(ctx context.Context) (*Filetype, error)

Save creates the Filetype in the database.

func (*FiletypeCreate) SaveX

func (fc *FiletypeCreate) SaveX(ctx context.Context) *Filetype

SaveX calls Save and panics if Save returns an error.

func (*FiletypeCreate) SetAllowedSize

func (fc *FiletypeCreate) SetAllowedSize(i int) *FiletypeCreate

SetAllowedSize sets the "allowed_size" field.

func (*FiletypeCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FiletypeCreate) SetID

func (fc *FiletypeCreate) SetID(s string) *FiletypeCreate

SetID sets the "id" field.

func (*FiletypeCreate) SetIsBanned

func (fc *FiletypeCreate) SetIsBanned(b bool) *FiletypeCreate

SetIsBanned sets the "is_banned" field.

func (*FiletypeCreate) SetNillableAllowedSize

func (fc *FiletypeCreate) SetNillableAllowedSize(i *int) *FiletypeCreate

SetNillableAllowedSize sets the "allowed_size" field if the given value is not nil.

func (*FiletypeCreate) SetNillableCreatedAt

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

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

func (*FiletypeCreate) SetNillableIsBanned

func (fc *FiletypeCreate) SetNillableIsBanned(b *bool) *FiletypeCreate

SetNillableIsBanned sets the "is_banned" field if the given value is not nil.

func (*FiletypeCreate) SetNillableUpdatedAt

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

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

func (*FiletypeCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type FiletypeCreateBulk

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

FiletypeCreateBulk is the builder for creating many Filetype entities in bulk.

func (*FiletypeCreateBulk) Exec

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

Exec executes the query.

func (*FiletypeCreateBulk) ExecX

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

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

func (*FiletypeCreateBulk) OnConflict

func (fcb *FiletypeCreateBulk) OnConflict(opts ...sql.ConflictOption) *FiletypeUpsertBulk

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

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

func (*FiletypeCreateBulk) OnConflictColumns

func (fcb *FiletypeCreateBulk) OnConflictColumns(columns ...string) *FiletypeUpsertBulk

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

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

func (*FiletypeCreateBulk) Save

func (fcb *FiletypeCreateBulk) Save(ctx context.Context) ([]*Filetype, error)

Save creates the Filetype entities in the database.

func (*FiletypeCreateBulk) SaveX

func (fcb *FiletypeCreateBulk) SaveX(ctx context.Context) []*Filetype

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

type FiletypeDelete

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

FiletypeDelete is the builder for deleting a Filetype entity.

func (*FiletypeDelete) Exec

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

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

func (*FiletypeDelete) ExecX

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

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

func (*FiletypeDelete) Where

func (fd *FiletypeDelete) Where(ps ...predicate.Filetype) *FiletypeDelete

Where appends a list predicates to the FiletypeDelete builder.

type FiletypeDeleteOne

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

FiletypeDeleteOne is the builder for deleting a single Filetype entity.

func (*FiletypeDeleteOne) Exec

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

Exec executes the deletion query.

func (*FiletypeDeleteOne) ExecX

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

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

func (*FiletypeDeleteOne) Where

Where appends a list predicates to the FiletypeDelete builder.

type FiletypeEdges

type FiletypeEdges struct {
	// Files holds the value of the files edge.
	Files []*File `json:"files,omitempty"`
	// contains filtered or unexported fields
}

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

func (FiletypeEdges) FilesOrErr

func (e FiletypeEdges) FilesOrErr() ([]*File, error)

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

type FiletypeGroupBy

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

FiletypeGroupBy is the group-by builder for Filetype entities.

func (*FiletypeGroupBy) Aggregate

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

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

func (*FiletypeGroupBy) Bool

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

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

func (*FiletypeGroupBy) BoolX

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

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

func (*FiletypeGroupBy) Bools

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

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

func (*FiletypeGroupBy) BoolsX

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

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

func (*FiletypeGroupBy) Float64

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

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

func (*FiletypeGroupBy) Float64X

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

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

func (*FiletypeGroupBy) Float64s

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

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

func (*FiletypeGroupBy) Float64sX

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

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

func (*FiletypeGroupBy) Int

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

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

func (*FiletypeGroupBy) IntX

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

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

func (*FiletypeGroupBy) Ints

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

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

func (*FiletypeGroupBy) IntsX

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

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

func (*FiletypeGroupBy) Scan

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

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

func (*FiletypeGroupBy) ScanX

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

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

func (*FiletypeGroupBy) String

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

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

func (*FiletypeGroupBy) StringX

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

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

func (*FiletypeGroupBy) Strings

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

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

func (*FiletypeGroupBy) StringsX

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

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

type FiletypeMutation

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

FiletypeMutation represents an operation that mutates the Filetype nodes in the graph.

func (*FiletypeMutation) AddAllowedSize

func (m *FiletypeMutation) AddAllowedSize(i int)

AddAllowedSize adds i to the "allowed_size" field.

func (*FiletypeMutation) AddField

func (m *FiletypeMutation) 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 (*FiletypeMutation) AddFileIDs

func (m *FiletypeMutation) AddFileIDs(ids ...int)

AddFileIDs adds the "files" edge to the File entity by ids.

func (*FiletypeMutation) AddedAllowedSize

func (m *FiletypeMutation) AddedAllowedSize() (r int, exists bool)

AddedAllowedSize returns the value that was added to the "allowed_size" field in this mutation.

func (*FiletypeMutation) AddedEdges

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

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

func (*FiletypeMutation) AddedField

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

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

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

func (*FiletypeMutation) AddedIDs

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

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

func (*FiletypeMutation) AllowedSize

func (m *FiletypeMutation) AllowedSize() (r int, exists bool)

AllowedSize returns the value of the "allowed_size" field in the mutation.

func (*FiletypeMutation) ClearCreatedAt

func (m *FiletypeMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*FiletypeMutation) ClearEdge

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

func (m *FiletypeMutation) 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 (*FiletypeMutation) ClearFiles

func (m *FiletypeMutation) ClearFiles()

ClearFiles clears the "files" edge to the File entity.

func (*FiletypeMutation) ClearedEdges

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

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

func (*FiletypeMutation) ClearedFields

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

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

func (FiletypeMutation) Client

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

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

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

func (*FiletypeMutation) CreatedAtCleared

func (m *FiletypeMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*FiletypeMutation) EdgeCleared

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

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

func (*FiletypeMutation) Field

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

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

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

func (*FiletypeMutation) Fields

func (m *FiletypeMutation) 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 (*FiletypeMutation) FilesCleared

func (m *FiletypeMutation) FilesCleared() bool

FilesCleared reports if the "files" edge to the File entity was cleared.

func (*FiletypeMutation) FilesIDs

func (m *FiletypeMutation) FilesIDs() (ids []int)

FilesIDs returns the "files" edge IDs in the mutation.

func (*FiletypeMutation) ID

func (m *FiletypeMutation) ID() (id string, 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 (*FiletypeMutation) IDs

func (m *FiletypeMutation) IDs(ctx context.Context) ([]string, 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 (*FiletypeMutation) IsBanned

func (m *FiletypeMutation) IsBanned() (r bool, exists bool)

IsBanned returns the value of the "is_banned" field in the mutation.

func (*FiletypeMutation) OldAllowedSize

func (m *FiletypeMutation) OldAllowedSize(ctx context.Context) (v int, err error)

OldAllowedSize returns the old "allowed_size" field's value of the Filetype entity. If the Filetype 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 (*FiletypeMutation) OldCreatedAt

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

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

func (m *FiletypeMutation) 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 (*FiletypeMutation) OldIsBanned

func (m *FiletypeMutation) OldIsBanned(ctx context.Context) (v bool, err error)

OldIsBanned returns the old "is_banned" field's value of the Filetype entity. If the Filetype 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 (*FiletypeMutation) OldUpdatedAt

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

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

func (m *FiletypeMutation) Op() Op

Op returns the operation name.

func (*FiletypeMutation) RemoveFileIDs

func (m *FiletypeMutation) RemoveFileIDs(ids ...int)

RemoveFileIDs removes the "files" edge to the File entity by IDs.

func (*FiletypeMutation) RemovedEdges

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

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

func (*FiletypeMutation) RemovedFilesIDs

func (m *FiletypeMutation) RemovedFilesIDs() (ids []int)

RemovedFiles returns the removed IDs of the "files" edge to the File entity.

func (*FiletypeMutation) RemovedIDs

func (m *FiletypeMutation) 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 (*FiletypeMutation) ResetAllowedSize

func (m *FiletypeMutation) ResetAllowedSize()

ResetAllowedSize resets all changes to the "allowed_size" field.

func (*FiletypeMutation) ResetCreatedAt

func (m *FiletypeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FiletypeMutation) ResetEdge

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

func (m *FiletypeMutation) 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 (*FiletypeMutation) ResetFiles

func (m *FiletypeMutation) ResetFiles()

ResetFiles resets all changes to the "files" edge.

func (*FiletypeMutation) ResetIsBanned

func (m *FiletypeMutation) ResetIsBanned()

ResetIsBanned resets all changes to the "is_banned" field.

func (*FiletypeMutation) ResetUpdatedAt

func (m *FiletypeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FiletypeMutation) SetAllowedSize

func (m *FiletypeMutation) SetAllowedSize(i int)

SetAllowedSize sets the "allowed_size" field.

func (*FiletypeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FiletypeMutation) SetField

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

func (m *FiletypeMutation) SetID(id string)

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

func (*FiletypeMutation) SetIsBanned

func (m *FiletypeMutation) SetIsBanned(b bool)

SetIsBanned sets the "is_banned" field.

func (*FiletypeMutation) SetOp

func (m *FiletypeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FiletypeMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (FiletypeMutation) Tx

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

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

func (*FiletypeMutation) Type

func (m *FiletypeMutation) Type() string

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

func (*FiletypeMutation) UpdatedAt

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

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

func (*FiletypeMutation) Where

func (m *FiletypeMutation) Where(ps ...predicate.Filetype)

Where appends a list predicates to the FiletypeMutation builder.

func (*FiletypeMutation) WhereP

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

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

type FiletypeQuery

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

FiletypeQuery is the builder for querying Filetype entities.

func (*FiletypeQuery) Aggregate

func (fq *FiletypeQuery) Aggregate(fns ...AggregateFunc) *FiletypeSelect

Aggregate returns a FiletypeSelect configured with the given aggregations.

func (*FiletypeQuery) All

func (fq *FiletypeQuery) All(ctx context.Context) ([]*Filetype, error)

All executes the query and returns a list of Filetypes.

func (*FiletypeQuery) AllX

func (fq *FiletypeQuery) AllX(ctx context.Context) []*Filetype

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

func (*FiletypeQuery) Clone

func (fq *FiletypeQuery) Clone() *FiletypeQuery

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

func (*FiletypeQuery) Count

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

Count returns the count of the given query.

func (*FiletypeQuery) CountX

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

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

func (*FiletypeQuery) Exist

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

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

func (*FiletypeQuery) ExistX

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

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

func (*FiletypeQuery) First

func (fq *FiletypeQuery) First(ctx context.Context) (*Filetype, error)

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

func (*FiletypeQuery) FirstID

func (fq *FiletypeQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FiletypeQuery) FirstIDX

func (fq *FiletypeQuery) FirstIDX(ctx context.Context) string

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

func (*FiletypeQuery) FirstX

func (fq *FiletypeQuery) FirstX(ctx context.Context) *Filetype

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

func (*FiletypeQuery) ForShare

func (fq *FiletypeQuery) ForShare(opts ...sql.LockOption) *FiletypeQuery

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

func (*FiletypeQuery) ForUpdate

func (fq *FiletypeQuery) ForUpdate(opts ...sql.LockOption) *FiletypeQuery

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

func (*FiletypeQuery) GroupBy

func (fq *FiletypeQuery) GroupBy(field string, fields ...string) *FiletypeGroupBy

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

client.Filetype.Query().
	GroupBy(filetype.FieldAllowedSize).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FiletypeQuery) IDs

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

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

func (*FiletypeQuery) IDsX

func (fq *FiletypeQuery) IDsX(ctx context.Context) []string

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

func (*FiletypeQuery) Limit

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

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

func (*FiletypeQuery) Offset

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

Offset to start from.

func (*FiletypeQuery) Only

func (fq *FiletypeQuery) Only(ctx context.Context) (*Filetype, error)

Only returns a singl