Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type File
- func (c *File) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *File) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (f *File) QueryTags() *TagQuery
- func (f *File) String() string
- func (f *File) Unwrap() *File
- func (f *File) Update() *FileUpdateOne
- func (f *File) Value(name string) (ent.Value, error)
- type FileClient
- func (c *FileClient) Create() *FileCreate
- func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk
- func (c *FileClient) Delete() *FileDelete
- func (c *FileClient) DeleteOne(f *File) *FileDeleteOne
- func (c *FileClient) DeleteOneID(id uuid.UUID) *FileDeleteOne
- func (c *FileClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *FileClient) Get(ctx context.Context, id uuid.UUID) (*File, error)
- func (c *FileClient) GetX(ctx context.Context, id uuid.UUID) *File
- func (c *FileClient) Hooks() []Hook
- func (c *FileClient) Intercept(interceptors ...Interceptor)
- func (c *FileClient) Interceptors() []Interceptor
- func (c *FileClient) Query() *FileQuery
- func (c *FileClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *FileClient) QueryTags(f *File) *TagQuery
- func (c *FileClient) Update() *FileUpdate
- func (c *FileClient) UpdateOne(f *File) *FileUpdateOne
- func (c *FileClient) UpdateOneID(id uuid.UUID) *FileUpdateOne
- func (c *FileClient) Use(hooks ...Hook)
- type FileCreate
- func (fc *FileCreate) AddTagIDs(ids ...uint64) *FileCreate
- func (fc *FileCreate) AddTags(t ...*Tag) *FileCreate
- func (fc *FileCreate) Exec(ctx context.Context) error
- func (c *FileCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (fc *FileCreate) ExecX(ctx context.Context)
- func (fc *FileCreate) Mutation() *FileMutation
- func (c *FileCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fc *FileCreate) Save(ctx context.Context) (*File, error)
- func (fc *FileCreate) SaveX(ctx context.Context) *File
- func (fc *FileCreate) SetCreatedAt(t time.Time) *FileCreate
- func (fc *FileCreate) SetFileType(u uint8) *FileCreate
- func (fc *FileCreate) SetID(u uuid.UUID) *FileCreate
- func (fc *FileCreate) SetMd5(s string) *FileCreate
- func (fc *FileCreate) SetName(s string) *FileCreate
- func (fc *FileCreate) SetNillableCreatedAt(t *time.Time) *FileCreate
- func (fc *FileCreate) SetNillableID(u *uuid.UUID) *FileCreate
- func (fc *FileCreate) SetNillableStatus(u *uint8) *FileCreate
- func (fc *FileCreate) SetNillableUpdatedAt(t *time.Time) *FileCreate
- func (f *FileCreate) SetNotNilFileType(value *uint8) *FileCreate
- func (f *FileCreate) SetNotNilMd5(value *string) *FileCreate
- func (f *FileCreate) SetNotNilName(value *string) *FileCreate
- func (f *FileCreate) SetNotNilPath(value *string) *FileCreate
- func (f *FileCreate) SetNotNilSize(value *uint64) *FileCreate
- func (f *FileCreate) SetNotNilStatus(value *uint8) *FileCreate
- func (f *FileCreate) SetNotNilUpdatedAt(value *time.Time) *FileCreate
- func (f *FileCreate) SetNotNilUserUUID(value *string) *FileCreate
- func (fc *FileCreate) SetPath(s string) *FileCreate
- func (fc *FileCreate) SetSize(u uint64) *FileCreate
- func (fc *FileCreate) SetStatus(u uint8) *FileCreate
- func (fc *FileCreate) SetUpdatedAt(t time.Time) *FileCreate
- func (fc *FileCreate) SetUserUUID(s string) *FileCreate
- type FileCreateBulk
- func (fcb *FileCreateBulk) Exec(ctx context.Context) error
- func (c *FileCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (fcb *FileCreateBulk) ExecX(ctx context.Context)
- func (c *FileCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)
- func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File
- type FileDelete
- func (fd *FileDelete) Exec(ctx context.Context) (int, error)
- func (c *FileDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (fd *FileDelete) ExecX(ctx context.Context) int
- func (c *FileDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete
- type FileDeleteOne
- type FileEdges
- type FileGroupBy
- func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy
- func (s *FileGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FileGroupBy) BoolX(ctx context.Context) bool
- func (s *FileGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FileGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FileGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FileGroupBy) Float64X(ctx context.Context) float64
- func (s *FileGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FileGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FileGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FileGroupBy) IntX(ctx context.Context) int
- func (s *FileGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FileGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error
- func (s *FileGroupBy) ScanX(ctx context.Context, v any)
- func (s *FileGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FileGroupBy) StringX(ctx context.Context) string
- func (s *FileGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FileGroupBy) StringsX(ctx context.Context) []string
- type FileMutation
- func (m *FileMutation) AddField(name string, value ent.Value) error
- func (m *FileMutation) AddFileType(u int8)
- func (m *FileMutation) AddSize(u int64)
- func (m *FileMutation) AddStatus(u int8)
- func (m *FileMutation) AddTagIDs(ids ...uint64)
- func (m *FileMutation) AddedEdges() []string
- func (m *FileMutation) AddedField(name string) (ent.Value, bool)
- func (m *FileMutation) AddedFields() []string
- func (m *FileMutation) AddedFileType() (r int8, exists bool)
- func (m *FileMutation) AddedIDs(name string) []ent.Value
- func (m *FileMutation) AddedSize() (r int64, exists bool)
- func (m *FileMutation) AddedStatus() (r int8, exists bool)
- func (m *FileMutation) ClearEdge(name string) error
- func (m *FileMutation) ClearField(name string) error
- func (m *FileMutation) ClearStatus()
- func (m *FileMutation) ClearTags()
- func (m *FileMutation) ClearedEdges() []string
- func (m *FileMutation) ClearedFields() []string
- func (m FileMutation) Client() *Client
- func (m *FileMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FileMutation) EdgeCleared(name string) bool
- func (c *FileMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (m *FileMutation) Field(name string) (ent.Value, bool)
- func (m *FileMutation) FieldCleared(name string) bool
- func (m *FileMutation) Fields() []string
- func (m *FileMutation) FileType() (r uint8, exists bool)
- func (m *FileMutation) ID() (id uuid.UUID, exists bool)
- func (m *FileMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *FileMutation) Md5() (r string, exists bool)
- func (m *FileMutation) Name() (r string, exists bool)
- func (m *FileMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FileMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FileMutation) OldFileType(ctx context.Context) (v uint8, err error)
- func (m *FileMutation) OldMd5(ctx context.Context) (v string, err error)
- func (m *FileMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FileMutation) OldPath(ctx context.Context) (v string, err error)
- func (m *FileMutation) OldSize(ctx context.Context) (v uint64, err error)
- func (m *FileMutation) OldStatus(ctx context.Context) (v uint8, err error)
- func (m *FileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FileMutation) OldUserUUID(ctx context.Context) (v string, err error)
- func (m *FileMutation) Op() Op
- func (m *FileMutation) Path() (r string, exists bool)
- func (c *FileMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *FileMutation) RemoveTagIDs(ids ...uint64)
- func (m *FileMutation) RemovedEdges() []string
- func (m *FileMutation) RemovedIDs(name string) []ent.Value
- func (m *FileMutation) RemovedTagsIDs() (ids []uint64)
- func (m *FileMutation) ResetCreatedAt()
- func (m *FileMutation) ResetEdge(name string) error
- func (m *FileMutation) ResetField(name string) error
- func (m *FileMutation) ResetFileType()
- func (m *FileMutation) ResetMd5()
- func (m *FileMutation) ResetName()
- func (m *FileMutation) ResetPath()
- func (m *FileMutation) ResetSize()
- func (m *FileMutation) ResetStatus()
- func (m *FileMutation) ResetTags()
- func (m *FileMutation) ResetUpdatedAt()
- func (m *FileMutation) ResetUserUUID()
- func (m *FileMutation) SetCreatedAt(t time.Time)
- func (m *FileMutation) SetField(name string, value ent.Value) error
- func (m *FileMutation) SetFileType(u uint8)
- func (m *FileMutation) SetID(id uuid.UUID)
- func (m *FileMutation) SetMd5(s string)
- func (m *FileMutation) SetName(s string)
- func (m *FileMutation) SetOp(op Op)
- func (m *FileMutation) SetPath(s string)
- func (m *FileMutation) SetSize(u uint64)
- func (m *FileMutation) SetStatus(u uint8)
- func (m *FileMutation) SetUpdatedAt(t time.Time)
- func (m *FileMutation) SetUserUUID(s string)
- func (m *FileMutation) Size() (r uint64, exists bool)
- func (m *FileMutation) Status() (r uint8, exists bool)
- func (m *FileMutation) StatusCleared() bool
- func (m *FileMutation) TagsCleared() bool
- func (m *FileMutation) TagsIDs() (ids []uint64)
- func (m FileMutation) Tx() (*Tx, error)
- func (m *FileMutation) Type() string
- func (m *FileMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *FileMutation) UserUUID() (r string, exists bool)
- func (m *FileMutation) Where(ps ...predicate.File)
- func (m *FileMutation) WhereP(ps ...func(*sql.Selector))
- type FilePageList
- type FilePager
- type FilePaginateOption
- type FileQuery
- func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect
- func (fq *FileQuery) All(ctx context.Context) ([]*File, error)
- func (fq *FileQuery) AllX(ctx context.Context) []*File
- func (fq *FileQuery) Clone() *FileQuery
- func (fq *FileQuery) Count(ctx context.Context) (int, error)
- func (fq *FileQuery) CountX(ctx context.Context) int
- func (c *FileQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (fq *FileQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FileQuery) ExistX(ctx context.Context) bool
- func (fq *FileQuery) First(ctx context.Context) (*File, error)
- func (fq *FileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (fq *FileQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (fq *FileQuery) FirstX(ctx context.Context) *File
- func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy
- func (fq *FileQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (fq *FileQuery) IDsX(ctx context.Context) []uuid.UUID
- func (fq *FileQuery) Limit(limit int) *FileQuery
- func (fq *FileQuery) Offset(offset int) *FileQuery
- func (fq *FileQuery) Only(ctx context.Context) (*File, error)
- func (fq *FileQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (fq *FileQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (fq *FileQuery) OnlyX(ctx context.Context) *File
- func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery
- func (f *FileQuery) Page(ctx context.Context, pageNum uint64, pageSize uint64, ...) (*FilePageList, error)
- func (c *FileQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fq *FileQuery) QueryTags() *TagQuery
- func (fq *FileQuery) Select(fields ...string) *FileSelect
- func (fq *FileQuery) Unique(unique bool) *FileQuery
- func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery
- func (fq *FileQuery) WithTags(opts ...func(*TagQuery)) *FileQuery
- type FileSelect
- func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect
- func (s *FileSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FileSelect) BoolX(ctx context.Context) bool
- func (s *FileSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FileSelect) BoolsX(ctx context.Context) []bool
- func (c FileSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (s *FileSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FileSelect) Float64X(ctx context.Context) float64
- func (s *FileSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FileSelect) Float64sX(ctx context.Context) []float64
- func (s *FileSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FileSelect) IntX(ctx context.Context) int
- func (s *FileSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FileSelect) IntsX(ctx context.Context) []int
- func (c FileSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fs *FileSelect) Scan(ctx context.Context, v any) error
- func (s *FileSelect) ScanX(ctx context.Context, v any)
- func (s *FileSelect) String(ctx context.Context) (_ string, err error)
- func (s *FileSelect) StringX(ctx context.Context) string
- func (s *FileSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FileSelect) StringsX(ctx context.Context) []string
- type FileUpdate
- func (fu *FileUpdate) AddFileType(u int8) *FileUpdate
- func (fu *FileUpdate) AddSize(u int64) *FileUpdate
- func (fu *FileUpdate) AddStatus(u int8) *FileUpdate
- func (fu *FileUpdate) AddTagIDs(ids ...uint64) *FileUpdate
- func (fu *FileUpdate) AddTags(t ...*Tag) *FileUpdate
- func (fu *FileUpdate) ClearStatus() *FileUpdate
- func (fu *FileUpdate) ClearTags() *FileUpdate
- func (fu *FileUpdate) Exec(ctx context.Context) error
- func (c *FileUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (fu *FileUpdate) ExecX(ctx context.Context)
- func (fu *FileUpdate) Mutation() *FileMutation
- func (c *FileUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fu *FileUpdate) RemoveTagIDs(ids ...uint64) *FileUpdate
- func (fu *FileUpdate) RemoveTags(t ...*Tag) *FileUpdate
- func (fu *FileUpdate) Save(ctx context.Context) (int, error)
- func (fu *FileUpdate) SaveX(ctx context.Context) int
- func (fu *FileUpdate) SetFileType(u uint8) *FileUpdate
- func (fu *FileUpdate) SetMd5(s string) *FileUpdate
- func (fu *FileUpdate) SetName(s string) *FileUpdate
- func (fu *FileUpdate) SetNillableStatus(u *uint8) *FileUpdate
- func (f *FileUpdate) SetNotNilFileType(value *uint8) *FileUpdate
- func (f *FileUpdate) SetNotNilMd5(value *string) *FileUpdate
- func (f *FileUpdate) SetNotNilName(value *string) *FileUpdate
- func (f *FileUpdate) SetNotNilPath(value *string) *FileUpdate
- func (f *FileUpdate) SetNotNilSize(value *uint64) *FileUpdate
- func (f *FileUpdate) SetNotNilStatus(value *uint8) *FileUpdate
- func (f *FileUpdate) SetNotNilUpdatedAt(value *time.Time) *FileUpdate
- func (f *FileUpdate) SetNotNilUserUUID(value *string) *FileUpdate
- func (fu *FileUpdate) SetPath(s string) *FileUpdate
- func (fu *FileUpdate) SetSize(u uint64) *FileUpdate
- func (fu *FileUpdate) SetStatus(u uint8) *FileUpdate
- func (fu *FileUpdate) SetUpdatedAt(t time.Time) *FileUpdate
- func (fu *FileUpdate) SetUserUUID(s string) *FileUpdate
- func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate
- type FileUpdateOne
- func (fuo *FileUpdateOne) AddFileType(u int8) *FileUpdateOne
- func (fuo *FileUpdateOne) AddSize(u int64) *FileUpdateOne
- func (fuo *FileUpdateOne) AddStatus(u int8) *FileUpdateOne
- func (fuo *FileUpdateOne) AddTagIDs(ids ...uint64) *FileUpdateOne
- func (fuo *FileUpdateOne) AddTags(t ...*Tag) *FileUpdateOne
- func (fuo *FileUpdateOne) ClearStatus() *FileUpdateOne
- func (fuo *FileUpdateOne) ClearTags() *FileUpdateOne
- func (fuo *FileUpdateOne) Exec(ctx context.Context) error
- func (c *FileUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (fuo *FileUpdateOne) ExecX(ctx context.Context)
- func (fuo *FileUpdateOne) Mutation() *FileMutation
- func (c *FileUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (fuo *FileUpdateOne) RemoveTagIDs(ids ...uint64) *FileUpdateOne
- func (fuo *FileUpdateOne) RemoveTags(t ...*Tag) *FileUpdateOne
- func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)
- func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File
- func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne
- func (fuo *FileUpdateOne) SetFileType(u uint8) *FileUpdateOne
- func (fuo *FileUpdateOne) SetMd5(s string) *FileUpdateOne
- func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne
- func (fuo *FileUpdateOne) SetNillableStatus(u *uint8) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilFileType(value *uint8) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilMd5(value *string) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilName(value *string) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilPath(value *string) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilSize(value *uint64) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilStatus(value *uint8) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilUpdatedAt(value *time.Time) *FileUpdateOne
- func (f *FileUpdateOne) SetNotNilUserUUID(value *string) *FileUpdateOne
- func (fuo *FileUpdateOne) SetPath(s string) *FileUpdateOne
- func (fuo *FileUpdateOne) SetSize(u uint64) *FileUpdateOne
- func (fuo *FileUpdateOne) SetStatus(u uint8) *FileUpdateOne
- func (fuo *FileUpdateOne) SetUpdatedAt(t time.Time) *FileUpdateOne
- func (fuo *FileUpdateOne) SetUserUUID(s string) *FileUpdateOne
- func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne
- type Files
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageDetails
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tag
- func (c *Tag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Tag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (t *Tag) QueryFiles() *FileQuery
- func (t *Tag) String() string
- func (t *Tag) Unwrap() *Tag
- func (t *Tag) Update() *TagUpdateOne
- func (t *Tag) Value(name string) (ent.Value, error)
- type TagClient
- func (c *TagClient) Create() *TagCreate
- func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
- func (c *TagClient) Delete() *TagDelete
- func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
- func (c *TagClient) DeleteOneID(id uint64) *TagDeleteOne
- func (c *TagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *TagClient) Get(ctx context.Context, id uint64) (*Tag, error)
- func (c *TagClient) GetX(ctx context.Context, id uint64) *Tag
- func (c *TagClient) Hooks() []Hook
- func (c *TagClient) Intercept(interceptors ...Interceptor)
- func (c *TagClient) Interceptors() []Interceptor
- func (c *TagClient) Query() *TagQuery
- func (c *TagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *TagClient) QueryFiles(t *Tag) *FileQuery
- func (c *TagClient) Update() *TagUpdate
- func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
- func (c *TagClient) UpdateOneID(id uint64) *TagUpdateOne
- func (c *TagClient) Use(hooks ...Hook)
- type TagCreate
- func (tc *TagCreate) AddFileIDs(ids ...uuid.UUID) *TagCreate
- func (tc *TagCreate) AddFiles(f ...*File) *TagCreate
- func (tc *TagCreate) Exec(ctx context.Context) error
- func (c *TagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tc *TagCreate) ExecX(ctx context.Context)
- func (tc *TagCreate) Mutation() *TagMutation
- func (c *TagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)
- func (tc *TagCreate) SaveX(ctx context.Context) *Tag
- func (tc *TagCreate) SetCreatedAt(t time.Time) *TagCreate
- func (tc *TagCreate) SetID(u uint64) *TagCreate
- func (tc *TagCreate) SetName(s string) *TagCreate
- func (tc *TagCreate) SetNillableCreatedAt(t *time.Time) *TagCreate
- func (tc *TagCreate) SetNillableRemark(s *string) *TagCreate
- func (tc *TagCreate) SetNillableStatus(u *uint8) *TagCreate
- func (tc *TagCreate) SetNillableUpdatedAt(t *time.Time) *TagCreate
- func (t *TagCreate) SetNotNilName(value *string) *TagCreate
- func (t *TagCreate) SetNotNilRemark(value *string) *TagCreate
- func (t *TagCreate) SetNotNilStatus(value *uint8) *TagCreate
- func (t *TagCreate) SetNotNilUpdatedAt(value *time.Time) *TagCreate
- func (tc *TagCreate) SetRemark(s string) *TagCreate
- func (tc *TagCreate) SetStatus(u uint8) *TagCreate
- func (tc *TagCreate) SetUpdatedAt(t time.Time) *TagCreate
- type TagCreateBulk
- func (tcb *TagCreateBulk) Exec(ctx context.Context) error
- func (c *TagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tcb *TagCreateBulk) ExecX(ctx context.Context)
- func (c *TagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)
- func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag
- type TagDelete
- func (td *TagDelete) Exec(ctx context.Context) (int, error)
- func (c *TagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (td *TagDelete) ExecX(ctx context.Context) int
- func (c *TagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete
- type TagDeleteOne
- type TagEdges
- type TagGroupBy
- func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
- func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagGroupBy) BoolX(ctx context.Context) bool
- func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TagGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagGroupBy) Float64X(ctx context.Context) float64
- func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TagGroupBy) IntX(ctx context.Context) int
- func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TagGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
- func (s *TagGroupBy) ScanX(ctx context.Context, v any)
- func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TagGroupBy) StringX(ctx context.Context) string
- func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TagGroupBy) StringsX(ctx context.Context) []string
- type TagMutation
- func (m *TagMutation) AddField(name string, value ent.Value) error
- func (m *TagMutation) AddFileIDs(ids ...uuid.UUID)
- func (m *TagMutation) AddStatus(u int8)
- func (m *TagMutation) AddedEdges() []string
- func (m *TagMutation) AddedField(name string) (ent.Value, bool)
- func (m *TagMutation) AddedFields() []string
- func (m *TagMutation) AddedIDs(name string) []ent.Value
- func (m *TagMutation) AddedStatus() (r int8, exists bool)
- func (m *TagMutation) ClearEdge(name string) error
- func (m *TagMutation) ClearField(name string) error
- func (m *TagMutation) ClearFiles()
- func (m *TagMutation) ClearRemark()
- func (m *TagMutation) ClearStatus()
- func (m *TagMutation) ClearedEdges() []string
- func (m *TagMutation) ClearedFields() []string
- func (m TagMutation) Client() *Client
- func (m *TagMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TagMutation) EdgeCleared(name string) bool
- func (c *TagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (m *TagMutation) Field(name string) (ent.Value, bool)
- func (m *TagMutation) FieldCleared(name string) bool
- func (m *TagMutation) Fields() []string
- func (m *TagMutation) FilesCleared() bool
- func (m *TagMutation) FilesIDs() (ids []uuid.UUID)
- func (m *TagMutation) ID() (id uint64, exists bool)
- func (m *TagMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *TagMutation) Name() (r string, exists bool)
- func (m *TagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TagMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TagMutation) OldRemark(ctx context.Context) (v string, err error)
- func (m *TagMutation) OldStatus(ctx context.Context) (v uint8, err error)
- func (m *TagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TagMutation) Op() Op
- func (c *TagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *TagMutation) Remark() (r string, exists bool)
- func (m *TagMutation) RemarkCleared() bool
- func (m *TagMutation) RemoveFileIDs(ids ...uuid.UUID)
- func (m *TagMutation) RemovedEdges() []string
- func (m *TagMutation) RemovedFilesIDs() (ids []uuid.UUID)
- func (m *TagMutation) RemovedIDs(name string) []ent.Value
- func (m *TagMutation) ResetCreatedAt()
- func (m *TagMutation) ResetEdge(name string) error
- func (m *TagMutation) ResetField(name string) error
- func (m *TagMutation) ResetFiles()
- func (m *TagMutation) ResetName()
- func (m *TagMutation) ResetRemark()
- func (m *TagMutation) ResetStatus()
- func (m *TagMutation) ResetUpdatedAt()
- func (m *TagMutation) SetCreatedAt(t time.Time)
- func (m *TagMutation) SetField(name string, value ent.Value) error
- func (m *TagMutation) SetID(id uint64)
- func (m *TagMutation) SetName(s string)
- func (m *TagMutation) SetOp(op Op)
- func (m *TagMutation) SetRemark(s string)
- func (m *TagMutation) SetStatus(u uint8)
- func (m *TagMutation) SetUpdatedAt(t time.Time)
- func (m *TagMutation) Status() (r uint8, exists bool)
- func (m *TagMutation) StatusCleared() bool
- func (m TagMutation) Tx() (*Tx, error)
- func (m *TagMutation) Type() string
- func (m *TagMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *TagMutation) Where(ps ...predicate.Tag)
- func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
- type TagPageList
- type TagPager
- type TagPaginateOption
- type TagQuery
- func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
- func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)
- func (tq *TagQuery) AllX(ctx context.Context) []*Tag
- func (tq *TagQuery) Clone() *TagQuery
- func (tq *TagQuery) Count(ctx context.Context) (int, error)
- func (tq *TagQuery) CountX(ctx context.Context) int
- func (c *TagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tq *TagQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TagQuery) ExistX(ctx context.Context) bool
- func (tq *TagQuery) First(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (tq *TagQuery) FirstIDX(ctx context.Context) uint64
- func (tq *TagQuery) FirstX(ctx context.Context) *Tag
- func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
- func (tq *TagQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (tq *TagQuery) IDsX(ctx context.Context) []uint64
- func (tq *TagQuery) Limit(limit int) *TagQuery
- func (tq *TagQuery) Offset(offset int) *TagQuery
- func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (tq *TagQuery) OnlyIDX(ctx context.Context) uint64
- func (tq *TagQuery) OnlyX(ctx context.Context) *Tag
- func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
- func (t *TagQuery) Page(ctx context.Context, pageNum uint64, pageSize uint64, ...) (*TagPageList, error)
- func (c *TagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tq *TagQuery) QueryFiles() *FileQuery
- func (tq *TagQuery) Select(fields ...string) *TagSelect
- func (tq *TagQuery) Unique(unique bool) *TagQuery
- func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery
- func (tq *TagQuery) WithFiles(opts ...func(*FileQuery)) *TagQuery
- type TagSelect
- func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
- func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagSelect) BoolX(ctx context.Context) bool
- func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TagSelect) BoolsX(ctx context.Context) []bool
- func (c TagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagSelect) Float64X(ctx context.Context) float64
- func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagSelect) Float64sX(ctx context.Context) []float64
- func (s *TagSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TagSelect) IntX(ctx context.Context) int
- func (s *TagSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TagSelect) IntsX(ctx context.Context) []int
- func (c TagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ts *TagSelect) Scan(ctx context.Context, v any) error
- func (s *TagSelect) ScanX(ctx context.Context, v any)
- func (s *TagSelect) String(ctx context.Context) (_ string, err error)
- func (s *TagSelect) StringX(ctx context.Context) string
- func (s *TagSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TagSelect) StringsX(ctx context.Context) []string
- type TagUpdate
- func (tu *TagUpdate) AddFileIDs(ids ...uuid.UUID) *TagUpdate
- func (tu *TagUpdate) AddFiles(f ...*File) *TagUpdate
- func (tu *TagUpdate) AddStatus(u int8) *TagUpdate
- func (tu *TagUpdate) ClearFiles() *TagUpdate
- func (tu *TagUpdate) ClearRemark() *TagUpdate
- func (tu *TagUpdate) ClearStatus() *TagUpdate
- func (tu *TagUpdate) Exec(ctx context.Context) error
- func (c *TagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tu *TagUpdate) ExecX(ctx context.Context)
- func (tu *TagUpdate) Mutation() *TagMutation
- func (c *TagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tu *TagUpdate) RemoveFileIDs(ids ...uuid.UUID) *TagUpdate
- func (tu *TagUpdate) RemoveFiles(f ...*File) *TagUpdate
- func (tu *TagUpdate) Save(ctx context.Context) (int, error)
- func (tu *TagUpdate) SaveX(ctx context.Context) int
- func (tu *TagUpdate) SetName(s string) *TagUpdate
- func (tu *TagUpdate) SetNillableRemark(s *string) *TagUpdate
- func (tu *TagUpdate) SetNillableStatus(u *uint8) *TagUpdate
- func (t *TagUpdate) SetNotNilName(value *string) *TagUpdate
- func (t *TagUpdate) SetNotNilRemark(value *string) *TagUpdate
- func (t *TagUpdate) SetNotNilStatus(value *uint8) *TagUpdate
- func (t *TagUpdate) SetNotNilUpdatedAt(value *time.Time) *TagUpdate
- func (tu *TagUpdate) SetRemark(s string) *TagUpdate
- func (tu *TagUpdate) SetStatus(u uint8) *TagUpdate
- func (tu *TagUpdate) SetUpdatedAt(t time.Time) *TagUpdate
- func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate
- type TagUpdateOne
- func (tuo *TagUpdateOne) AddFileIDs(ids ...uuid.UUID) *TagUpdateOne
- func (tuo *TagUpdateOne) AddFiles(f ...*File) *TagUpdateOne
- func (tuo *TagUpdateOne) AddStatus(u int8) *TagUpdateOne
- func (tuo *TagUpdateOne) ClearFiles() *TagUpdateOne
- func (tuo *TagUpdateOne) ClearRemark() *TagUpdateOne
- func (tuo *TagUpdateOne) ClearStatus() *TagUpdateOne
- func (tuo *TagUpdateOne) Exec(ctx context.Context) error
- func (c *TagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tuo *TagUpdateOne) ExecX(ctx context.Context)
- func (tuo *TagUpdateOne) Mutation() *TagMutation
- func (c *TagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tuo *TagUpdateOne) RemoveFileIDs(ids ...uuid.UUID) *TagUpdateOne
- func (tuo *TagUpdateOne) RemoveFiles(f ...*File) *TagUpdateOne
- func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
- func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
- func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableRemark(s *string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableStatus(u *uint8) *TagUpdateOne
- func (t *TagUpdateOne) SetNotNilName(value *string) *TagUpdateOne
- func (t *TagUpdateOne) SetNotNilRemark(value *string) *TagUpdateOne
- func (t *TagUpdateOne) SetNotNilStatus(value *uint8) *TagUpdateOne
- func (t *TagUpdateOne) SetNotNilUpdatedAt(value *time.Time) *TagUpdateOne
- func (tuo *TagUpdateOne) SetRemark(s string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetStatus(u uint8) *TagUpdateOne
- func (tuo *TagUpdateOne) SetUpdatedAt(t time.Time) *TagUpdateOne
- func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
- type Tags
- type TraverseFunc
- type Traverser
- type Tx
- func (tx *Tx) Client() *Client
- func (tx *Tx) Commit() error
- func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tx *Tx) OnCommit(f CommitHook)
- func (tx *Tx) OnRollback(f RollbackHook)
- func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tx *Tx) Rollback() error
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeFile = "File" TypeTag = "Tag" )
Variables ¶
var DefaultFileOrder = Desc(file.FieldID)
DefaultFileOrder is the default ordering of File.
var DefaultTagOrder = Desc(tag.FieldID)
DefaultTagOrder is the default ordering of Tag.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 // Tag is the client for interacting with the Tag builders. Tag *TagClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). File. Query(). Count(ctx)
func (*Client) ExecContext ¶ added in v1.0.11
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
func (*Client) QueryContext ¶ added in v1.0.11
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type CommitFunc ¶
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.
type CommitHook ¶
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 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. // UUID ID uuid.UUID `json:"id,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"` // status 1 normal 2 ban | 状态 1 正常 2 禁用 Status uint8 `json:"status,omitempty"` // File's name | 文件名称 Name string `json:"name,omitempty"` // File's type | 文件类型 FileType uint8 `json:"file_type,omitempty"` // File's size Size uint64 `json:"size,omitempty"` // File's path Path string `json:"path,omitempty"` // User's UUID | 用户的 UUID UserUUID string `json:"user_uuid,omitempty"` // The md5 of the file | 文件的 md5 Md5 string `json:"md5,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) ExecContext ¶ added in v1.0.11
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*File) QueryContext ¶ added in v1.0.11
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*File) Unwrap ¶
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.
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 uuid.UUID) *FileDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FileClient) ExecContext ¶ added in v1.0.11
func (c *FileClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*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) Query ¶
func (c *FileClient) Query() *FileQuery
Query returns a query builder for File.
func (*FileClient) QueryContext ¶ added in v1.0.11
func (c *FileClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*FileClient) QueryTags ¶ added in v1.0.12
func (c *FileClient) QueryTags(f *File) *TagQuery
QueryTags queries the tags 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 uuid.UUID) *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 ¶ added in v1.0.12
func (fc *FileCreate) AddTagIDs(ids ...uint64) *FileCreate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*FileCreate) AddTags ¶ added in v1.0.12
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) ExecContext ¶ added in v1.0.11
func (c *FileCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*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) QueryContext ¶ added in v1.0.11
func (c *FileCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*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) SetFileType ¶
func (fc *FileCreate) SetFileType(u uint8) *FileCreate
SetFileType sets the "file_type" field.
func (*FileCreate) SetID ¶
func (fc *FileCreate) SetID(u uuid.UUID) *FileCreate
SetID sets the "id" field.
func (*FileCreate) SetMd5 ¶
func (fc *FileCreate) SetMd5(s string) *FileCreate
SetMd5 sets the "md5" field.
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) SetNillableID ¶ added in v1.0.11
func (fc *FileCreate) SetNillableID(u *uuid.UUID) *FileCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*FileCreate) SetNillableStatus ¶
func (fc *FileCreate) SetNillableStatus(u *uint8) *FileCreate
SetNillableStatus sets the "status" 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) SetNotNilFileType ¶ added in v1.0.10
func (f *FileCreate) SetNotNilFileType(value *uint8) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilMd5 ¶ added in v1.0.10
func (f *FileCreate) SetNotNilMd5(value *string) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilName ¶ added in v1.0.10
func (f *FileCreate) SetNotNilName(value *string) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilPath ¶ added in v1.0.10
func (f *FileCreate) SetNotNilPath(value *string) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilSize ¶ added in v1.0.10
func (f *FileCreate) SetNotNilSize(value *uint64) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilStatus ¶ added in v1.0.10
func (f *FileCreate) SetNotNilStatus(value *uint8) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilUpdatedAt ¶ added in v1.0.10
func (f *FileCreate) SetNotNilUpdatedAt(value *time.Time) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetNotNilUserUUID ¶ added in v1.0.10
func (f *FileCreate) SetNotNilUserUUID(value *string) *FileCreate
set field if value's pointer is not nil.
func (*FileCreate) SetPath ¶
func (fc *FileCreate) SetPath(s string) *FileCreate
SetPath sets the "path" field.
func (*FileCreate) SetSize ¶
func (fc *FileCreate) SetSize(u uint64) *FileCreate
SetSize sets the "size" field.
func (*FileCreate) SetStatus ¶
func (fc *FileCreate) SetStatus(u uint8) *FileCreate
SetStatus sets the "status" field.
func (*FileCreate) SetUpdatedAt ¶
func (fc *FileCreate) SetUpdatedAt(t time.Time) *FileCreate
SetUpdatedAt sets the "updated_at" field.
func (*FileCreate) SetUserUUID ¶
func (fc *FileCreate) SetUserUUID(s string) *FileCreate
SetUserUUID sets the "user_uuid" 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) ExecContext ¶ added in v1.0.11
func (c *FileCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*FileCreateBulk) ExecX ¶
func (fcb *FileCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FileCreateBulk) QueryContext ¶ added in v1.0.11
func (c *FileCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶ added in v1.0.11
func (c *FileDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*FileDelete) ExecX ¶
func (fd *FileDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FileDelete) QueryContext ¶ added in v1.0.11
func (c *FileDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*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 ¶ added in v1.0.12
type FileEdges struct { // 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.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FileGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FileGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FileGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FileGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FileGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) AddFileType ¶
func (m *FileMutation) AddFileType(u int8)
AddFileType adds u to the "file_type" field.
func (*FileMutation) AddSize ¶
func (m *FileMutation) AddSize(u int64)
AddSize adds u to the "size" field.
func (*FileMutation) AddStatus ¶
func (m *FileMutation) AddStatus(u int8)
AddStatus adds u to the "status" field.
func (*FileMutation) AddTagIDs ¶ added in v1.0.12
func (m *FileMutation) AddTagIDs(ids ...uint64)
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) AddedFileType ¶
func (m *FileMutation) AddedFileType() (r int8, exists bool)
AddedFileType returns the value that was added to the "file_type" field in 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 int64, exists bool)
AddedSize returns the value that was added to the "size" field in this mutation.
func (*FileMutation) AddedStatus ¶
func (m *FileMutation) AddedStatus() (r int8, exists bool)
AddedStatus returns the value that was added to the "status" field in this mutation.
func (*FileMutation) ClearEdge ¶
func (m *FileMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*FileMutation) ClearField ¶
func (m *FileMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*FileMutation) ClearStatus ¶
func (m *FileMutation) ClearStatus()
ClearStatus clears the value of the "status" field.
func (*FileMutation) ClearTags ¶ added in v1.0.12
func (m *FileMutation) ClearTags()
ClearTags clears the "tags" edge to the Tag 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) 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) ExecContext ¶ added in v1.0.11
func (c *FileMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*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) FileType ¶
func (m *FileMutation) FileType() (r uint8, exists bool)
FileType returns the value of the "file_type" field in the mutation.
func (*FileMutation) ID ¶
func (m *FileMutation) ID() (id uuid.UUID, 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 ¶
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) Md5 ¶
func (m *FileMutation) Md5() (r string, exists bool)
Md5 returns the value of the "md5" field in 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 ¶
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) OldField ¶
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) OldFileType ¶
func (m *FileMutation) OldFileType(ctx context.Context) (v uint8, err error)
OldFileType returns the old "file_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) OldMd5 ¶
func (m *FileMutation) OldMd5(ctx context.Context) (v string, err error)
OldMd5 returns the old "md5" 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) 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) OldPath ¶
func (m *FileMutation) OldPath(ctx context.Context) (v string, err error)
OldPath returns the old "path" 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 uint64, 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) OldStatus ¶
func (m *FileMutation) OldStatus(ctx context.Context) (v uint8, err error)
OldStatus returns the old "status" 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 ¶
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) OldUserUUID ¶
func (m *FileMutation) OldUserUUID(ctx context.Context) (v string, err error)
OldUserUUID returns the old "user_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) Path ¶
func (m *FileMutation) Path() (r string, exists bool)
Path returns the value of the "path" field in the mutation.
func (*FileMutation) QueryContext ¶ added in v1.0.11
func (c *FileMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*FileMutation) RemoveTagIDs ¶ added in v1.0.12
func (m *FileMutation) RemoveTagIDs(ids ...uint64)
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 ¶ added in v1.0.12
func (m *FileMutation) RemovedTagsIDs() (ids []uint64)
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) 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 "file_type" field.
func (*FileMutation) ResetMd5 ¶
func (m *FileMutation) ResetMd5()
ResetMd5 resets all changes to the "md5" field.
func (*FileMutation) ResetName ¶
func (m *FileMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FileMutation) ResetPath ¶
func (m *FileMutation) ResetPath()
ResetPath resets all changes to the "path" field.
func (*FileMutation) ResetSize ¶
func (m *FileMutation) ResetSize()
ResetSize resets all changes to the "size" field.
func (*FileMutation) ResetStatus ¶
func (m *FileMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*FileMutation) ResetTags ¶ added in v1.0.12
func (m *FileMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*FileMutation) ResetUpdatedAt ¶
func (m *FileMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*FileMutation) ResetUserUUID ¶
func (m *FileMutation) ResetUserUUID()
ResetUserUUID resets all changes to the "user_uuid" field.
func (*FileMutation) SetCreatedAt ¶
func (m *FileMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_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) SetFileType ¶
func (m *FileMutation) SetFileType(u uint8)
SetFileType sets the "file_type" field.
func (*FileMutation) SetID ¶
func (m *FileMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of File entities.
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) SetPath ¶
func (m *FileMutation) SetPath(s string)
SetPath sets the "path" field.
func (*FileMutation) SetSize ¶
func (m *FileMutation) SetSize(u uint64)
SetSize sets the "size" field.
func (*FileMutation) SetStatus ¶
func (m *FileMutation) SetStatus(u uint8)
SetStatus sets the "status" field.
func (*FileMutation) SetUpdatedAt ¶
func (m *FileMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*FileMutation) SetUserUUID ¶
func (m *FileMutation) SetUserUUID(s string)
SetUserUUID sets the "user_uuid" field.
func (*FileMutation) Size ¶
func (m *FileMutation) Size() (r uint64, exists bool)
Size returns the value of the "size" field in the mutation.
func (*FileMutation) Status ¶
func (m *FileMutation) Status() (r uint8, exists bool)
Status returns the value of the "status" field in the mutation.
func (*FileMutation) StatusCleared ¶
func (m *FileMutation) StatusCleared() bool
StatusCleared returns if the "status" field was cleared in this mutation.
func (*FileMutation) TagsCleared ¶ added in v1.0.12
func (m *FileMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the Tag entity was cleared.
func (*FileMutation) TagsIDs ¶ added in v1.0.12
func (m *FileMutation) TagsIDs() (ids []uint64)
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) UpdatedAt ¶
func (m *FileMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*FileMutation) UserUUID ¶
func (m *FileMutation) UserUUID() (r string, exists bool)
UserUUID returns the value of the "user_uuid" field in the mutation.
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 FilePageList ¶
type FilePageList struct { List []*File `json:"list"` PageDetails *PageDetails `json:"pageDetails"` }
FilePageList is File PageList result.
type FilePager ¶
type FilePager struct { Order file.OrderOption Filter func(*FileQuery) (*FileQuery, error) }
type FilePaginateOption ¶
type FilePaginateOption func(*FilePager)
FilePaginateOption enables pagination customization.
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) Clone ¶
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) ExecContext ¶ added in v1.0.11
func (c *FileQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*FileQuery) First ¶
First returns the first File entity from the query. Returns a *NotFoundError when no File was found.
func (*FileQuery) FirstID ¶
FirstID returns the first File ID from the query. Returns a *NotFoundError when no File ID was found.
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.File.Query(). GroupBy(file.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*FileQuery) Only ¶
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 ¶
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) Order ¶
func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery
Order specifies how the records should be ordered.
func (*FileQuery) Page ¶
func (f *FileQuery) Page( ctx context.Context, pageNum uint64, pageSize uint64, opts ...FilePaginateOption, ) (*FilePageList, error)
func (*FileQuery) QueryContext ¶ added in v1.0.11
func (c *FileQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*FileQuery) QueryTags ¶ added in v1.0.12
QueryTags chains the current query on the "tags" 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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.File.Query(). Select(file.FieldCreatedAt). Scan(ctx, &v)
func (*FileQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FileSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (FileSelect) ExecContext ¶ added in v1.0.11
func (c FileSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*FileSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FileSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FileSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FileSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (FileSelect) QueryContext ¶ added in v1.0.11
func (c FileSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FileUpdate ¶
type FileUpdate struct {
// contains filtered or unexported fields
}
FileUpdate is the builder for updating File entities.
func (*FileUpdate) AddFileType ¶
func (fu *FileUpdate) AddFileType(u int8) *FileUpdate
AddFileType adds u to the "file_type" field.
func (*FileUpdate) AddSize ¶
func (fu *FileUpdate) AddSize(u int64) *FileUpdate
AddSize adds u to the "size" field.
func (*FileUpdate) AddStatus ¶
func (fu *FileUpdate) AddStatus(u int8) *FileUpdate
AddStatus adds u to the "status" field.
func (*FileUpdate) AddTagIDs ¶ added in v1.0.12
func (fu *FileUpdate) AddTagIDs(ids ...uint64) *FileUpdate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*FileUpdate) AddTags ¶ added in v1.0.12
func (fu *FileUpdate) AddTags(t ...*Tag) *FileUpdate
AddTags adds the "tags" edges to the Tag entity.
func (*FileUpdate) ClearStatus ¶
func (fu *FileUpdate) ClearStatus() *FileUpdate
ClearStatus clears the value of the "status" field.
func (*FileUpdate) ClearTags ¶ added in v1.0.12
func (fu *FileUpdate) ClearTags() *FileUpdate
ClearTags clears all "tags" edges to the Tag entity.
func (*FileUpdate) Exec ¶
func (fu *FileUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FileUpdate) ExecContext ¶ added in v1.0.11
func (c *FileUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*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) QueryContext ¶ added in v1.0.11
func (c *FileUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*FileUpdate) RemoveTagIDs ¶ added in v1.0.12
func (fu *FileUpdate) RemoveTagIDs(ids ...uint64) *FileUpdate
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*FileUpdate) RemoveTags ¶ added in v1.0.12
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) SetFileType ¶
func (fu *FileUpdate) SetFileType(u uint8) *FileUpdate
SetFileType sets the "file_type" field.
func (*FileUpdate) SetMd5 ¶
func (fu *FileUpdate) SetMd5(s string) *FileUpdate
SetMd5 sets the "md5" field.
func (*FileUpdate) SetName ¶
func (fu *FileUpdate) SetName(s string) *FileUpdate
SetName sets the "name" field.
func (*FileUpdate) SetNillableStatus ¶
func (fu *FileUpdate) SetNillableStatus(u *uint8) *FileUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*FileUpdate) SetNotNilFileType ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilFileType(value *uint8) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilMd5 ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilMd5(value *string) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilName ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilName(value *string) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilPath ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilPath(value *string) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilSize ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilSize(value *uint64) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilStatus ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilStatus(value *uint8) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilUpdatedAt ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilUpdatedAt(value *time.Time) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetNotNilUserUUID ¶ added in v1.0.10
func (f *FileUpdate) SetNotNilUserUUID(value *string) *FileUpdate
set field if value's pointer is not nil.
func (*FileUpdate) SetPath ¶
func (fu *FileUpdate) SetPath(s string) *FileUpdate
SetPath sets the "path" field.
func (*FileUpdate) SetSize ¶
func (fu *FileUpdate) SetSize(u uint64) *FileUpdate
SetSize sets the "size" field.
func (*FileUpdate) SetStatus ¶
func (fu *FileUpdate) SetStatus(u uint8) *FileUpdate
SetStatus sets the "status" field.
func (*FileUpdate) SetUpdatedAt ¶
func (fu *FileUpdate) SetUpdatedAt(t time.Time) *FileUpdate
SetUpdatedAt sets the "updated_at" field.
func (*FileUpdate) SetUserUUID ¶
func (fu *FileUpdate) SetUserUUID(s string) *FileUpdate
SetUserUUID sets the "user_uuid" 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) AddFileType ¶
func (fuo *FileUpdateOne) AddFileType(u int8) *FileUpdateOne
AddFileType adds u to the "file_type" field.
func (*FileUpdateOne) AddSize ¶
func (fuo *FileUpdateOne) AddSize(u int64) *FileUpdateOne
AddSize adds u to the "size" field.
func (*FileUpdateOne) AddStatus ¶
func (fuo *FileUpdateOne) AddStatus(u int8) *FileUpdateOne
AddStatus adds u to the "status" field.
func (*FileUpdateOne) AddTagIDs ¶ added in v1.0.12
func (fuo *FileUpdateOne) AddTagIDs(ids ...uint64) *FileUpdateOne
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*FileUpdateOne) AddTags ¶ added in v1.0.12
func (fuo *FileUpdateOne) AddTags(t ...*Tag) *FileUpdateOne
AddTags adds the "tags" edges to the Tag entity.
func (*FileUpdateOne) ClearStatus ¶
func (fuo *FileUpdateOne) ClearStatus() *FileUpdateOne
ClearStatus clears the value of the "status" field.
func (*FileUpdateOne) ClearTags ¶ added in v1.0.12
func (fuo *FileUpdateOne) ClearTags() *FileUpdateOne
ClearTags clears all "tags" edges to the Tag entity.
func (*FileUpdateOne) Exec ¶
func (fuo *FileUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FileUpdateOne) ExecContext ¶ added in v1.0.11
func (c *FileUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*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) QueryContext ¶ added in v1.0.11
func (c *FileUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*FileUpdateOne) RemoveTagIDs ¶ added in v1.0.12
func (fuo *FileUpdateOne) RemoveTagIDs(ids ...uint64) *FileUpdateOne
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*FileUpdateOne) RemoveTags ¶ added in v1.0.12
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) SetFileType ¶
func (fuo *FileUpdateOne) SetFileType(u uint8) *FileUpdateOne
SetFileType sets the "file_type" field.
func (*FileUpdateOne) SetMd5 ¶
func (fuo *FileUpdateOne) SetMd5(s string) *FileUpdateOne
SetMd5 sets the "md5" field.
func (*FileUpdateOne) SetName ¶
func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne
SetName sets the "name" field.
func (*FileUpdateOne) SetNillableStatus ¶
func (fuo *FileUpdateOne) SetNillableStatus(u *uint8) *FileUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*FileUpdateOne) SetNotNilFileType ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilFileType(value *uint8) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilMd5 ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilMd5(value *string) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilName ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilName(value *string) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilPath ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilPath(value *string) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilSize ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilSize(value *uint64) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilStatus ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilStatus(value *uint8) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilUpdatedAt ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilUpdatedAt(value *time.Time) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetNotNilUserUUID ¶ added in v1.0.10
func (f *FileUpdateOne) SetNotNilUserUUID(value *string) *FileUpdateOne
set field if value's pointer is not nil.
func (*FileUpdateOne) SetPath ¶
func (fuo *FileUpdateOne) SetPath(s string) *FileUpdateOne
SetPath sets the "path" field.
func (*FileUpdateOne) SetSize ¶
func (fuo *FileUpdateOne) SetSize(u uint64) *FileUpdateOne
SetSize sets the "size" field.
func (*FileUpdateOne) SetStatus ¶
func (fuo *FileUpdateOne) SetStatus(u uint8) *FileUpdateOne
SetStatus sets the "status" field.
func (*FileUpdateOne) SetUpdatedAt ¶
func (fuo *FileUpdateOne) SetUpdatedAt(t time.Time) *FileUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*FileUpdateOne) SetUserUUID ¶
func (fuo *FileUpdateOne) SetUserUUID(s string) *FileUpdateOne
SetUserUUID sets the "user_uuid" field.
func (*FileUpdateOne) Where ¶
func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne
Where appends a list predicates to the FileUpdate builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderDirection ¶
type OrderDirection string
OrderDirection defines the directions in which to order a list of items.
const ( // OrderDirectionAsc specifies an ascending order. OrderDirectionAsc OrderDirection = "ASC" // OrderDirectionDesc specifies a descending order. OrderDirectionDesc OrderDirection = "DESC" )
func (OrderDirection) String ¶
func (o OrderDirection) String() string
String implements fmt.Stringer interface.
func (OrderDirection) Validate ¶
func (o OrderDirection) Validate() error
Validate the order direction value.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type PageDetails ¶
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Tag ¶ added in v1.0.12
type Tag struct { // ID of the ent. ID uint64 `json:"id,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"` // status 1 normal 2 ban | 状态 1 正常 2 禁用 Status uint8 `json:"status,omitempty"` // Tag's name | 标签名称 Name string `json:"name,omitempty"` // The remark of tag | 标签的备注 Remark string `json:"remark,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TagQuery when eager-loading is set. Edges TagEdges `json:"edges"` // contains filtered or unexported fields }
Tag is the model entity for the Tag schema.
func (*Tag) ExecContext ¶ added in v1.0.12
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Tag) QueryContext ¶ added in v1.0.12
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Tag) QueryFiles ¶ added in v1.0.12
QueryFiles queries the "files" edge of the Tag entity.
func (*Tag) Unwrap ¶ added in v1.0.12
Unwrap unwraps the Tag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Tag) Update ¶ added in v1.0.12
func (t *Tag) Update() *TagUpdateOne
Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.
type TagClient ¶ added in v1.0.12
type TagClient struct {
// contains filtered or unexported fields
}
TagClient is a client for the Tag schema.
func NewTagClient ¶ added in v1.0.12
func NewTagClient(c config) *TagClient
NewTagClient returns a client for the Tag from the given config.
func (*TagClient) CreateBulk ¶ added in v1.0.12
func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
CreateBulk returns a builder for creating a bulk of Tag entities.
func (*TagClient) DeleteOne ¶ added in v1.0.12
func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TagClient) DeleteOneID ¶ added in v1.0.12
func (c *TagClient) DeleteOneID(id uint64) *TagDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TagClient) ExecContext ¶ added in v1.0.12
func (c *TagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagClient) Intercept ¶ added in v1.0.12
func (c *TagClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.
func (*TagClient) Interceptors ¶ added in v1.0.12
func (c *TagClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TagClient) QueryContext ¶ added in v1.0.12
func (c *TagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagClient) QueryFiles ¶ added in v1.0.12
QueryFiles queries the files edge of a Tag.
func (*TagClient) UpdateOne ¶ added in v1.0.12
func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TagClient) UpdateOneID ¶ added in v1.0.12
func (c *TagClient) UpdateOneID(id uint64) *TagUpdateOne
UpdateOneID returns an update builder for the given id.
type TagCreate ¶ added in v1.0.12
type TagCreate struct {
// contains filtered or unexported fields
}
TagCreate is the builder for creating a Tag entity.
func (*TagCreate) AddFileIDs ¶ added in v1.0.12
AddFileIDs adds the "files" edge to the File entity by IDs.
func (*TagCreate) ExecContext ¶ added in v1.0.12
func (c *TagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagCreate) Mutation ¶ added in v1.0.12
func (tc *TagCreate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagCreate) QueryContext ¶ added in v1.0.12
func (c *TagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagCreate) SetCreatedAt ¶ added in v1.0.12
SetCreatedAt sets the "created_at" field.
func (*TagCreate) SetNillableCreatedAt ¶ added in v1.0.12
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TagCreate) SetNillableRemark ¶ added in v1.0.12
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*TagCreate) SetNillableStatus ¶ added in v1.0.12
SetNillableStatus sets the "status" field if the given value is not nil.
func (*TagCreate) SetNillableUpdatedAt ¶ added in v1.0.12
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*TagCreate) SetNotNilName ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagCreate) SetNotNilRemark ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagCreate) SetNotNilStatus ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagCreate) SetNotNilUpdatedAt ¶ added in v1.0.12
set field if value's pointer is not nil.
type TagCreateBulk ¶ added in v1.0.12
type TagCreateBulk struct {
// contains filtered or unexported fields
}
TagCreateBulk is the builder for creating many Tag entities in bulk.
func (*TagCreateBulk) Exec ¶ added in v1.0.12
func (tcb *TagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagCreateBulk) ExecContext ¶ added in v1.0.12
func (c *TagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagCreateBulk) ExecX ¶ added in v1.0.12
func (tcb *TagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagCreateBulk) QueryContext ¶ added in v1.0.12
func (c *TagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type TagDelete ¶ added in v1.0.12
type TagDelete struct {
// contains filtered or unexported fields
}
TagDelete is the builder for deleting a Tag entity.
func (*TagDelete) Exec ¶ added in v1.0.12
Exec executes the deletion query and returns how many vertices were deleted.
func (*TagDelete) ExecContext ¶ added in v1.0.12
func (c *TagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagDelete) QueryContext ¶ added in v1.0.12
func (c *TagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type TagDeleteOne ¶ added in v1.0.12
type TagDeleteOne struct {
// contains filtered or unexported fields
}
TagDeleteOne is the builder for deleting a single Tag entity.
func (*TagDeleteOne) Exec ¶ added in v1.0.12
func (tdo *TagDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TagDeleteOne) ExecX ¶ added in v1.0.12
func (tdo *TagDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagDeleteOne) Where ¶ added in v1.0.12
func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne
Where appends a list predicates to the TagDelete builder.
type TagEdges ¶ added in v1.0.12
type TagEdges struct { // Files holds the value of the files edge. Files []*File `json:"files,omitempty"` // contains filtered or unexported fields }
TagEdges holds the relations/edges for other nodes in the graph.
func (TagEdges) FilesOrErr ¶ added in v1.0.12
FilesOrErr returns the Files value or an error if the edge was not loaded in eager-loading.
type TagGroupBy ¶ added in v1.0.12
type TagGroupBy struct {
// contains filtered or unexported fields
}
TagGroupBy is the group-by builder for Tag entities.
func (*TagGroupBy) Aggregate ¶ added in v1.0.12
func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TagGroupBy) Bool ¶ added in v1.0.12
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Bools ¶ added in v1.0.12
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64 ¶ added in v1.0.12
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64X ¶ added in v1.0.12
Float64X is like Float64, but panics if an error occurs.
func (*TagGroupBy) Float64s ¶ added in v1.0.12
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64sX ¶ added in v1.0.12
Float64sX is like Float64s, but panics if an error occurs.
func (*TagGroupBy) Int ¶ added in v1.0.12
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Ints ¶ added in v1.0.12
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Scan ¶ added in v1.0.12
func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TagGroupBy) String ¶ added in v1.0.12
String returns a single string from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) StringX ¶ added in v1.0.12
StringX is like String, but panics if an error occurs.
type TagMutation ¶ added in v1.0.12
type TagMutation struct {
// contains filtered or unexported fields
}
TagMutation represents an operation that mutates the Tag nodes in the graph.
func (*TagMutation) AddField ¶ added in v1.0.12
func (m *TagMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) AddFileIDs ¶ added in v1.0.12
func (m *TagMutation) AddFileIDs(ids ...uuid.UUID)
AddFileIDs adds the "files" edge to the File entity by ids.
func (*TagMutation) AddStatus ¶ added in v1.0.12
func (m *TagMutation) AddStatus(u int8)
AddStatus adds u to the "status" field.
func (*TagMutation) AddedEdges ¶ added in v1.0.12
func (m *TagMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TagMutation) AddedField ¶ added in v1.0.12
func (m *TagMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) AddedFields ¶ added in v1.0.12
func (m *TagMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TagMutation) AddedIDs ¶ added in v1.0.12
func (m *TagMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TagMutation) AddedStatus ¶ added in v1.0.12
func (m *TagMutation) AddedStatus() (r int8, exists bool)
AddedStatus returns the value that was added to the "status" field in this mutation.
func (*TagMutation) ClearEdge ¶ added in v1.0.12
func (m *TagMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*TagMutation) ClearField ¶ added in v1.0.12
func (m *TagMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ClearFiles ¶ added in v1.0.12
func (m *TagMutation) ClearFiles()
ClearFiles clears the "files" edge to the File entity.
func (*TagMutation) ClearRemark ¶ added in v1.0.12
func (m *TagMutation) ClearRemark()
ClearRemark clears the value of the "remark" field.
func (*TagMutation) ClearStatus ¶ added in v1.0.12
func (m *TagMutation) ClearStatus()
ClearStatus clears the value of the "status" field.
func (*TagMutation) ClearedEdges ¶ added in v1.0.12
func (m *TagMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TagMutation) ClearedFields ¶ added in v1.0.12
func (m *TagMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TagMutation) Client ¶ added in v1.0.12
func (m TagMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*TagMutation) CreatedAt ¶ added in v1.0.12
func (m *TagMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TagMutation) EdgeCleared ¶ added in v1.0.12
func (m *TagMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TagMutation) ExecContext ¶ added in v1.0.12
func (c *TagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagMutation) Field ¶ added in v1.0.12
func (m *TagMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) FieldCleared ¶ added in v1.0.12
func (m *TagMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TagMutation) Fields ¶ added in v1.0.12
func (m *TagMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*TagMutation) FilesCleared ¶ added in v1.0.12
func (m *TagMutation) FilesCleared() bool
FilesCleared reports if the "files" edge to the File entity was cleared.
func (*TagMutation) FilesIDs ¶ added in v1.0.12
func (m *TagMutation) FilesIDs() (ids []uuid.UUID)
FilesIDs returns the "files" edge IDs in the mutation.
func (*TagMutation) ID ¶ added in v1.0.12
func (m *TagMutation) ID() (id uint64, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*TagMutation) IDs ¶ added in v1.0.12
func (m *TagMutation) IDs(ctx context.Context) ([]uint64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TagMutation) Name ¶ added in v1.0.12
func (m *TagMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TagMutation) OldCreatedAt ¶ added in v1.0.12
OldCreatedAt returns the old "created_at" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldField ¶ added in v1.0.12
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*TagMutation) OldName ¶ added in v1.0.12
func (m *TagMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldRemark ¶ added in v1.0.12
func (m *TagMutation) OldRemark(ctx context.Context) (v string, err error)
OldRemark returns the old "remark" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldStatus ¶ added in v1.0.12
func (m *TagMutation) OldStatus(ctx context.Context) (v uint8, err error)
OldStatus returns the old "status" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldUpdatedAt ¶ added in v1.0.12
OldUpdatedAt returns the old "updated_at" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) Op ¶ added in v1.0.12
func (m *TagMutation) Op() Op
Op returns the operation name.
func (*TagMutation) QueryContext ¶ added in v1.0.12
func (c *TagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagMutation) Remark ¶ added in v1.0.12
func (m *TagMutation) Remark() (r string, exists bool)
Remark returns the value of the "remark" field in the mutation.
func (*TagMutation) RemarkCleared ¶ added in v1.0.12
func (m *TagMutation) RemarkCleared() bool
RemarkCleared returns if the "remark" field was cleared in this mutation.
func (*TagMutation) RemoveFileIDs ¶ added in v1.0.12
func (m *TagMutation) RemoveFileIDs(ids ...uuid.UUID)
RemoveFileIDs removes the "files" edge to the File entity by IDs.
func (*TagMutation) RemovedEdges ¶ added in v1.0.12
func (m *TagMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TagMutation) RemovedFilesIDs ¶ added in v1.0.12
func (m *TagMutation) RemovedFilesIDs() (ids []uuid.UUID)
RemovedFiles returns the removed IDs of the "files" edge to the File entity.
func (*TagMutation) RemovedIDs ¶ added in v1.0.12
func (m *TagMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*TagMutation) ResetCreatedAt ¶ added in v1.0.12
func (m *TagMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TagMutation) ResetEdge ¶ added in v1.0.12
func (m *TagMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*TagMutation) ResetField ¶ added in v1.0.12
func (m *TagMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ResetFiles ¶ added in v1.0.12
func (m *TagMutation) ResetFiles()
ResetFiles resets all changes to the "files" edge.
func (*TagMutation) ResetName ¶ added in v1.0.12
func (m *TagMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TagMutation) ResetRemark ¶ added in v1.0.12
func (m *TagMutation) ResetRemark()
ResetRemark resets all changes to the "remark" field.
func (*TagMutation) ResetStatus ¶ added in v1.0.12
func (m *TagMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*TagMutation) ResetUpdatedAt ¶ added in v1.0.12
func (m *TagMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*TagMutation) SetCreatedAt ¶ added in v1.0.12
func (m *TagMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TagMutation) SetField ¶ added in v1.0.12
func (m *TagMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) SetID ¶ added in v1.0.12
func (m *TagMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Tag entities.
func (*TagMutation) SetName ¶ added in v1.0.12
func (m *TagMutation) SetName(s string)
SetName sets the "name" field.
func (*TagMutation) SetOp ¶ added in v1.0.12
func (m *TagMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TagMutation) SetRemark ¶ added in v1.0.12
func (m *TagMutation) SetRemark(s string)
SetRemark sets the "remark" field.
func (*TagMutation) SetStatus ¶ added in v1.0.12
func (m *TagMutation) SetStatus(u uint8)
SetStatus sets the "status" field.
func (*TagMutation) SetUpdatedAt ¶ added in v1.0.12
func (m *TagMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*TagMutation) Status ¶ added in v1.0.12
func (m *TagMutation) Status() (r uint8, exists bool)
Status returns the value of the "status" field in the mutation.
func (*TagMutation) StatusCleared ¶ added in v1.0.12
func (m *TagMutation) StatusCleared() bool
StatusCleared returns if the "status" field was cleared in this mutation.
func (TagMutation) Tx ¶ added in v1.0.12
func (m TagMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TagMutation) Type ¶ added in v1.0.12
func (m *TagMutation) Type() string
Type returns the node type of this mutation (Tag).
func (*TagMutation) UpdatedAt ¶ added in v1.0.12
func (m *TagMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*TagMutation) Where ¶ added in v1.0.12
func (m *TagMutation) Where(ps ...predicate.Tag)
Where appends a list predicates to the TagMutation builder.
func (*TagMutation) WhereP ¶ added in v1.0.12
func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TagPageList ¶ added in v1.0.12
type TagPageList struct { List []*Tag `json:"list"` PageDetails *PageDetails `json:"pageDetails"` }
TagPageList is Tag PageList result.
type TagPager ¶ added in v1.0.12
type TagPager struct { Order tag.OrderOption Filter func(*TagQuery) (*TagQuery, error) }
type TagPaginateOption ¶ added in v1.0.12
type TagPaginateOption func(*TagPager)
TagPaginateOption enables pagination customization.
type TagQuery ¶ added in v1.0.12
type TagQuery struct {
// contains filtered or unexported fields
}
TagQuery is the builder for querying Tag entities.
func (*TagQuery) Aggregate ¶ added in v1.0.12
func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate returns a TagSelect configured with the given aggregations.
func (*TagQuery) Clone ¶ added in v1.0.12
Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TagQuery) ExecContext ¶ added in v1.0.12
func (c *TagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagQuery) Exist ¶ added in v1.0.12
Exist returns true if the query has elements in the graph.
func (*TagQuery) First ¶ added in v1.0.12
First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.
func (*TagQuery) FirstID ¶ added in v1.0.12
FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.
func (*TagQuery) FirstIDX ¶ added in v1.0.12
FirstIDX is like FirstID, but panics if an error occurs.
func (*TagQuery) GroupBy ¶ added in v1.0.12
func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Tag.Query(). GroupBy(tag.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TagQuery) Only ¶ added in v1.0.12
Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.
func (*TagQuery) OnlyID ¶ added in v1.0.12
OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.
func (*TagQuery) Order ¶ added in v1.0.12
func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
Order specifies how the records should be ordered.
func (*TagQuery) Page ¶ added in v1.0.12
func (t *TagQuery) Page( ctx context.Context, pageNum uint64, pageSize uint64, opts ...TagPaginateOption, ) (*TagPageList, error)
func (*TagQuery) QueryContext ¶ added in v1.0.12
func (c *TagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagQuery) QueryFiles ¶ added in v1.0.12
QueryFiles chains the current query on the "files" edge.
func (*TagQuery) Select ¶ added in v1.0.12
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Tag.Query(). Select(tag.FieldCreatedAt). Scan(ctx, &v)
func (*TagQuery) Unique ¶ added in v1.0.12
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.
type TagSelect ¶ added in v1.0.12
type TagSelect struct { *TagQuery // contains filtered or unexported fields }
TagSelect is the builder for selecting fields of Tag entities.
func (*TagSelect) Aggregate ¶ added in v1.0.12
func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TagSelect) Bool ¶ added in v1.0.12
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagSelect) Bools ¶ added in v1.0.12
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (TagSelect) ExecContext ¶ added in v1.0.12
func (c TagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagSelect) Float64 ¶ added in v1.0.12
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64X ¶ added in v1.0.12
Float64X is like Float64, but panics if an error occurs.
func (*TagSelect) Float64s ¶ added in v1.0.12
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64sX ¶ added in v1.0.12
Float64sX is like Float64s, but panics if an error occurs.
func (*TagSelect) Int ¶ added in v1.0.12
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagSelect) Ints ¶ added in v1.0.12
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (TagSelect) QueryContext ¶ added in v1.0.12
func (c TagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagSelect) Scan ¶ added in v1.0.12
Scan applies the selector query and scans the result into the given value.
func (*TagSelect) String ¶ added in v1.0.12
String returns a single string from a selector. It is only allowed when selecting one field.
type TagUpdate ¶ added in v1.0.12
type TagUpdate struct {
// contains filtered or unexported fields
}
TagUpdate is the builder for updating Tag entities.
func (*TagUpdate) AddFileIDs ¶ added in v1.0.12
AddFileIDs adds the "files" edge to the File entity by IDs.
func (*TagUpdate) ClearFiles ¶ added in v1.0.12
ClearFiles clears all "files" edges to the File entity.
func (*TagUpdate) ClearRemark ¶ added in v1.0.12
ClearRemark clears the value of the "remark" field.
func (*TagUpdate) ClearStatus ¶ added in v1.0.12
ClearStatus clears the value of the "status" field.
func (*TagUpdate) ExecContext ¶ added in v1.0.12
func (c *TagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagUpdate) Mutation ¶ added in v1.0.12
func (tu *TagUpdate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdate) QueryContext ¶ added in v1.0.12
func (c *TagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagUpdate) RemoveFileIDs ¶ added in v1.0.12
RemoveFileIDs removes the "files" edge to File entities by IDs.
func (*TagUpdate) RemoveFiles ¶ added in v1.0.12
RemoveFiles removes "files" edges to File entities.
func (*TagUpdate) Save ¶ added in v1.0.12
Save executes the query and returns the number of nodes affected by the update operation.
func (*TagUpdate) SetNillableRemark ¶ added in v1.0.12
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*TagUpdate) SetNillableStatus ¶ added in v1.0.12
SetNillableStatus sets the "status" field if the given value is not nil.
func (*TagUpdate) SetNotNilName ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagUpdate) SetNotNilRemark ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagUpdate) SetNotNilStatus ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagUpdate) SetNotNilUpdatedAt ¶ added in v1.0.12
set field if value's pointer is not nil.
func (*TagUpdate) SetUpdatedAt ¶ added in v1.0.12
SetUpdatedAt sets the "updated_at" field.
type TagUpdateOne ¶ added in v1.0.12
type TagUpdateOne struct {
// contains filtered or unexported fields
}
TagUpdateOne is the builder for updating a single Tag entity.
func (*TagUpdateOne) AddFileIDs ¶ added in v1.0.12
func (tuo *TagUpdateOne) AddFileIDs(ids ...uuid.UUID) *TagUpdateOne
AddFileIDs adds the "files" edge to the File entity by IDs.
func (*TagUpdateOne) AddFiles ¶ added in v1.0.12
func (tuo *TagUpdateOne) AddFiles(f ...*File) *TagUpdateOne
AddFiles adds the "files" edges to the File entity.
func (*TagUpdateOne) AddStatus ¶ added in v1.0.12
func (tuo *TagUpdateOne) AddStatus(u int8) *TagUpdateOne
AddStatus adds u to the "status" field.
func (*TagUpdateOne) ClearFiles ¶ added in v1.0.12
func (tuo *TagUpdateOne) ClearFiles() *TagUpdateOne
ClearFiles clears all "files" edges to the File entity.
func (*TagUpdateOne) ClearRemark ¶ added in v1.0.12
func (tuo *TagUpdateOne) ClearRemark() *TagUpdateOne
ClearRemark clears the value of the "remark" field.
func (*TagUpdateOne) ClearStatus ¶ added in v1.0.12
func (tuo *TagUpdateOne) ClearStatus() *TagUpdateOne
ClearStatus clears the value of the "status" field.
func (*TagUpdateOne) Exec ¶ added in v1.0.12
func (tuo *TagUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TagUpdateOne) ExecContext ¶ added in v1.0.12
func (c *TagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*TagUpdateOne) ExecX ¶ added in v1.0.12
func (tuo *TagUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagUpdateOne) Mutation ¶ added in v1.0.12
func (tuo *TagUpdateOne) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdateOne) QueryContext ¶ added in v1.0.12
func (c *TagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*TagUpdateOne) RemoveFileIDs ¶ added in v1.0.12
func (tuo *TagUpdateOne) RemoveFileIDs(ids ...uuid.UUID) *TagUpdateOne
RemoveFileIDs removes the "files" edge to File entities by IDs.
func (*TagUpdateOne) RemoveFiles ¶ added in v1.0.12
func (tuo *TagUpdateOne) RemoveFiles(f ...*File) *TagUpdateOne
RemoveFiles removes "files" edges to File entities.
func (*TagUpdateOne) Save ¶ added in v1.0.12
func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
Save executes the query and returns the updated Tag entity.
func (*TagUpdateOne) SaveX ¶ added in v1.0.12
func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
SaveX is like Save, but panics if an error occurs.
func (*TagUpdateOne) Select ¶ added in v1.0.12
func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TagUpdateOne) SetName ¶ added in v1.0.12
func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne
SetName sets the "name" field.
func (*TagUpdateOne) SetNillableRemark ¶ added in v1.0.12
func (tuo *TagUpdateOne) SetNillableRemark(s *string) *TagUpdateOne
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*TagUpdateOne) SetNillableStatus ¶ added in v1.0.12
func (tuo *TagUpdateOne) SetNillableStatus(u *uint8) *TagUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*TagUpdateOne) SetNotNilName ¶ added in v1.0.12
func (t *TagUpdateOne) SetNotNilName(value *string) *TagUpdateOne
set field if value's pointer is not nil.
func (*TagUpdateOne) SetNotNilRemark ¶ added in v1.0.12
func (t *TagUpdateOne) SetNotNilRemark(value *string) *TagUpdateOne
set field if value's pointer is not nil.
func (*TagUpdateOne) SetNotNilStatus ¶ added in v1.0.12
func (t *TagUpdateOne) SetNotNilStatus(value *uint8) *TagUpdateOne
set field if value's pointer is not nil.
func (*TagUpdateOne) SetNotNilUpdatedAt ¶ added in v1.0.12
func (t *TagUpdateOne) SetNotNilUpdatedAt(value *time.Time) *TagUpdateOne
set field if value's pointer is not nil.
func (*TagUpdateOne) SetRemark ¶ added in v1.0.12
func (tuo *TagUpdateOne) SetRemark(s string) *TagUpdateOne
SetRemark sets the "remark" field.
func (*TagUpdateOne) SetStatus ¶ added in v1.0.12
func (tuo *TagUpdateOne) SetStatus(u uint8) *TagUpdateOne
SetStatus sets the "status" field.
func (*TagUpdateOne) SetUpdatedAt ¶ added in v1.0.12
func (tuo *TagUpdateOne) SetUpdatedAt(t time.Time) *TagUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*TagUpdateOne) Where ¶ added in v1.0.12
func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
Where appends a list predicates to the TagUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // File is the client for interacting with the File builders. File *FileClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) ExecContext ¶ added in v1.0.11
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
func (*Tx) QueryContext ¶ added in v1.0.11
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.