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 Book
- type BookClient
- func (c *BookClient) Create() *BookCreate
- func (c *BookClient) CreateBulk(builders ...*BookCreate) *BookCreateBulk
- func (c *BookClient) Delete() *BookDelete
- func (c *BookClient) DeleteOne(b *Book) *BookDeleteOne
- func (c *BookClient) DeleteOneID(id int) *BookDeleteOne
- func (c *BookClient) Get(ctx context.Context, id int) (*Book, error)
- func (c *BookClient) GetX(ctx context.Context, id int) *Book
- func (c *BookClient) Hooks() []Hook
- func (c *BookClient) Intercept(interceptors ...Interceptor)
- func (c *BookClient) Interceptors() []Interceptor
- func (c *BookClient) MapCreateBulk(slice any, setFunc func(*BookCreate, int)) *BookCreateBulk
- func (c *BookClient) Query() *BookQuery
- func (c *BookClient) QueryPageInfos(b *Book) *SinglePageInfoQuery
- func (c *BookClient) Update() *BookUpdate
- func (c *BookClient) UpdateOne(b *Book) *BookUpdateOne
- func (c *BookClient) UpdateOneID(id int) *BookUpdateOne
- func (c *BookClient) Use(hooks ...Hook)
- type BookCreate
- func (bc *BookCreate) AddPageInfoIDs(ids ...int) *BookCreate
- func (bc *BookCreate) AddPageInfos(s ...*SinglePageInfo) *BookCreate
- func (bc *BookCreate) Exec(ctx context.Context) error
- func (bc *BookCreate) ExecX(ctx context.Context)
- func (bc *BookCreate) Mutation() *BookMutation
- func (bc *BookCreate) Save(ctx context.Context) (*Book, error)
- func (bc *BookCreate) SaveX(ctx context.Context) *Book
- func (bc *BookCreate) SetAuthors(s string) *BookCreate
- func (bc *BookCreate) SetBookID(s string) *BookCreate
- func (bc *BookCreate) SetBookStorePath(s string) *BookCreate
- func (bc *BookCreate) SetChildBookNum(i int) *BookCreate
- func (bc *BookCreate) SetDepth(i int) *BookCreate
- func (bc *BookCreate) SetExtractNum(i int) *BookCreate
- func (bc *BookCreate) SetExtractPath(s string) *BookCreate
- func (bc *BookCreate) SetFilePath(s string) *BookCreate
- func (bc *BookCreate) SetFileSize(i int64) *BookCreate
- func (bc *BookCreate) SetISBN(s string) *BookCreate
- func (bc *BookCreate) SetInitComplete(b bool) *BookCreate
- func (bc *BookCreate) SetModified(t time.Time) *BookCreate
- func (bc *BookCreate) SetNillableModified(t *time.Time) *BookCreate
- func (bc *BookCreate) SetNillableOwner(s *string) *BookCreate
- func (bc *BookCreate) SetNonUTF8Zip(b bool) *BookCreate
- func (bc *BookCreate) SetOwner(s string) *BookCreate
- func (bc *BookCreate) SetPageCount(i int) *BookCreate
- func (bc *BookCreate) SetParentFolder(s string) *BookCreate
- func (bc *BookCreate) SetPress(s string) *BookCreate
- func (bc *BookCreate) SetPublishedAt(s string) *BookCreate
- func (bc *BookCreate) SetReadPercent(f float64) *BookCreate
- func (bc *BookCreate) SetTitle(s string) *BookCreate
- func (bc *BookCreate) SetType(s string) *BookCreate
- func (bc *BookCreate) SetZipTextEncoding(s string) *BookCreate
- type BookCreateBulk
- type BookDelete
- type BookDeleteOne
- type BookEdges
- type BookGroupBy
- func (bgb *BookGroupBy) Aggregate(fns ...AggregateFunc) *BookGroupBy
- func (s *BookGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BookGroupBy) BoolX(ctx context.Context) bool
- func (s *BookGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BookGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BookGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BookGroupBy) Float64X(ctx context.Context) float64
- func (s *BookGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BookGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BookGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BookGroupBy) IntX(ctx context.Context) int
- func (s *BookGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BookGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BookGroupBy) Scan(ctx context.Context, v any) error
- func (s *BookGroupBy) ScanX(ctx context.Context, v any)
- func (s *BookGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BookGroupBy) StringX(ctx context.Context) string
- func (s *BookGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BookGroupBy) StringsX(ctx context.Context) []string
- type BookMutation
- func (m *BookMutation) AddChildBookNum(i int)
- func (m *BookMutation) AddDepth(i int)
- func (m *BookMutation) AddExtractNum(i int)
- func (m *BookMutation) AddField(name string, value ent.Value) error
- func (m *BookMutation) AddFileSize(i int64)
- func (m *BookMutation) AddPageCount(i int)
- func (m *BookMutation) AddPageInfoIDs(ids ...int)
- func (m *BookMutation) AddReadPercent(f float64)
- func (m *BookMutation) AddedChildBookNum() (r int, exists bool)
- func (m *BookMutation) AddedDepth() (r int, exists bool)
- func (m *BookMutation) AddedEdges() []string
- func (m *BookMutation) AddedExtractNum() (r int, exists bool)
- func (m *BookMutation) AddedField(name string) (ent.Value, bool)
- func (m *BookMutation) AddedFields() []string
- func (m *BookMutation) AddedFileSize() (r int64, exists bool)
- func (m *BookMutation) AddedIDs(name string) []ent.Value
- func (m *BookMutation) AddedPageCount() (r int, exists bool)
- func (m *BookMutation) AddedReadPercent() (r float64, exists bool)
- func (m *BookMutation) Authors() (r string, exists bool)
- func (m *BookMutation) BookID() (r string, exists bool)
- func (m *BookMutation) BookStorePath() (r string, exists bool)
- func (m *BookMutation) ChildBookNum() (r int, exists bool)
- func (m *BookMutation) ClearEdge(name string) error
- func (m *BookMutation) ClearField(name string) error
- func (m *BookMutation) ClearPageInfos()
- func (m *BookMutation) ClearedEdges() []string
- func (m *BookMutation) ClearedFields() []string
- func (m BookMutation) Client() *Client
- func (m *BookMutation) Depth() (r int, exists bool)
- func (m *BookMutation) EdgeCleared(name string) bool
- func (m *BookMutation) ExtractNum() (r int, exists bool)
- func (m *BookMutation) ExtractPath() (r string, exists bool)
- func (m *BookMutation) Field(name string) (ent.Value, bool)
- func (m *BookMutation) FieldCleared(name string) bool
- func (m *BookMutation) Fields() []string
- func (m *BookMutation) FilePath() (r string, exists bool)
- func (m *BookMutation) FileSize() (r int64, exists bool)
- func (m *BookMutation) GetType() (r string, exists bool)
- func (m *BookMutation) ID() (id int, exists bool)
- func (m *BookMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BookMutation) ISBN() (r string, exists bool)
- func (m *BookMutation) InitComplete() (r bool, exists bool)
- func (m *BookMutation) Modified() (r time.Time, exists bool)
- func (m *BookMutation) NonUTF8Zip() (r bool, exists bool)
- func (m *BookMutation) OldAuthors(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldBookID(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldBookStorePath(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldChildBookNum(ctx context.Context) (v int, err error)
- func (m *BookMutation) OldDepth(ctx context.Context) (v int, err error)
- func (m *BookMutation) OldExtractNum(ctx context.Context) (v int, err error)
- func (m *BookMutation) OldExtractPath(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BookMutation) OldFilePath(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldFileSize(ctx context.Context) (v int64, err error)
- func (m *BookMutation) OldISBN(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldInitComplete(ctx context.Context) (v bool, err error)
- func (m *BookMutation) OldModified(ctx context.Context) (v time.Time, err error)
- func (m *BookMutation) OldNonUTF8Zip(ctx context.Context) (v bool, err error)
- func (m *BookMutation) OldOwner(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldPageCount(ctx context.Context) (v int, err error)
- func (m *BookMutation) OldParentFolder(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldPress(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldPublishedAt(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldReadPercent(ctx context.Context) (v float64, err error)
- func (m *BookMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldType(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldZipTextEncoding(ctx context.Context) (v string, err error)
- func (m *BookMutation) Op() Op
- func (m *BookMutation) Owner() (r string, exists bool)
- func (m *BookMutation) PageCount() (r int, exists bool)
- func (m *BookMutation) PageInfosCleared() bool
- func (m *BookMutation) PageInfosIDs() (ids []int)
- func (m *BookMutation) ParentFolder() (r string, exists bool)
- func (m *BookMutation) Press() (r string, exists bool)
- func (m *BookMutation) PublishedAt() (r string, exists bool)
- func (m *BookMutation) ReadPercent() (r float64, exists bool)
- func (m *BookMutation) RemovePageInfoIDs(ids ...int)
- func (m *BookMutation) RemovedEdges() []string
- func (m *BookMutation) RemovedIDs(name string) []ent.Value
- func (m *BookMutation) RemovedPageInfosIDs() (ids []int)
- func (m *BookMutation) ResetAuthors()
- func (m *BookMutation) ResetBookID()
- func (m *BookMutation) ResetBookStorePath()
- func (m *BookMutation) ResetChildBookNum()
- func (m *BookMutation) ResetDepth()
- func (m *BookMutation) ResetEdge(name string) error
- func (m *BookMutation) ResetExtractNum()
- func (m *BookMutation) ResetExtractPath()
- func (m *BookMutation) ResetField(name string) error
- func (m *BookMutation) ResetFilePath()
- func (m *BookMutation) ResetFileSize()
- func (m *BookMutation) ResetISBN()
- func (m *BookMutation) ResetInitComplete()
- func (m *BookMutation) ResetModified()
- func (m *BookMutation) ResetNonUTF8Zip()
- func (m *BookMutation) ResetOwner()
- func (m *BookMutation) ResetPageCount()
- func (m *BookMutation) ResetPageInfos()
- func (m *BookMutation) ResetParentFolder()
- func (m *BookMutation) ResetPress()
- func (m *BookMutation) ResetPublishedAt()
- func (m *BookMutation) ResetReadPercent()
- func (m *BookMutation) ResetTitle()
- func (m *BookMutation) ResetType()
- func (m *BookMutation) ResetZipTextEncoding()
- func (m *BookMutation) SetAuthors(s string)
- func (m *BookMutation) SetBookID(s string)
- func (m *BookMutation) SetBookStorePath(s string)
- func (m *BookMutation) SetChildBookNum(i int)
- func (m *BookMutation) SetDepth(i int)
- func (m *BookMutation) SetExtractNum(i int)
- func (m *BookMutation) SetExtractPath(s string)
- func (m *BookMutation) SetField(name string, value ent.Value) error
- func (m *BookMutation) SetFilePath(s string)
- func (m *BookMutation) SetFileSize(i int64)
- func (m *BookMutation) SetISBN(s string)
- func (m *BookMutation) SetInitComplete(b bool)
- func (m *BookMutation) SetModified(t time.Time)
- func (m *BookMutation) SetNonUTF8Zip(b bool)
- func (m *BookMutation) SetOp(op Op)
- func (m *BookMutation) SetOwner(s string)
- func (m *BookMutation) SetPageCount(i int)
- func (m *BookMutation) SetParentFolder(s string)
- func (m *BookMutation) SetPress(s string)
- func (m *BookMutation) SetPublishedAt(s string)
- func (m *BookMutation) SetReadPercent(f float64)
- func (m *BookMutation) SetTitle(s string)
- func (m *BookMutation) SetType(s string)
- func (m *BookMutation) SetZipTextEncoding(s string)
- func (m *BookMutation) Title() (r string, exists bool)
- func (m BookMutation) Tx() (*Tx, error)
- func (m *BookMutation) Type() string
- func (m *BookMutation) Where(ps ...predicate.Book)
- func (m *BookMutation) WhereP(ps ...func(*sql.Selector))
- func (m *BookMutation) ZipTextEncoding() (r string, exists bool)
- type BookQuery
- func (bq *BookQuery) Aggregate(fns ...AggregateFunc) *BookSelect
- func (bq *BookQuery) All(ctx context.Context) ([]*Book, error)
- func (bq *BookQuery) AllX(ctx context.Context) []*Book
- func (bq *BookQuery) Clone() *BookQuery
- func (bq *BookQuery) Count(ctx context.Context) (int, error)
- func (bq *BookQuery) CountX(ctx context.Context) int
- func (bq *BookQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BookQuery) ExistX(ctx context.Context) bool
- func (bq *BookQuery) First(ctx context.Context) (*Book, error)
- func (bq *BookQuery) FirstID(ctx context.Context) (id int, err error)
- func (bq *BookQuery) FirstIDX(ctx context.Context) int
- func (bq *BookQuery) FirstX(ctx context.Context) *Book
- func (bq *BookQuery) GroupBy(field string, fields ...string) *BookGroupBy
- func (bq *BookQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bq *BookQuery) IDsX(ctx context.Context) []int
- func (bq *BookQuery) Limit(limit int) *BookQuery
- func (bq *BookQuery) Offset(offset int) *BookQuery
- func (bq *BookQuery) Only(ctx context.Context) (*Book, error)
- func (bq *BookQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bq *BookQuery) OnlyIDX(ctx context.Context) int
- func (bq *BookQuery) OnlyX(ctx context.Context) *Book
- func (bq *BookQuery) Order(o ...book.OrderOption) *BookQuery
- func (bq *BookQuery) QueryPageInfos() *SinglePageInfoQuery
- func (bq *BookQuery) Select(fields ...string) *BookSelect
- func (bq *BookQuery) Unique(unique bool) *BookQuery
- func (bq *BookQuery) Where(ps ...predicate.Book) *BookQuery
- func (bq *BookQuery) WithPageInfos(opts ...func(*SinglePageInfoQuery)) *BookQuery
- type BookSelect
- func (bs *BookSelect) Aggregate(fns ...AggregateFunc) *BookSelect
- func (s *BookSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BookSelect) BoolX(ctx context.Context) bool
- func (s *BookSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BookSelect) BoolsX(ctx context.Context) []bool
- func (s *BookSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BookSelect) Float64X(ctx context.Context) float64
- func (s *BookSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BookSelect) Float64sX(ctx context.Context) []float64
- func (s *BookSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BookSelect) IntX(ctx context.Context) int
- func (s *BookSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BookSelect) IntsX(ctx context.Context) []int
- func (bs *BookSelect) Scan(ctx context.Context, v any) error
- func (s *BookSelect) ScanX(ctx context.Context, v any)
- func (s *BookSelect) String(ctx context.Context) (_ string, err error)
- func (s *BookSelect) StringX(ctx context.Context) string
- func (s *BookSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BookSelect) StringsX(ctx context.Context) []string
- type BookUpdate
- func (bu *BookUpdate) AddChildBookNum(i int) *BookUpdate
- func (bu *BookUpdate) AddDepth(i int) *BookUpdate
- func (bu *BookUpdate) AddExtractNum(i int) *BookUpdate
- func (bu *BookUpdate) AddFileSize(i int64) *BookUpdate
- func (bu *BookUpdate) AddPageCount(i int) *BookUpdate
- func (bu *BookUpdate) AddPageInfoIDs(ids ...int) *BookUpdate
- func (bu *BookUpdate) AddPageInfos(s ...*SinglePageInfo) *BookUpdate
- func (bu *BookUpdate) AddReadPercent(f float64) *BookUpdate
- func (bu *BookUpdate) ClearPageInfos() *BookUpdate
- func (bu *BookUpdate) Exec(ctx context.Context) error
- func (bu *BookUpdate) ExecX(ctx context.Context)
- func (bu *BookUpdate) Mutation() *BookMutation
- func (bu *BookUpdate) RemovePageInfoIDs(ids ...int) *BookUpdate
- func (bu *BookUpdate) RemovePageInfos(s ...*SinglePageInfo) *BookUpdate
- func (bu *BookUpdate) Save(ctx context.Context) (int, error)
- func (bu *BookUpdate) SaveX(ctx context.Context) int
- func (bu *BookUpdate) SetAuthors(s string) *BookUpdate
- func (bu *BookUpdate) SetBookID(s string) *BookUpdate
- func (bu *BookUpdate) SetBookStorePath(s string) *BookUpdate
- func (bu *BookUpdate) SetChildBookNum(i int) *BookUpdate
- func (bu *BookUpdate) SetDepth(i int) *BookUpdate
- func (bu *BookUpdate) SetExtractNum(i int) *BookUpdate
- func (bu *BookUpdate) SetExtractPath(s string) *BookUpdate
- func (bu *BookUpdate) SetFilePath(s string) *BookUpdate
- func (bu *BookUpdate) SetFileSize(i int64) *BookUpdate
- func (bu *BookUpdate) SetISBN(s string) *BookUpdate
- func (bu *BookUpdate) SetInitComplete(b bool) *BookUpdate
- func (bu *BookUpdate) SetModified(t time.Time) *BookUpdate
- func (bu *BookUpdate) SetNillableAuthors(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableBookID(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableBookStorePath(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableChildBookNum(i *int) *BookUpdate
- func (bu *BookUpdate) SetNillableDepth(i *int) *BookUpdate
- func (bu *BookUpdate) SetNillableExtractNum(i *int) *BookUpdate
- func (bu *BookUpdate) SetNillableExtractPath(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableFilePath(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableFileSize(i *int64) *BookUpdate
- func (bu *BookUpdate) SetNillableISBN(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableInitComplete(b *bool) *BookUpdate
- func (bu *BookUpdate) SetNillableModified(t *time.Time) *BookUpdate
- func (bu *BookUpdate) SetNillableNonUTF8Zip(b *bool) *BookUpdate
- func (bu *BookUpdate) SetNillableOwner(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillablePageCount(i *int) *BookUpdate
- func (bu *BookUpdate) SetNillableParentFolder(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillablePress(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillablePublishedAt(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableReadPercent(f *float64) *BookUpdate
- func (bu *BookUpdate) SetNillableTitle(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableType(s *string) *BookUpdate
- func (bu *BookUpdate) SetNillableZipTextEncoding(s *string) *BookUpdate
- func (bu *BookUpdate) SetNonUTF8Zip(b bool) *BookUpdate
- func (bu *BookUpdate) SetOwner(s string) *BookUpdate
- func (bu *BookUpdate) SetPageCount(i int) *BookUpdate
- func (bu *BookUpdate) SetParentFolder(s string) *BookUpdate
- func (bu *BookUpdate) SetPress(s string) *BookUpdate
- func (bu *BookUpdate) SetPublishedAt(s string) *BookUpdate
- func (bu *BookUpdate) SetReadPercent(f float64) *BookUpdate
- func (bu *BookUpdate) SetTitle(s string) *BookUpdate
- func (bu *BookUpdate) SetType(s string) *BookUpdate
- func (bu *BookUpdate) SetZipTextEncoding(s string) *BookUpdate
- func (bu *BookUpdate) Where(ps ...predicate.Book) *BookUpdate
- type BookUpdateOne
- func (buo *BookUpdateOne) AddChildBookNum(i int) *BookUpdateOne
- func (buo *BookUpdateOne) AddDepth(i int) *BookUpdateOne
- func (buo *BookUpdateOne) AddExtractNum(i int) *BookUpdateOne
- func (buo *BookUpdateOne) AddFileSize(i int64) *BookUpdateOne
- func (buo *BookUpdateOne) AddPageCount(i int) *BookUpdateOne
- func (buo *BookUpdateOne) AddPageInfoIDs(ids ...int) *BookUpdateOne
- func (buo *BookUpdateOne) AddPageInfos(s ...*SinglePageInfo) *BookUpdateOne
- func (buo *BookUpdateOne) AddReadPercent(f float64) *BookUpdateOne
- func (buo *BookUpdateOne) ClearPageInfos() *BookUpdateOne
- func (buo *BookUpdateOne) Exec(ctx context.Context) error
- func (buo *BookUpdateOne) ExecX(ctx context.Context)
- func (buo *BookUpdateOne) Mutation() *BookMutation
- func (buo *BookUpdateOne) RemovePageInfoIDs(ids ...int) *BookUpdateOne
- func (buo *BookUpdateOne) RemovePageInfos(s ...*SinglePageInfo) *BookUpdateOne
- func (buo *BookUpdateOne) Save(ctx context.Context) (*Book, error)
- func (buo *BookUpdateOne) SaveX(ctx context.Context) *Book
- func (buo *BookUpdateOne) Select(field string, fields ...string) *BookUpdateOne
- func (buo *BookUpdateOne) SetAuthors(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetBookID(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetBookStorePath(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetChildBookNum(i int) *BookUpdateOne
- func (buo *BookUpdateOne) SetDepth(i int) *BookUpdateOne
- func (buo *BookUpdateOne) SetExtractNum(i int) *BookUpdateOne
- func (buo *BookUpdateOne) SetExtractPath(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetFilePath(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetFileSize(i int64) *BookUpdateOne
- func (buo *BookUpdateOne) SetISBN(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetInitComplete(b bool) *BookUpdateOne
- func (buo *BookUpdateOne) SetModified(t time.Time) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableAuthors(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableBookID(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableBookStorePath(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableChildBookNum(i *int) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableDepth(i *int) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableExtractNum(i *int) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableExtractPath(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableFilePath(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableFileSize(i *int64) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableISBN(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableInitComplete(b *bool) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableModified(t *time.Time) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableNonUTF8Zip(b *bool) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableOwner(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillablePageCount(i *int) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableParentFolder(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillablePress(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillablePublishedAt(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableReadPercent(f *float64) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableTitle(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableType(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNillableZipTextEncoding(s *string) *BookUpdateOne
- func (buo *BookUpdateOne) SetNonUTF8Zip(b bool) *BookUpdateOne
- func (buo *BookUpdateOne) SetOwner(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetPageCount(i int) *BookUpdateOne
- func (buo *BookUpdateOne) SetParentFolder(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetPress(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetPublishedAt(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetReadPercent(f float64) *BookUpdateOne
- func (buo *BookUpdateOne) SetTitle(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetType(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetZipTextEncoding(s string) *BookUpdateOne
- func (buo *BookUpdateOne) Where(ps ...predicate.Book) *BookUpdateOne
- type Books
- 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) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, 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 Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type SinglePageInfo
- type SinglePageInfoClient
- func (c *SinglePageInfoClient) Create() *SinglePageInfoCreate
- func (c *SinglePageInfoClient) CreateBulk(builders ...*SinglePageInfoCreate) *SinglePageInfoCreateBulk
- func (c *SinglePageInfoClient) Delete() *SinglePageInfoDelete
- func (c *SinglePageInfoClient) DeleteOne(spi *SinglePageInfo) *SinglePageInfoDeleteOne
- func (c *SinglePageInfoClient) DeleteOneID(id int) *SinglePageInfoDeleteOne
- func (c *SinglePageInfoClient) Get(ctx context.Context, id int) (*SinglePageInfo, error)
- func (c *SinglePageInfoClient) GetX(ctx context.Context, id int) *SinglePageInfo
- func (c *SinglePageInfoClient) Hooks() []Hook
- func (c *SinglePageInfoClient) Intercept(interceptors ...Interceptor)
- func (c *SinglePageInfoClient) Interceptors() []Interceptor
- func (c *SinglePageInfoClient) MapCreateBulk(slice any, setFunc func(*SinglePageInfoCreate, int)) *SinglePageInfoCreateBulk
- func (c *SinglePageInfoClient) Query() *SinglePageInfoQuery
- func (c *SinglePageInfoClient) Update() *SinglePageInfoUpdate
- func (c *SinglePageInfoClient) UpdateOne(spi *SinglePageInfo) *SinglePageInfoUpdateOne
- func (c *SinglePageInfoClient) UpdateOneID(id int) *SinglePageInfoUpdateOne
- func (c *SinglePageInfoClient) Use(hooks ...Hook)
- type SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) Exec(ctx context.Context) error
- func (spic *SinglePageInfoCreate) ExecX(ctx context.Context)
- func (spic *SinglePageInfoCreate) Mutation() *SinglePageInfoMutation
- func (spic *SinglePageInfoCreate) Save(ctx context.Context) (*SinglePageInfo, error)
- func (spic *SinglePageInfoCreate) SaveX(ctx context.Context) *SinglePageInfo
- func (spic *SinglePageInfoCreate) SetBlurHash(s string) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetBookID(s string) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetFileSize(i int64) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetHeight(i int) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetImgType(s string) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetModeTime(t time.Time) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetNameInArchive(s string) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetNillableModeTime(t *time.Time) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetPageNum(i int) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetRealImageFilePATH(s string) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetURL(s string) *SinglePageInfoCreate
- func (spic *SinglePageInfoCreate) SetWidth(i int) *SinglePageInfoCreate
- type SinglePageInfoCreateBulk
- func (spicb *SinglePageInfoCreateBulk) Exec(ctx context.Context) error
- func (spicb *SinglePageInfoCreateBulk) ExecX(ctx context.Context)
- func (spicb *SinglePageInfoCreateBulk) Save(ctx context.Context) ([]*SinglePageInfo, error)
- func (spicb *SinglePageInfoCreateBulk) SaveX(ctx context.Context) []*SinglePageInfo
- type SinglePageInfoDelete
- type SinglePageInfoDeleteOne
- type SinglePageInfoGroupBy
- func (spigb *SinglePageInfoGroupBy) Aggregate(fns ...AggregateFunc) *SinglePageInfoGroupBy
- func (s *SinglePageInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SinglePageInfoGroupBy) BoolX(ctx context.Context) bool
- func (s *SinglePageInfoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SinglePageInfoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SinglePageInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SinglePageInfoGroupBy) Float64X(ctx context.Context) float64
- func (s *SinglePageInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SinglePageInfoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SinglePageInfoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SinglePageInfoGroupBy) IntX(ctx context.Context) int
- func (s *SinglePageInfoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SinglePageInfoGroupBy) IntsX(ctx context.Context) []int
- func (spigb *SinglePageInfoGroupBy) Scan(ctx context.Context, v any) error
- func (s *SinglePageInfoGroupBy) ScanX(ctx context.Context, v any)
- func (s *SinglePageInfoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SinglePageInfoGroupBy) StringX(ctx context.Context) string
- func (s *SinglePageInfoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SinglePageInfoGroupBy) StringsX(ctx context.Context) []string
- type SinglePageInfoMutation
- func (m *SinglePageInfoMutation) AddField(name string, value ent.Value) error
- func (m *SinglePageInfoMutation) AddFileSize(i int64)
- func (m *SinglePageInfoMutation) AddHeight(i int)
- func (m *SinglePageInfoMutation) AddPageNum(i int)
- func (m *SinglePageInfoMutation) AddWidth(i int)
- func (m *SinglePageInfoMutation) AddedEdges() []string
- func (m *SinglePageInfoMutation) AddedField(name string) (ent.Value, bool)
- func (m *SinglePageInfoMutation) AddedFields() []string
- func (m *SinglePageInfoMutation) AddedFileSize() (r int64, exists bool)
- func (m *SinglePageInfoMutation) AddedHeight() (r int, exists bool)
- func (m *SinglePageInfoMutation) AddedIDs(name string) []ent.Value
- func (m *SinglePageInfoMutation) AddedPageNum() (r int, exists bool)
- func (m *SinglePageInfoMutation) AddedWidth() (r int, exists bool)
- func (m *SinglePageInfoMutation) BlurHash() (r string, exists bool)
- func (m *SinglePageInfoMutation) BookID() (r string, exists bool)
- func (m *SinglePageInfoMutation) ClearEdge(name string) error
- func (m *SinglePageInfoMutation) ClearField(name string) error
- func (m *SinglePageInfoMutation) ClearedEdges() []string
- func (m *SinglePageInfoMutation) ClearedFields() []string
- func (m SinglePageInfoMutation) Client() *Client
- func (m *SinglePageInfoMutation) EdgeCleared(name string) bool
- func (m *SinglePageInfoMutation) Field(name string) (ent.Value, bool)
- func (m *SinglePageInfoMutation) FieldCleared(name string) bool
- func (m *SinglePageInfoMutation) Fields() []string
- func (m *SinglePageInfoMutation) FileSize() (r int64, exists bool)
- func (m *SinglePageInfoMutation) Height() (r int, exists bool)
- func (m *SinglePageInfoMutation) ID() (id int, exists bool)
- func (m *SinglePageInfoMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SinglePageInfoMutation) ImgType() (r string, exists bool)
- func (m *SinglePageInfoMutation) ModeTime() (r time.Time, exists bool)
- func (m *SinglePageInfoMutation) NameInArchive() (r string, exists bool)
- func (m *SinglePageInfoMutation) OldBlurHash(ctx context.Context) (v string, err error)
- func (m *SinglePageInfoMutation) OldBookID(ctx context.Context) (v string, err error)
- func (m *SinglePageInfoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SinglePageInfoMutation) OldFileSize(ctx context.Context) (v int64, err error)
- func (m *SinglePageInfoMutation) OldHeight(ctx context.Context) (v int, err error)
- func (m *SinglePageInfoMutation) OldImgType(ctx context.Context) (v string, err error)
- func (m *SinglePageInfoMutation) OldModeTime(ctx context.Context) (v time.Time, err error)
- func (m *SinglePageInfoMutation) OldNameInArchive(ctx context.Context) (v string, err error)
- func (m *SinglePageInfoMutation) OldPageNum(ctx context.Context) (v int, err error)
- func (m *SinglePageInfoMutation) OldRealImageFilePATH(ctx context.Context) (v string, err error)
- func (m *SinglePageInfoMutation) OldURL(ctx context.Context) (v string, err error)
- func (m *SinglePageInfoMutation) OldWidth(ctx context.Context) (v int, err error)
- func (m *SinglePageInfoMutation) Op() Op
- func (m *SinglePageInfoMutation) PageNum() (r int, exists bool)
- func (m *SinglePageInfoMutation) RealImageFilePATH() (r string, exists bool)
- func (m *SinglePageInfoMutation) RemovedEdges() []string
- func (m *SinglePageInfoMutation) RemovedIDs(name string) []ent.Value
- func (m *SinglePageInfoMutation) ResetBlurHash()
- func (m *SinglePageInfoMutation) ResetBookID()
- func (m *SinglePageInfoMutation) ResetEdge(name string) error
- func (m *SinglePageInfoMutation) ResetField(name string) error
- func (m *SinglePageInfoMutation) ResetFileSize()
- func (m *SinglePageInfoMutation) ResetHeight()
- func (m *SinglePageInfoMutation) ResetImgType()
- func (m *SinglePageInfoMutation) ResetModeTime()
- func (m *SinglePageInfoMutation) ResetNameInArchive()
- func (m *SinglePageInfoMutation) ResetPageNum()
- func (m *SinglePageInfoMutation) ResetRealImageFilePATH()
- func (m *SinglePageInfoMutation) ResetURL()
- func (m *SinglePageInfoMutation) ResetWidth()
- func (m *SinglePageInfoMutation) SetBlurHash(s string)
- func (m *SinglePageInfoMutation) SetBookID(s string)
- func (m *SinglePageInfoMutation) SetField(name string, value ent.Value) error
- func (m *SinglePageInfoMutation) SetFileSize(i int64)
- func (m *SinglePageInfoMutation) SetHeight(i int)
- func (m *SinglePageInfoMutation) SetImgType(s string)
- func (m *SinglePageInfoMutation) SetModeTime(t time.Time)
- func (m *SinglePageInfoMutation) SetNameInArchive(s string)
- func (m *SinglePageInfoMutation) SetOp(op Op)
- func (m *SinglePageInfoMutation) SetPageNum(i int)
- func (m *SinglePageInfoMutation) SetRealImageFilePATH(s string)
- func (m *SinglePageInfoMutation) SetURL(s string)
- func (m *SinglePageInfoMutation) SetWidth(i int)
- func (m SinglePageInfoMutation) Tx() (*Tx, error)
- func (m *SinglePageInfoMutation) Type() string
- func (m *SinglePageInfoMutation) URL() (r string, exists bool)
- func (m *SinglePageInfoMutation) Where(ps ...predicate.SinglePageInfo)
- func (m *SinglePageInfoMutation) WhereP(ps ...func(*sql.Selector))
- func (m *SinglePageInfoMutation) Width() (r int, exists bool)
- type SinglePageInfoQuery
- func (spiq *SinglePageInfoQuery) Aggregate(fns ...AggregateFunc) *SinglePageInfoSelect
- func (spiq *SinglePageInfoQuery) All(ctx context.Context) ([]*SinglePageInfo, error)
- func (spiq *SinglePageInfoQuery) AllX(ctx context.Context) []*SinglePageInfo
- func (spiq *SinglePageInfoQuery) Clone() *SinglePageInfoQuery
- func (spiq *SinglePageInfoQuery) Count(ctx context.Context) (int, error)
- func (spiq *SinglePageInfoQuery) CountX(ctx context.Context) int
- func (spiq *SinglePageInfoQuery) Exist(ctx context.Context) (bool, error)
- func (spiq *SinglePageInfoQuery) ExistX(ctx context.Context) bool
- func (spiq *SinglePageInfoQuery) First(ctx context.Context) (*SinglePageInfo, error)
- func (spiq *SinglePageInfoQuery) FirstID(ctx context.Context) (id int, err error)
- func (spiq *SinglePageInfoQuery) FirstIDX(ctx context.Context) int
- func (spiq *SinglePageInfoQuery) FirstX(ctx context.Context) *SinglePageInfo
- func (spiq *SinglePageInfoQuery) GroupBy(field string, fields ...string) *SinglePageInfoGroupBy
- func (spiq *SinglePageInfoQuery) IDs(ctx context.Context) (ids []int, err error)
- func (spiq *SinglePageInfoQuery) IDsX(ctx context.Context) []int
- func (spiq *SinglePageInfoQuery) Limit(limit int) *SinglePageInfoQuery
- func (spiq *SinglePageInfoQuery) Offset(offset int) *SinglePageInfoQuery
- func (spiq *SinglePageInfoQuery) Only(ctx context.Context) (*SinglePageInfo, error)
- func (spiq *SinglePageInfoQuery) OnlyID(ctx context.Context) (id int, err error)
- func (spiq *SinglePageInfoQuery) OnlyIDX(ctx context.Context) int
- func (spiq *SinglePageInfoQuery) OnlyX(ctx context.Context) *SinglePageInfo
- func (spiq *SinglePageInfoQuery) Order(o ...singlepageinfo.OrderOption) *SinglePageInfoQuery
- func (spiq *SinglePageInfoQuery) Select(fields ...string) *SinglePageInfoSelect
- func (spiq *SinglePageInfoQuery) Unique(unique bool) *SinglePageInfoQuery
- func (spiq *SinglePageInfoQuery) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoQuery
- type SinglePageInfoSelect
- func (spis *SinglePageInfoSelect) Aggregate(fns ...AggregateFunc) *SinglePageInfoSelect
- func (s *SinglePageInfoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SinglePageInfoSelect) BoolX(ctx context.Context) bool
- func (s *SinglePageInfoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SinglePageInfoSelect) BoolsX(ctx context.Context) []bool
- func (s *SinglePageInfoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SinglePageInfoSelect) Float64X(ctx context.Context) float64
- func (s *SinglePageInfoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SinglePageInfoSelect) Float64sX(ctx context.Context) []float64
- func (s *SinglePageInfoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SinglePageInfoSelect) IntX(ctx context.Context) int
- func (s *SinglePageInfoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SinglePageInfoSelect) IntsX(ctx context.Context) []int
- func (spis *SinglePageInfoSelect) Scan(ctx context.Context, v any) error
- func (s *SinglePageInfoSelect) ScanX(ctx context.Context, v any)
- func (s *SinglePageInfoSelect) String(ctx context.Context) (_ string, err error)
- func (s *SinglePageInfoSelect) StringX(ctx context.Context) string
- func (s *SinglePageInfoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SinglePageInfoSelect) StringsX(ctx context.Context) []string
- type SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) AddFileSize(i int64) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) AddHeight(i int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) AddPageNum(i int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) AddWidth(i int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) Exec(ctx context.Context) error
- func (spiu *SinglePageInfoUpdate) ExecX(ctx context.Context)
- func (spiu *SinglePageInfoUpdate) Mutation() *SinglePageInfoMutation
- func (spiu *SinglePageInfoUpdate) Save(ctx context.Context) (int, error)
- func (spiu *SinglePageInfoUpdate) SaveX(ctx context.Context) int
- func (spiu *SinglePageInfoUpdate) SetBlurHash(s string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetBookID(s string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetFileSize(i int64) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetHeight(i int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetImgType(s string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetModeTime(t time.Time) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNameInArchive(s string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableBlurHash(s *string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableBookID(s *string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableFileSize(i *int64) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableHeight(i *int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableImgType(s *string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableModeTime(t *time.Time) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableNameInArchive(s *string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillablePageNum(i *int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableRealImageFilePATH(s *string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableURL(s *string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetNillableWidth(i *int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetPageNum(i int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetRealImageFilePATH(s string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetURL(s string) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) SetWidth(i int) *SinglePageInfoUpdate
- func (spiu *SinglePageInfoUpdate) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoUpdate
- type SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) AddFileSize(i int64) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) AddHeight(i int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) AddPageNum(i int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) AddWidth(i int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) Exec(ctx context.Context) error
- func (spiuo *SinglePageInfoUpdateOne) ExecX(ctx context.Context)
- func (spiuo *SinglePageInfoUpdateOne) Mutation() *SinglePageInfoMutation
- func (spiuo *SinglePageInfoUpdateOne) Save(ctx context.Context) (*SinglePageInfo, error)
- func (spiuo *SinglePageInfoUpdateOne) SaveX(ctx context.Context) *SinglePageInfo
- func (spiuo *SinglePageInfoUpdateOne) Select(field string, fields ...string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetBlurHash(s string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetBookID(s string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetFileSize(i int64) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetHeight(i int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetImgType(s string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetModeTime(t time.Time) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNameInArchive(s string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableBlurHash(s *string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableBookID(s *string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableFileSize(i *int64) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableHeight(i *int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableImgType(s *string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableModeTime(t *time.Time) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableNameInArchive(s *string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillablePageNum(i *int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableRealImageFilePATH(s *string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableURL(s *string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetNillableWidth(i *int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetPageNum(i int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetRealImageFilePATH(s string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetURL(s string) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) SetWidth(i int) *SinglePageInfoUpdateOne
- func (spiuo *SinglePageInfoUpdateOne) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoUpdateOne
- type SinglePageInfos
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAge(i int) *UserCreate
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableLastLogin(t *time.Time) *UserCreate
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetUsername(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddAge(i int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddedAge() (r int, exists bool)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) Age() (r int, exists bool)
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) LastLogin() (r time.Time, exists bool)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldLastLogin(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetAge()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetLastLogin()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) SetAge(i int)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetLastLogin(t time.Time)
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetUsername(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Username() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddAge(i int) *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAge(i int) *UserUpdate
- func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableAge(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableLastLogin(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetUsername(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAge(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAge(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableAge(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLastLogin(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- 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. TypeBook = "Book" TypeSinglePageInfo = "SinglePageInfo" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func 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 Book ¶
type Book struct { // ID of the ent. ID int `json:"id,omitempty"` // 书名 Title string `json:"Title,omitempty"` // 书籍ID BookID string `json:"BookID,omitempty"` // 拥有者 Owner string `json:"Owner,omitempty"` // 文件路径 FilePath string `json:"FilePath,omitempty"` // 书库路径 BookStorePath string `json:"BookStorePath,omitempty"` // 书籍类型 Type string `json:"Type,omitempty"` // ChildBookNum holds the value of the "ChildBookNum" field. ChildBookNum int `json:"ChildBookNum,omitempty"` // Depth holds the value of the "Depth" field. Depth int `json:"Depth,omitempty"` // ParentFolder holds the value of the "ParentFolder" field. ParentFolder string `json:"ParentFolder,omitempty"` // 总页数 PageCount int `json:"PageCount,omitempty"` // FileSize holds the value of the "FileSize" field. FileSize int64 `json:"FileSize,omitempty"` // Authors holds the value of the "Authors" field. Authors string `json:"Authors,omitempty"` // ISBN holds the value of the "ISBN" field. ISBN string `json:"ISBN,omitempty"` // Press holds the value of the "Press" field. Press string `json:"Press,omitempty"` // PublishedAt holds the value of the "PublishedAt" field. PublishedAt string `json:"PublishedAt,omitempty"` // ExtractPath holds the value of the "ExtractPath" field. ExtractPath string `json:"ExtractPath,omitempty"` // 创建时间 Modified time.Time `json:"Modified,omitempty"` // ExtractNum holds the value of the "ExtractNum" field. ExtractNum int `json:"ExtractNum,omitempty"` // InitComplete holds the value of the "InitComplete" field. InitComplete bool `json:"InitComplete,omitempty"` // ReadPercent holds the value of the "ReadPercent" field. ReadPercent float64 `json:"ReadPercent,omitempty"` // NonUTF8Zip holds the value of the "NonUTF8Zip" field. NonUTF8Zip bool `json:"NonUTF8Zip,omitempty"` // ZipTextEncoding holds the value of the "ZipTextEncoding" field. ZipTextEncoding string `json:"ZipTextEncoding,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BookQuery when eager-loading is set. Edges BookEdges `json:"edges"` // contains filtered or unexported fields }
Book is the model entity for the Book schema.
func (*Book) QueryPageInfos ¶
func (b *Book) QueryPageInfos() *SinglePageInfoQuery
QueryPageInfos queries the "PageInfos" edge of the Book entity.
func (*Book) Unwrap ¶
Unwrap unwraps the Book 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 (*Book) Update ¶
func (b *Book) Update() *BookUpdateOne
Update returns a builder for updating this Book. Note that you need to call Book.Unwrap() before calling this method if this Book was returned from a transaction, and the transaction was committed or rolled back.
type BookClient ¶
type BookClient struct {
// contains filtered or unexported fields
}
BookClient is a client for the Book schema.
func NewBookClient ¶
func NewBookClient(c config) *BookClient
NewBookClient returns a client for the Book from the given config.
func (*BookClient) Create ¶
func (c *BookClient) Create() *BookCreate
Create returns a builder for creating a Book entity.
func (*BookClient) CreateBulk ¶
func (c *BookClient) CreateBulk(builders ...*BookCreate) *BookCreateBulk
CreateBulk returns a builder for creating a bulk of Book entities.
func (*BookClient) Delete ¶
func (c *BookClient) Delete() *BookDelete
Delete returns a delete builder for Book.
func (*BookClient) DeleteOne ¶
func (c *BookClient) DeleteOne(b *Book) *BookDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BookClient) DeleteOneID ¶
func (c *BookClient) DeleteOneID(id int) *BookDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BookClient) GetX ¶
func (c *BookClient) GetX(ctx context.Context, id int) *Book
GetX is like Get, but panics if an error occurs.
func (*BookClient) Intercept ¶
func (c *BookClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `book.Intercept(f(g(h())))`.
func (*BookClient) Interceptors ¶
func (c *BookClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BookClient) MapCreateBulk ¶
func (c *BookClient) MapCreateBulk(slice any, setFunc func(*BookCreate, int)) *BookCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*BookClient) Query ¶
func (c *BookClient) Query() *BookQuery
Query returns a query builder for Book.
func (*BookClient) QueryPageInfos ¶
func (c *BookClient) QueryPageInfos(b *Book) *SinglePageInfoQuery
QueryPageInfos queries the PageInfos edge of a Book.
func (*BookClient) Update ¶
func (c *BookClient) Update() *BookUpdate
Update returns an update builder for Book.
func (*BookClient) UpdateOne ¶
func (c *BookClient) UpdateOne(b *Book) *BookUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BookClient) UpdateOneID ¶
func (c *BookClient) UpdateOneID(id int) *BookUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BookClient) Use ¶
func (c *BookClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `book.Hooks(f(g(h())))`.
type BookCreate ¶
type BookCreate struct {
// contains filtered or unexported fields
}
BookCreate is the builder for creating a Book entity.
func (*BookCreate) AddPageInfoIDs ¶
func (bc *BookCreate) AddPageInfoIDs(ids ...int) *BookCreate
AddPageInfoIDs adds the "PageInfos" edge to the SinglePageInfo entity by IDs.
func (*BookCreate) AddPageInfos ¶
func (bc *BookCreate) AddPageInfos(s ...*SinglePageInfo) *BookCreate
AddPageInfos adds the "PageInfos" edges to the SinglePageInfo entity.
func (*BookCreate) Exec ¶
func (bc *BookCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BookCreate) ExecX ¶
func (bc *BookCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookCreate) Mutation ¶
func (bc *BookCreate) Mutation() *BookMutation
Mutation returns the BookMutation object of the builder.
func (*BookCreate) Save ¶
func (bc *BookCreate) Save(ctx context.Context) (*Book, error)
Save creates the Book in the database.
func (*BookCreate) SaveX ¶
func (bc *BookCreate) SaveX(ctx context.Context) *Book
SaveX calls Save and panics if Save returns an error.
func (*BookCreate) SetAuthors ¶
func (bc *BookCreate) SetAuthors(s string) *BookCreate
SetAuthors sets the "Authors" field.
func (*BookCreate) SetBookID ¶
func (bc *BookCreate) SetBookID(s string) *BookCreate
SetBookID sets the "BookID" field.
func (*BookCreate) SetBookStorePath ¶
func (bc *BookCreate) SetBookStorePath(s string) *BookCreate
SetBookStorePath sets the "BookStorePath" field.
func (*BookCreate) SetChildBookNum ¶
func (bc *BookCreate) SetChildBookNum(i int) *BookCreate
SetChildBookNum sets the "ChildBookNum" field.
func (*BookCreate) SetDepth ¶
func (bc *BookCreate) SetDepth(i int) *BookCreate
SetDepth sets the "Depth" field.
func (*BookCreate) SetExtractNum ¶
func (bc *BookCreate) SetExtractNum(i int) *BookCreate
SetExtractNum sets the "ExtractNum" field.
func (*BookCreate) SetExtractPath ¶
func (bc *BookCreate) SetExtractPath(s string) *BookCreate
SetExtractPath sets the "ExtractPath" field.
func (*BookCreate) SetFilePath ¶
func (bc *BookCreate) SetFilePath(s string) *BookCreate
SetFilePath sets the "FilePath" field.
func (*BookCreate) SetFileSize ¶
func (bc *BookCreate) SetFileSize(i int64) *BookCreate
SetFileSize sets the "FileSize" field.
func (*BookCreate) SetISBN ¶
func (bc *BookCreate) SetISBN(s string) *BookCreate
SetISBN sets the "ISBN" field.
func (*BookCreate) SetInitComplete ¶
func (bc *BookCreate) SetInitComplete(b bool) *BookCreate
SetInitComplete sets the "InitComplete" field.
func (*BookCreate) SetModified ¶
func (bc *BookCreate) SetModified(t time.Time) *BookCreate
SetModified sets the "Modified" field.
func (*BookCreate) SetNillableModified ¶
func (bc *BookCreate) SetNillableModified(t *time.Time) *BookCreate
SetNillableModified sets the "Modified" field if the given value is not nil.
func (*BookCreate) SetNillableOwner ¶
func (bc *BookCreate) SetNillableOwner(s *string) *BookCreate
SetNillableOwner sets the "Owner" field if the given value is not nil.
func (*BookCreate) SetNonUTF8Zip ¶
func (bc *BookCreate) SetNonUTF8Zip(b bool) *BookCreate
SetNonUTF8Zip sets the "NonUTF8Zip" field.
func (*BookCreate) SetOwner ¶
func (bc *BookCreate) SetOwner(s string) *BookCreate
SetOwner sets the "Owner" field.
func (*BookCreate) SetPageCount ¶
func (bc *BookCreate) SetPageCount(i int) *BookCreate
SetPageCount sets the "PageCount" field.
func (*BookCreate) SetParentFolder ¶
func (bc *BookCreate) SetParentFolder(s string) *BookCreate
SetParentFolder sets the "ParentFolder" field.
func (*BookCreate) SetPress ¶
func (bc *BookCreate) SetPress(s string) *BookCreate
SetPress sets the "Press" field.
func (*BookCreate) SetPublishedAt ¶
func (bc *BookCreate) SetPublishedAt(s string) *BookCreate
SetPublishedAt sets the "PublishedAt" field.
func (*BookCreate) SetReadPercent ¶
func (bc *BookCreate) SetReadPercent(f float64) *BookCreate
SetReadPercent sets the "ReadPercent" field.
func (*BookCreate) SetTitle ¶
func (bc *BookCreate) SetTitle(s string) *BookCreate
SetTitle sets the "Title" field.
func (*BookCreate) SetType ¶
func (bc *BookCreate) SetType(s string) *BookCreate
SetType sets the "Type" field.
func (*BookCreate) SetZipTextEncoding ¶
func (bc *BookCreate) SetZipTextEncoding(s string) *BookCreate
SetZipTextEncoding sets the "ZipTextEncoding" field.
type BookCreateBulk ¶
type BookCreateBulk struct {
// contains filtered or unexported fields
}
BookCreateBulk is the builder for creating many Book entities in bulk.
func (*BookCreateBulk) Exec ¶
func (bcb *BookCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BookCreateBulk) ExecX ¶
func (bcb *BookCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BookDelete ¶
type BookDelete struct {
// contains filtered or unexported fields
}
BookDelete is the builder for deleting a Book entity.
func (*BookDelete) Exec ¶
func (bd *BookDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BookDelete) ExecX ¶
func (bd *BookDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BookDelete) Where ¶
func (bd *BookDelete) Where(ps ...predicate.Book) *BookDelete
Where appends a list predicates to the BookDelete builder.
type BookDeleteOne ¶
type BookDeleteOne struct {
// contains filtered or unexported fields
}
BookDeleteOne is the builder for deleting a single Book entity.
func (*BookDeleteOne) Exec ¶
func (bdo *BookDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BookDeleteOne) ExecX ¶
func (bdo *BookDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookDeleteOne) Where ¶
func (bdo *BookDeleteOne) Where(ps ...predicate.Book) *BookDeleteOne
Where appends a list predicates to the BookDelete builder.
type BookEdges ¶
type BookEdges struct { // PageInfos holds the value of the PageInfos edge. PageInfos []*SinglePageInfo `json:"PageInfos,omitempty"` // contains filtered or unexported fields }
BookEdges holds the relations/edges for other nodes in the graph.
func (BookEdges) PageInfosOrErr ¶
func (e BookEdges) PageInfosOrErr() ([]*SinglePageInfo, error)
PageInfosOrErr returns the PageInfos value or an error if the edge was not loaded in eager-loading.
type BookGroupBy ¶
type BookGroupBy struct {
// contains filtered or unexported fields
}
BookGroupBy is the group-by builder for Book entities.
func (*BookGroupBy) Aggregate ¶
func (bgb *BookGroupBy) Aggregate(fns ...AggregateFunc) *BookGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BookGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Scan ¶
func (bgb *BookGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BookGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BookMutation ¶
type BookMutation struct {
// contains filtered or unexported fields
}
BookMutation represents an operation that mutates the Book nodes in the graph.
func (*BookMutation) AddChildBookNum ¶
func (m *BookMutation) AddChildBookNum(i int)
AddChildBookNum adds i to the "ChildBookNum" field.
func (*BookMutation) AddDepth ¶
func (m *BookMutation) AddDepth(i int)
AddDepth adds i to the "Depth" field.
func (*BookMutation) AddExtractNum ¶
func (m *BookMutation) AddExtractNum(i int)
AddExtractNum adds i to the "ExtractNum" field.
func (*BookMutation) AddField ¶
func (m *BookMutation) 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 (*BookMutation) AddFileSize ¶
func (m *BookMutation) AddFileSize(i int64)
AddFileSize adds i to the "FileSize" field.
func (*BookMutation) AddPageCount ¶
func (m *BookMutation) AddPageCount(i int)
AddPageCount adds i to the "PageCount" field.
func (*BookMutation) AddPageInfoIDs ¶
func (m *BookMutation) AddPageInfoIDs(ids ...int)
AddPageInfoIDs adds the "PageInfos" edge to the SinglePageInfo entity by ids.
func (*BookMutation) AddReadPercent ¶
func (m *BookMutation) AddReadPercent(f float64)
AddReadPercent adds f to the "ReadPercent" field.
func (*BookMutation) AddedChildBookNum ¶
func (m *BookMutation) AddedChildBookNum() (r int, exists bool)
AddedChildBookNum returns the value that was added to the "ChildBookNum" field in this mutation.
func (*BookMutation) AddedDepth ¶
func (m *BookMutation) AddedDepth() (r int, exists bool)
AddedDepth returns the value that was added to the "Depth" field in this mutation.
func (*BookMutation) AddedEdges ¶
func (m *BookMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BookMutation) AddedExtractNum ¶
func (m *BookMutation) AddedExtractNum() (r int, exists bool)
AddedExtractNum returns the value that was added to the "ExtractNum" field in this mutation.
func (*BookMutation) AddedField ¶
func (m *BookMutation) 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 (*BookMutation) AddedFields ¶
func (m *BookMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BookMutation) AddedFileSize ¶
func (m *BookMutation) AddedFileSize() (r int64, exists bool)
AddedFileSize returns the value that was added to the "FileSize" field in this mutation.
func (*BookMutation) AddedIDs ¶
func (m *BookMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BookMutation) AddedPageCount ¶
func (m *BookMutation) AddedPageCount() (r int, exists bool)
AddedPageCount returns the value that was added to the "PageCount" field in this mutation.
func (*BookMutation) AddedReadPercent ¶
func (m *BookMutation) AddedReadPercent() (r float64, exists bool)
AddedReadPercent returns the value that was added to the "ReadPercent" field in this mutation.
func (*BookMutation) Authors ¶
func (m *BookMutation) Authors() (r string, exists bool)
Authors returns the value of the "Authors" field in the mutation.
func (*BookMutation) BookID ¶
func (m *BookMutation) BookID() (r string, exists bool)
BookID returns the value of the "BookID" field in the mutation.
func (*BookMutation) BookStorePath ¶
func (m *BookMutation) BookStorePath() (r string, exists bool)
BookStorePath returns the value of the "BookStorePath" field in the mutation.
func (*BookMutation) ChildBookNum ¶
func (m *BookMutation) ChildBookNum() (r int, exists bool)
ChildBookNum returns the value of the "ChildBookNum" field in the mutation.
func (*BookMutation) ClearEdge ¶
func (m *BookMutation) 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 (*BookMutation) ClearField ¶
func (m *BookMutation) 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 (*BookMutation) ClearPageInfos ¶
func (m *BookMutation) ClearPageInfos()
ClearPageInfos clears the "PageInfos" edge to the SinglePageInfo entity.
func (*BookMutation) ClearedEdges ¶
func (m *BookMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BookMutation) ClearedFields ¶
func (m *BookMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BookMutation) Client ¶
func (m BookMutation) 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 (*BookMutation) Depth ¶
func (m *BookMutation) Depth() (r int, exists bool)
Depth returns the value of the "Depth" field in the mutation.
func (*BookMutation) EdgeCleared ¶
func (m *BookMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BookMutation) ExtractNum ¶
func (m *BookMutation) ExtractNum() (r int, exists bool)
ExtractNum returns the value of the "ExtractNum" field in the mutation.
func (*BookMutation) ExtractPath ¶
func (m *BookMutation) ExtractPath() (r string, exists bool)
ExtractPath returns the value of the "ExtractPath" field in the mutation.
func (*BookMutation) Field ¶
func (m *BookMutation) 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 (*BookMutation) FieldCleared ¶
func (m *BookMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BookMutation) Fields ¶
func (m *BookMutation) 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 (*BookMutation) FilePath ¶
func (m *BookMutation) FilePath() (r string, exists bool)
FilePath returns the value of the "FilePath" field in the mutation.
func (*BookMutation) FileSize ¶
func (m *BookMutation) FileSize() (r int64, exists bool)
FileSize returns the value of the "FileSize" field in the mutation.
func (*BookMutation) GetType ¶
func (m *BookMutation) GetType() (r string, exists bool)
GetType returns the value of the "Type" field in the mutation.
func (*BookMutation) ID ¶
func (m *BookMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*BookMutation) IDs ¶
func (m *BookMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*BookMutation) ISBN ¶
func (m *BookMutation) ISBN() (r string, exists bool)
ISBN returns the value of the "ISBN" field in the mutation.
func (*BookMutation) InitComplete ¶
func (m *BookMutation) InitComplete() (r bool, exists bool)
InitComplete returns the value of the "InitComplete" field in the mutation.
func (*BookMutation) Modified ¶
func (m *BookMutation) Modified() (r time.Time, exists bool)
Modified returns the value of the "Modified" field in the mutation.
func (*BookMutation) NonUTF8Zip ¶
func (m *BookMutation) NonUTF8Zip() (r bool, exists bool)
NonUTF8Zip returns the value of the "NonUTF8Zip" field in the mutation.
func (*BookMutation) OldAuthors ¶
func (m *BookMutation) OldAuthors(ctx context.Context) (v string, err error)
OldAuthors returns the old "Authors" field's value of the Book entity. If the Book 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 (*BookMutation) OldBookID ¶
func (m *BookMutation) OldBookID(ctx context.Context) (v string, err error)
OldBookID returns the old "BookID" field's value of the Book entity. If the Book 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 (*BookMutation) OldBookStorePath ¶
func (m *BookMutation) OldBookStorePath(ctx context.Context) (v string, err error)
OldBookStorePath returns the old "BookStorePath" field's value of the Book entity. If the Book 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 (*BookMutation) OldChildBookNum ¶
func (m *BookMutation) OldChildBookNum(ctx context.Context) (v int, err error)
OldChildBookNum returns the old "ChildBookNum" field's value of the Book entity. If the Book 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 (*BookMutation) OldDepth ¶
func (m *BookMutation) OldDepth(ctx context.Context) (v int, err error)
OldDepth returns the old "Depth" field's value of the Book entity. If the Book 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 (*BookMutation) OldExtractNum ¶
func (m *BookMutation) OldExtractNum(ctx context.Context) (v int, err error)
OldExtractNum returns the old "ExtractNum" field's value of the Book entity. If the Book 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 (*BookMutation) OldExtractPath ¶
func (m *BookMutation) OldExtractPath(ctx context.Context) (v string, err error)
OldExtractPath returns the old "ExtractPath" field's value of the Book entity. If the Book 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 (*BookMutation) 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 (*BookMutation) OldFilePath ¶
func (m *BookMutation) OldFilePath(ctx context.Context) (v string, err error)
OldFilePath returns the old "FilePath" field's value of the Book entity. If the Book 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 (*BookMutation) OldFileSize ¶
func (m *BookMutation) OldFileSize(ctx context.Context) (v int64, err error)
OldFileSize returns the old "FileSize" field's value of the Book entity. If the Book 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 (*BookMutation) OldISBN ¶
func (m *BookMutation) OldISBN(ctx context.Context) (v string, err error)
OldISBN returns the old "ISBN" field's value of the Book entity. If the Book 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 (*BookMutation) OldInitComplete ¶
func (m *BookMutation) OldInitComplete(ctx context.Context) (v bool, err error)
OldInitComplete returns the old "InitComplete" field's value of the Book entity. If the Book 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 (*BookMutation) OldModified ¶
OldModified returns the old "Modified" field's value of the Book entity. If the Book 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 (*BookMutation) OldNonUTF8Zip ¶
func (m *BookMutation) OldNonUTF8Zip(ctx context.Context) (v bool, err error)
OldNonUTF8Zip returns the old "NonUTF8Zip" field's value of the Book entity. If the Book 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 (*BookMutation) OldOwner ¶
func (m *BookMutation) OldOwner(ctx context.Context) (v string, err error)
OldOwner returns the old "Owner" field's value of the Book entity. If the Book 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 (*BookMutation) OldPageCount ¶
func (m *BookMutation) OldPageCount(ctx context.Context) (v int, err error)
OldPageCount returns the old "PageCount" field's value of the Book entity. If the Book 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 (*BookMutation) OldParentFolder ¶
func (m *BookMutation) OldParentFolder(ctx context.Context) (v string, err error)
OldParentFolder returns the old "ParentFolder" field's value of the Book entity. If the Book 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 (*BookMutation) OldPress ¶
func (m *BookMutation) OldPress(ctx context.Context) (v string, err error)
OldPress returns the old "Press" field's value of the Book entity. If the Book 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 (*BookMutation) OldPublishedAt ¶
func (m *BookMutation) OldPublishedAt(ctx context.Context) (v string, err error)
OldPublishedAt returns the old "PublishedAt" field's value of the Book entity. If the Book 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 (*BookMutation) OldReadPercent ¶
func (m *BookMutation) OldReadPercent(ctx context.Context) (v float64, err error)
OldReadPercent returns the old "ReadPercent" field's value of the Book entity. If the Book 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 (*BookMutation) OldTitle ¶
func (m *BookMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "Title" field's value of the Book entity. If the Book 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 (*BookMutation) OldType ¶
func (m *BookMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "Type" field's value of the Book entity. If the Book 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 (*BookMutation) OldZipTextEncoding ¶
func (m *BookMutation) OldZipTextEncoding(ctx context.Context) (v string, err error)
OldZipTextEncoding returns the old "ZipTextEncoding" field's value of the Book entity. If the Book 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 (*BookMutation) Owner ¶
func (m *BookMutation) Owner() (r string, exists bool)
Owner returns the value of the "Owner" field in the mutation.
func (*BookMutation) PageCount ¶
func (m *BookMutation) PageCount() (r int, exists bool)
PageCount returns the value of the "PageCount" field in the mutation.
func (*BookMutation) PageInfosCleared ¶
func (m *BookMutation) PageInfosCleared() bool
PageInfosCleared reports if the "PageInfos" edge to the SinglePageInfo entity was cleared.
func (*BookMutation) PageInfosIDs ¶
func (m *BookMutation) PageInfosIDs() (ids []int)
PageInfosIDs returns the "PageInfos" edge IDs in the mutation.
func (*BookMutation) ParentFolder ¶
func (m *BookMutation) ParentFolder() (r string, exists bool)
ParentFolder returns the value of the "ParentFolder" field in the mutation.
func (*BookMutation) Press ¶
func (m *BookMutation) Press() (r string, exists bool)
Press returns the value of the "Press" field in the mutation.
func (*BookMutation) PublishedAt ¶
func (m *BookMutation) PublishedAt() (r string, exists bool)
PublishedAt returns the value of the "PublishedAt" field in the mutation.
func (*BookMutation) ReadPercent ¶
func (m *BookMutation) ReadPercent() (r float64, exists bool)
ReadPercent returns the value of the "ReadPercent" field in the mutation.
func (*BookMutation) RemovePageInfoIDs ¶
func (m *BookMutation) RemovePageInfoIDs(ids ...int)
RemovePageInfoIDs removes the "PageInfos" edge to the SinglePageInfo entity by IDs.
func (*BookMutation) RemovedEdges ¶
func (m *BookMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BookMutation) RemovedIDs ¶
func (m *BookMutation) 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 (*BookMutation) RemovedPageInfosIDs ¶
func (m *BookMutation) RemovedPageInfosIDs() (ids []int)
RemovedPageInfos returns the removed IDs of the "PageInfos" edge to the SinglePageInfo entity.
func (*BookMutation) ResetAuthors ¶
func (m *BookMutation) ResetAuthors()
ResetAuthors resets all changes to the "Authors" field.
func (*BookMutation) ResetBookID ¶
func (m *BookMutation) ResetBookID()
ResetBookID resets all changes to the "BookID" field.
func (*BookMutation) ResetBookStorePath ¶
func (m *BookMutation) ResetBookStorePath()
ResetBookStorePath resets all changes to the "BookStorePath" field.
func (*BookMutation) ResetChildBookNum ¶
func (m *BookMutation) ResetChildBookNum()
ResetChildBookNum resets all changes to the "ChildBookNum" field.
func (*BookMutation) ResetDepth ¶
func (m *BookMutation) ResetDepth()
ResetDepth resets all changes to the "Depth" field.
func (*BookMutation) ResetEdge ¶
func (m *BookMutation) 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 (*BookMutation) ResetExtractNum ¶
func (m *BookMutation) ResetExtractNum()
ResetExtractNum resets all changes to the "ExtractNum" field.
func (*BookMutation) ResetExtractPath ¶
func (m *BookMutation) ResetExtractPath()
ResetExtractPath resets all changes to the "ExtractPath" field.
func (*BookMutation) ResetField ¶
func (m *BookMutation) 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 (*BookMutation) ResetFilePath ¶
func (m *BookMutation) ResetFilePath()
ResetFilePath resets all changes to the "FilePath" field.
func (*BookMutation) ResetFileSize ¶
func (m *BookMutation) ResetFileSize()
ResetFileSize resets all changes to the "FileSize" field.
func (*BookMutation) ResetISBN ¶
func (m *BookMutation) ResetISBN()
ResetISBN resets all changes to the "ISBN" field.
func (*BookMutation) ResetInitComplete ¶
func (m *BookMutation) ResetInitComplete()
ResetInitComplete resets all changes to the "InitComplete" field.
func (*BookMutation) ResetModified ¶
func (m *BookMutation) ResetModified()
ResetModified resets all changes to the "Modified" field.
func (*BookMutation) ResetNonUTF8Zip ¶
func (m *BookMutation) ResetNonUTF8Zip()
ResetNonUTF8Zip resets all changes to the "NonUTF8Zip" field.
func (*BookMutation) ResetOwner ¶
func (m *BookMutation) ResetOwner()
ResetOwner resets all changes to the "Owner" field.
func (*BookMutation) ResetPageCount ¶
func (m *BookMutation) ResetPageCount()
ResetPageCount resets all changes to the "PageCount" field.
func (*BookMutation) ResetPageInfos ¶
func (m *BookMutation) ResetPageInfos()
ResetPageInfos resets all changes to the "PageInfos" edge.
func (*BookMutation) ResetParentFolder ¶
func (m *BookMutation) ResetParentFolder()
ResetParentFolder resets all changes to the "ParentFolder" field.
func (*BookMutation) ResetPress ¶
func (m *BookMutation) ResetPress()
ResetPress resets all changes to the "Press" field.
func (*BookMutation) ResetPublishedAt ¶
func (m *BookMutation) ResetPublishedAt()
ResetPublishedAt resets all changes to the "PublishedAt" field.
func (*BookMutation) ResetReadPercent ¶
func (m *BookMutation) ResetReadPercent()
ResetReadPercent resets all changes to the "ReadPercent" field.
func (*BookMutation) ResetTitle ¶
func (m *BookMutation) ResetTitle()
ResetTitle resets all changes to the "Title" field.
func (*BookMutation) ResetType ¶
func (m *BookMutation) ResetType()
ResetType resets all changes to the "Type" field.
func (*BookMutation) ResetZipTextEncoding ¶
func (m *BookMutation) ResetZipTextEncoding()
ResetZipTextEncoding resets all changes to the "ZipTextEncoding" field.
func (*BookMutation) SetAuthors ¶
func (m *BookMutation) SetAuthors(s string)
SetAuthors sets the "Authors" field.
func (*BookMutation) SetBookID ¶
func (m *BookMutation) SetBookID(s string)
SetBookID sets the "BookID" field.
func (*BookMutation) SetBookStorePath ¶
func (m *BookMutation) SetBookStorePath(s string)
SetBookStorePath sets the "BookStorePath" field.
func (*BookMutation) SetChildBookNum ¶
func (m *BookMutation) SetChildBookNum(i int)
SetChildBookNum sets the "ChildBookNum" field.
func (*BookMutation) SetDepth ¶
func (m *BookMutation) SetDepth(i int)
SetDepth sets the "Depth" field.
func (*BookMutation) SetExtractNum ¶
func (m *BookMutation) SetExtractNum(i int)
SetExtractNum sets the "ExtractNum" field.
func (*BookMutation) SetExtractPath ¶
func (m *BookMutation) SetExtractPath(s string)
SetExtractPath sets the "ExtractPath" field.
func (*BookMutation) SetField ¶
func (m *BookMutation) 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 (*BookMutation) SetFilePath ¶
func (m *BookMutation) SetFilePath(s string)
SetFilePath sets the "FilePath" field.
func (*BookMutation) SetFileSize ¶
func (m *BookMutation) SetFileSize(i int64)
SetFileSize sets the "FileSize" field.
func (*BookMutation) SetISBN ¶
func (m *BookMutation) SetISBN(s string)
SetISBN sets the "ISBN" field.
func (*BookMutation) SetInitComplete ¶
func (m *BookMutation) SetInitComplete(b bool)
SetInitComplete sets the "InitComplete" field.
func (*BookMutation) SetModified ¶
func (m *BookMutation) SetModified(t time.Time)
SetModified sets the "Modified" field.
func (*BookMutation) SetNonUTF8Zip ¶
func (m *BookMutation) SetNonUTF8Zip(b bool)
SetNonUTF8Zip sets the "NonUTF8Zip" field.
func (*BookMutation) SetOp ¶
func (m *BookMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BookMutation) SetOwner ¶
func (m *BookMutation) SetOwner(s string)
SetOwner sets the "Owner" field.
func (*BookMutation) SetPageCount ¶
func (m *BookMutation) SetPageCount(i int)
SetPageCount sets the "PageCount" field.
func (*BookMutation) SetParentFolder ¶
func (m *BookMutation) SetParentFolder(s string)
SetParentFolder sets the "ParentFolder" field.
func (*BookMutation) SetPress ¶
func (m *BookMutation) SetPress(s string)
SetPress sets the "Press" field.
func (*BookMutation) SetPublishedAt ¶
func (m *BookMutation) SetPublishedAt(s string)
SetPublishedAt sets the "PublishedAt" field.
func (*BookMutation) SetReadPercent ¶
func (m *BookMutation) SetReadPercent(f float64)
SetReadPercent sets the "ReadPercent" field.
func (*BookMutation) SetTitle ¶
func (m *BookMutation) SetTitle(s string)
SetTitle sets the "Title" field.
func (*BookMutation) SetType ¶
func (m *BookMutation) SetType(s string)
SetType sets the "Type" field.
func (*BookMutation) SetZipTextEncoding ¶
func (m *BookMutation) SetZipTextEncoding(s string)
SetZipTextEncoding sets the "ZipTextEncoding" field.
func (*BookMutation) Title ¶
func (m *BookMutation) Title() (r string, exists bool)
Title returns the value of the "Title" field in the mutation.
func (BookMutation) Tx ¶
func (m BookMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BookMutation) Type ¶
func (m *BookMutation) Type() string
Type returns the node type of this mutation (Book).
func (*BookMutation) Where ¶
func (m *BookMutation) Where(ps ...predicate.Book)
Where appends a list predicates to the BookMutation builder.
func (*BookMutation) WhereP ¶
func (m *BookMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BookMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
func (*BookMutation) ZipTextEncoding ¶
func (m *BookMutation) ZipTextEncoding() (r string, exists bool)
ZipTextEncoding returns the value of the "ZipTextEncoding" field in the mutation.
type BookQuery ¶
type BookQuery struct {
// contains filtered or unexported fields
}
BookQuery is the builder for querying Book entities.
func (*BookQuery) Aggregate ¶
func (bq *BookQuery) Aggregate(fns ...AggregateFunc) *BookSelect
Aggregate returns a BookSelect configured with the given aggregations.
func (*BookQuery) Clone ¶
Clone returns a duplicate of the BookQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BookQuery) First ¶
First returns the first Book entity from the query. Returns a *NotFoundError when no Book was found.
func (*BookQuery) FirstID ¶
FirstID returns the first Book ID from the query. Returns a *NotFoundError when no Book ID was found.
func (*BookQuery) GroupBy ¶
func (bq *BookQuery) GroupBy(field string, fields ...string) *BookGroupBy
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 { Title string `json:"Title,omitempty"` Count int `json:"count,omitempty"` } client.Book.Query(). GroupBy(book.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BookQuery) Only ¶
Only returns a single Book entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Book entity is found. Returns a *NotFoundError when no Book entities are found.
func (*BookQuery) OnlyID ¶
OnlyID is like Only, but returns the only Book ID in the query. Returns a *NotSingularError when more than one Book ID is found. Returns a *NotFoundError when no entities are found.
func (*BookQuery) Order ¶
func (bq *BookQuery) Order(o ...book.OrderOption) *BookQuery
Order specifies how the records should be ordered.
func (*BookQuery) QueryPageInfos ¶
func (bq *BookQuery) QueryPageInfos() *SinglePageInfoQuery
QueryPageInfos chains the current query on the "PageInfos" edge.
func (*BookQuery) Select ¶
func (bq *BookQuery) Select(fields ...string) *BookSelect
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 { Title string `json:"Title,omitempty"` } client.Book.Query(). Select(book.FieldTitle). Scan(ctx, &v)
func (*BookQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*BookQuery) WithPageInfos ¶
func (bq *BookQuery) WithPageInfos(opts ...func(*SinglePageInfoQuery)) *BookQuery
WithPageInfos tells the query-builder to eager-load the nodes that are connected to the "PageInfos" edge. The optional arguments are used to configure the query builder of the edge.
type BookSelect ¶
type BookSelect struct { *BookQuery // contains filtered or unexported fields }
BookSelect is the builder for selecting fields of Book entities.
func (*BookSelect) Aggregate ¶
func (bs *BookSelect) Aggregate(fns ...AggregateFunc) *BookSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BookSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BookSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BookSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BookSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BookSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BookSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BookSelect) Scan ¶
func (bs *BookSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BookSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BookUpdate ¶
type BookUpdate struct {
// contains filtered or unexported fields
}
BookUpdate is the builder for updating Book entities.
func (*BookUpdate) AddChildBookNum ¶
func (bu *BookUpdate) AddChildBookNum(i int) *BookUpdate
AddChildBookNum adds i to the "ChildBookNum" field.
func (*BookUpdate) AddDepth ¶
func (bu *BookUpdate) AddDepth(i int) *BookUpdate
AddDepth adds i to the "Depth" field.
func (*BookUpdate) AddExtractNum ¶
func (bu *BookUpdate) AddExtractNum(i int) *BookUpdate
AddExtractNum adds i to the "ExtractNum" field.
func (*BookUpdate) AddFileSize ¶
func (bu *BookUpdate) AddFileSize(i int64) *BookUpdate
AddFileSize adds i to the "FileSize" field.
func (*BookUpdate) AddPageCount ¶
func (bu *BookUpdate) AddPageCount(i int) *BookUpdate
AddPageCount adds i to the "PageCount" field.
func (*BookUpdate) AddPageInfoIDs ¶
func (bu *BookUpdate) AddPageInfoIDs(ids ...int) *BookUpdate
AddPageInfoIDs adds the "PageInfos" edge to the SinglePageInfo entity by IDs.
func (*BookUpdate) AddPageInfos ¶
func (bu *BookUpdate) AddPageInfos(s ...*SinglePageInfo) *BookUpdate
AddPageInfos adds the "PageInfos" edges to the SinglePageInfo entity.
func (*BookUpdate) AddReadPercent ¶
func (bu *BookUpdate) AddReadPercent(f float64) *BookUpdate
AddReadPercent adds f to the "ReadPercent" field.
func (*BookUpdate) ClearPageInfos ¶
func (bu *BookUpdate) ClearPageInfos() *BookUpdate
ClearPageInfos clears all "PageInfos" edges to the SinglePageInfo entity.
func (*BookUpdate) Exec ¶
func (bu *BookUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BookUpdate) ExecX ¶
func (bu *BookUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookUpdate) Mutation ¶
func (bu *BookUpdate) Mutation() *BookMutation
Mutation returns the BookMutation object of the builder.
func (*BookUpdate) RemovePageInfoIDs ¶
func (bu *BookUpdate) RemovePageInfoIDs(ids ...int) *BookUpdate
RemovePageInfoIDs removes the "PageInfos" edge to SinglePageInfo entities by IDs.
func (*BookUpdate) RemovePageInfos ¶
func (bu *BookUpdate) RemovePageInfos(s ...*SinglePageInfo) *BookUpdate
RemovePageInfos removes "PageInfos" edges to SinglePageInfo entities.
func (*BookUpdate) Save ¶
func (bu *BookUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BookUpdate) SaveX ¶
func (bu *BookUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BookUpdate) SetAuthors ¶
func (bu *BookUpdate) SetAuthors(s string) *BookUpdate
SetAuthors sets the "Authors" field.
func (*BookUpdate) SetBookID ¶
func (bu *BookUpdate) SetBookID(s string) *BookUpdate
SetBookID sets the "BookID" field.
func (*BookUpdate) SetBookStorePath ¶
func (bu *BookUpdate) SetBookStorePath(s string) *BookUpdate
SetBookStorePath sets the "BookStorePath" field.
func (*BookUpdate) SetChildBookNum ¶
func (bu *BookUpdate) SetChildBookNum(i int) *BookUpdate
SetChildBookNum sets the "ChildBookNum" field.
func (*BookUpdate) SetDepth ¶
func (bu *BookUpdate) SetDepth(i int) *BookUpdate
SetDepth sets the "Depth" field.
func (*BookUpdate) SetExtractNum ¶
func (bu *BookUpdate) SetExtractNum(i int) *BookUpdate
SetExtractNum sets the "ExtractNum" field.
func (*BookUpdate) SetExtractPath ¶
func (bu *BookUpdate) SetExtractPath(s string) *BookUpdate
SetExtractPath sets the "ExtractPath" field.
func (*BookUpdate) SetFilePath ¶
func (bu *BookUpdate) SetFilePath(s string) *BookUpdate
SetFilePath sets the "FilePath" field.
func (*BookUpdate) SetFileSize ¶
func (bu *BookUpdate) SetFileSize(i int64) *BookUpdate
SetFileSize sets the "FileSize" field.
func (*BookUpdate) SetISBN ¶
func (bu *BookUpdate) SetISBN(s string) *BookUpdate
SetISBN sets the "ISBN" field.
func (*BookUpdate) SetInitComplete ¶
func (bu *BookUpdate) SetInitComplete(b bool) *BookUpdate
SetInitComplete sets the "InitComplete" field.
func (*BookUpdate) SetModified ¶
func (bu *BookUpdate) SetModified(t time.Time) *BookUpdate
SetModified sets the "Modified" field.
func (*BookUpdate) SetNillableAuthors ¶
func (bu *BookUpdate) SetNillableAuthors(s *string) *BookUpdate
SetNillableAuthors sets the "Authors" field if the given value is not nil.
func (*BookUpdate) SetNillableBookID ¶
func (bu *BookUpdate) SetNillableBookID(s *string) *BookUpdate
SetNillableBookID sets the "BookID" field if the given value is not nil.
func (*BookUpdate) SetNillableBookStorePath ¶
func (bu *BookUpdate) SetNillableBookStorePath(s *string) *BookUpdate
SetNillableBookStorePath sets the "BookStorePath" field if the given value is not nil.
func (*BookUpdate) SetNillableChildBookNum ¶
func (bu *BookUpdate) SetNillableChildBookNum(i *int) *BookUpdate
SetNillableChildBookNum sets the "ChildBookNum" field if the given value is not nil.
func (*BookUpdate) SetNillableDepth ¶
func (bu *BookUpdate) SetNillableDepth(i *int) *BookUpdate
SetNillableDepth sets the "Depth" field if the given value is not nil.
func (*BookUpdate) SetNillableExtractNum ¶
func (bu *BookUpdate) SetNillableExtractNum(i *int) *BookUpdate
SetNillableExtractNum sets the "ExtractNum" field if the given value is not nil.
func (*BookUpdate) SetNillableExtractPath ¶
func (bu *BookUpdate) SetNillableExtractPath(s *string) *BookUpdate
SetNillableExtractPath sets the "ExtractPath" field if the given value is not nil.
func (*BookUpdate) SetNillableFilePath ¶
func (bu *BookUpdate) SetNillableFilePath(s *string) *BookUpdate
SetNillableFilePath sets the "FilePath" field if the given value is not nil.
func (*BookUpdate) SetNillableFileSize ¶
func (bu *BookUpdate) SetNillableFileSize(i *int64) *BookUpdate
SetNillableFileSize sets the "FileSize" field if the given value is not nil.
func (*BookUpdate) SetNillableISBN ¶
func (bu *BookUpdate) SetNillableISBN(s *string) *BookUpdate
SetNillableISBN sets the "ISBN" field if the given value is not nil.
func (*BookUpdate) SetNillableInitComplete ¶
func (bu *BookUpdate) SetNillableInitComplete(b *bool) *BookUpdate
SetNillableInitComplete sets the "InitComplete" field if the given value is not nil.
func (*BookUpdate) SetNillableModified ¶
func (bu *BookUpdate) SetNillableModified(t *time.Time) *BookUpdate
SetNillableModified sets the "Modified" field if the given value is not nil.
func (*BookUpdate) SetNillableNonUTF8Zip ¶
func (bu *BookUpdate) SetNillableNonUTF8Zip(b *bool) *BookUpdate
SetNillableNonUTF8Zip sets the "NonUTF8Zip" field if the given value is not nil.
func (*BookUpdate) SetNillableOwner ¶
func (bu *BookUpdate) SetNillableOwner(s *string) *BookUpdate
SetNillableOwner sets the "Owner" field if the given value is not nil.
func (*BookUpdate) SetNillablePageCount ¶
func (bu *BookUpdate) SetNillablePageCount(i *int) *BookUpdate
SetNillablePageCount sets the "PageCount" field if the given value is not nil.
func (*BookUpdate) SetNillableParentFolder ¶
func (bu *BookUpdate) SetNillableParentFolder(s *string) *BookUpdate
SetNillableParentFolder sets the "ParentFolder" field if the given value is not nil.
func (*BookUpdate) SetNillablePress ¶
func (bu *BookUpdate) SetNillablePress(s *string) *BookUpdate
SetNillablePress sets the "Press" field if the given value is not nil.
func (*BookUpdate) SetNillablePublishedAt ¶
func (bu *BookUpdate) SetNillablePublishedAt(s *string) *BookUpdate
SetNillablePublishedAt sets the "PublishedAt" field if the given value is not nil.
func (*BookUpdate) SetNillableReadPercent ¶
func (bu *BookUpdate) SetNillableReadPercent(f *float64) *BookUpdate
SetNillableReadPercent sets the "ReadPercent" field if the given value is not nil.
func (*BookUpdate) SetNillableTitle ¶
func (bu *BookUpdate) SetNillableTitle(s *string) *BookUpdate
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*BookUpdate) SetNillableType ¶
func (bu *BookUpdate) SetNillableType(s *string) *BookUpdate
SetNillableType sets the "Type" field if the given value is not nil.
func (*BookUpdate) SetNillableZipTextEncoding ¶
func (bu *BookUpdate) SetNillableZipTextEncoding(s *string) *BookUpdate
SetNillableZipTextEncoding sets the "ZipTextEncoding" field if the given value is not nil.
func (*BookUpdate) SetNonUTF8Zip ¶
func (bu *BookUpdate) SetNonUTF8Zip(b bool) *BookUpdate
SetNonUTF8Zip sets the "NonUTF8Zip" field.
func (*BookUpdate) SetOwner ¶
func (bu *BookUpdate) SetOwner(s string) *BookUpdate
SetOwner sets the "Owner" field.
func (*BookUpdate) SetPageCount ¶
func (bu *BookUpdate) SetPageCount(i int) *BookUpdate
SetPageCount sets the "PageCount" field.
func (*BookUpdate) SetParentFolder ¶
func (bu *BookUpdate) SetParentFolder(s string) *BookUpdate
SetParentFolder sets the "ParentFolder" field.
func (*BookUpdate) SetPress ¶
func (bu *BookUpdate) SetPress(s string) *BookUpdate
SetPress sets the "Press" field.
func (*BookUpdate) SetPublishedAt ¶
func (bu *BookUpdate) SetPublishedAt(s string) *BookUpdate
SetPublishedAt sets the "PublishedAt" field.
func (*BookUpdate) SetReadPercent ¶
func (bu *BookUpdate) SetReadPercent(f float64) *BookUpdate
SetReadPercent sets the "ReadPercent" field.
func (*BookUpdate) SetTitle ¶
func (bu *BookUpdate) SetTitle(s string) *BookUpdate
SetTitle sets the "Title" field.
func (*BookUpdate) SetType ¶
func (bu *BookUpdate) SetType(s string) *BookUpdate
SetType sets the "Type" field.
func (*BookUpdate) SetZipTextEncoding ¶
func (bu *BookUpdate) SetZipTextEncoding(s string) *BookUpdate
SetZipTextEncoding sets the "ZipTextEncoding" field.
func (*BookUpdate) Where ¶
func (bu *BookUpdate) Where(ps ...predicate.Book) *BookUpdate
Where appends a list predicates to the BookUpdate builder.
type BookUpdateOne ¶
type BookUpdateOne struct {
// contains filtered or unexported fields
}
BookUpdateOne is the builder for updating a single Book entity.
func (*BookUpdateOne) AddChildBookNum ¶
func (buo *BookUpdateOne) AddChildBookNum(i int) *BookUpdateOne
AddChildBookNum adds i to the "ChildBookNum" field.
func (*BookUpdateOne) AddDepth ¶
func (buo *BookUpdateOne) AddDepth(i int) *BookUpdateOne
AddDepth adds i to the "Depth" field.
func (*BookUpdateOne) AddExtractNum ¶
func (buo *BookUpdateOne) AddExtractNum(i int) *BookUpdateOne
AddExtractNum adds i to the "ExtractNum" field.
func (*BookUpdateOne) AddFileSize ¶
func (buo *BookUpdateOne) AddFileSize(i int64) *BookUpdateOne
AddFileSize adds i to the "FileSize" field.
func (*BookUpdateOne) AddPageCount ¶
func (buo *BookUpdateOne) AddPageCount(i int) *BookUpdateOne
AddPageCount adds i to the "PageCount" field.
func (*BookUpdateOne) AddPageInfoIDs ¶
func (buo *BookUpdateOne) AddPageInfoIDs(ids ...int) *BookUpdateOne
AddPageInfoIDs adds the "PageInfos" edge to the SinglePageInfo entity by IDs.
func (*BookUpdateOne) AddPageInfos ¶
func (buo *BookUpdateOne) AddPageInfos(s ...*SinglePageInfo) *BookUpdateOne
AddPageInfos adds the "PageInfos" edges to the SinglePageInfo entity.
func (*BookUpdateOne) AddReadPercent ¶
func (buo *BookUpdateOne) AddReadPercent(f float64) *BookUpdateOne
AddReadPercent adds f to the "ReadPercent" field.
func (*BookUpdateOne) ClearPageInfos ¶
func (buo *BookUpdateOne) ClearPageInfos() *BookUpdateOne
ClearPageInfos clears all "PageInfos" edges to the SinglePageInfo entity.
func (*BookUpdateOne) Exec ¶
func (buo *BookUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BookUpdateOne) ExecX ¶
func (buo *BookUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookUpdateOne) Mutation ¶
func (buo *BookUpdateOne) Mutation() *BookMutation
Mutation returns the BookMutation object of the builder.
func (*BookUpdateOne) RemovePageInfoIDs ¶
func (buo *BookUpdateOne) RemovePageInfoIDs(ids ...int) *BookUpdateOne
RemovePageInfoIDs removes the "PageInfos" edge to SinglePageInfo entities by IDs.
func (*BookUpdateOne) RemovePageInfos ¶
func (buo *BookUpdateOne) RemovePageInfos(s ...*SinglePageInfo) *BookUpdateOne
RemovePageInfos removes "PageInfos" edges to SinglePageInfo entities.
func (*BookUpdateOne) Save ¶
func (buo *BookUpdateOne) Save(ctx context.Context) (*Book, error)
Save executes the query and returns the updated Book entity.
func (*BookUpdateOne) SaveX ¶
func (buo *BookUpdateOne) SaveX(ctx context.Context) *Book
SaveX is like Save, but panics if an error occurs.
func (*BookUpdateOne) Select ¶
func (buo *BookUpdateOne) Select(field string, fields ...string) *BookUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BookUpdateOne) SetAuthors ¶
func (buo *BookUpdateOne) SetAuthors(s string) *BookUpdateOne
SetAuthors sets the "Authors" field.
func (*BookUpdateOne) SetBookID ¶
func (buo *BookUpdateOne) SetBookID(s string) *BookUpdateOne
SetBookID sets the "BookID" field.
func (*BookUpdateOne) SetBookStorePath ¶
func (buo *BookUpdateOne) SetBookStorePath(s string) *BookUpdateOne
SetBookStorePath sets the "BookStorePath" field.
func (*BookUpdateOne) SetChildBookNum ¶
func (buo *BookUpdateOne) SetChildBookNum(i int) *BookUpdateOne
SetChildBookNum sets the "ChildBookNum" field.
func (*BookUpdateOne) SetDepth ¶
func (buo *BookUpdateOne) SetDepth(i int) *BookUpdateOne
SetDepth sets the "Depth" field.
func (*BookUpdateOne) SetExtractNum ¶
func (buo *BookUpdateOne) SetExtractNum(i int) *BookUpdateOne
SetExtractNum sets the "ExtractNum" field.
func (*BookUpdateOne) SetExtractPath ¶
func (buo *BookUpdateOne) SetExtractPath(s string) *BookUpdateOne
SetExtractPath sets the "ExtractPath" field.
func (*BookUpdateOne) SetFilePath ¶
func (buo *BookUpdateOne) SetFilePath(s string) *BookUpdateOne
SetFilePath sets the "FilePath" field.
func (*BookUpdateOne) SetFileSize ¶
func (buo *BookUpdateOne) SetFileSize(i int64) *BookUpdateOne
SetFileSize sets the "FileSize" field.
func (*BookUpdateOne) SetISBN ¶
func (buo *BookUpdateOne) SetISBN(s string) *BookUpdateOne
SetISBN sets the "ISBN" field.
func (*BookUpdateOne) SetInitComplete ¶
func (buo *BookUpdateOne) SetInitComplete(b bool) *BookUpdateOne
SetInitComplete sets the "InitComplete" field.
func (*BookUpdateOne) SetModified ¶
func (buo *BookUpdateOne) SetModified(t time.Time) *BookUpdateOne
SetModified sets the "Modified" field.
func (*BookUpdateOne) SetNillableAuthors ¶
func (buo *BookUpdateOne) SetNillableAuthors(s *string) *BookUpdateOne
SetNillableAuthors sets the "Authors" field if the given value is not nil.
func (*BookUpdateOne) SetNillableBookID ¶
func (buo *BookUpdateOne) SetNillableBookID(s *string) *BookUpdateOne
SetNillableBookID sets the "BookID" field if the given value is not nil.
func (*BookUpdateOne) SetNillableBookStorePath ¶
func (buo *BookUpdateOne) SetNillableBookStorePath(s *string) *BookUpdateOne
SetNillableBookStorePath sets the "BookStorePath" field if the given value is not nil.
func (*BookUpdateOne) SetNillableChildBookNum ¶
func (buo *BookUpdateOne) SetNillableChildBookNum(i *int) *BookUpdateOne
SetNillableChildBookNum sets the "ChildBookNum" field if the given value is not nil.
func (*BookUpdateOne) SetNillableDepth ¶
func (buo *BookUpdateOne) SetNillableDepth(i *int) *BookUpdateOne
SetNillableDepth sets the "Depth" field if the given value is not nil.
func (*BookUpdateOne) SetNillableExtractNum ¶
func (buo *BookUpdateOne) SetNillableExtractNum(i *int) *BookUpdateOne
SetNillableExtractNum sets the "ExtractNum" field if the given value is not nil.
func (*BookUpdateOne) SetNillableExtractPath ¶
func (buo *BookUpdateOne) SetNillableExtractPath(s *string) *BookUpdateOne
SetNillableExtractPath sets the "ExtractPath" field if the given value is not nil.
func (*BookUpdateOne) SetNillableFilePath ¶
func (buo *BookUpdateOne) SetNillableFilePath(s *string) *BookUpdateOne
SetNillableFilePath sets the "FilePath" field if the given value is not nil.
func (*BookUpdateOne) SetNillableFileSize ¶
func (buo *BookUpdateOne) SetNillableFileSize(i *int64) *BookUpdateOne
SetNillableFileSize sets the "FileSize" field if the given value is not nil.
func (*BookUpdateOne) SetNillableISBN ¶
func (buo *BookUpdateOne) SetNillableISBN(s *string) *BookUpdateOne
SetNillableISBN sets the "ISBN" field if the given value is not nil.
func (*BookUpdateOne) SetNillableInitComplete ¶
func (buo *BookUpdateOne) SetNillableInitComplete(b *bool) *BookUpdateOne
SetNillableInitComplete sets the "InitComplete" field if the given value is not nil.
func (*BookUpdateOne) SetNillableModified ¶
func (buo *BookUpdateOne) SetNillableModified(t *time.Time) *BookUpdateOne
SetNillableModified sets the "Modified" field if the given value is not nil.
func (*BookUpdateOne) SetNillableNonUTF8Zip ¶
func (buo *BookUpdateOne) SetNillableNonUTF8Zip(b *bool) *BookUpdateOne
SetNillableNonUTF8Zip sets the "NonUTF8Zip" field if the given value is not nil.
func (*BookUpdateOne) SetNillableOwner ¶
func (buo *BookUpdateOne) SetNillableOwner(s *string) *BookUpdateOne
SetNillableOwner sets the "Owner" field if the given value is not nil.
func (*BookUpdateOne) SetNillablePageCount ¶
func (buo *BookUpdateOne) SetNillablePageCount(i *int) *BookUpdateOne
SetNillablePageCount sets the "PageCount" field if the given value is not nil.
func (*BookUpdateOne) SetNillableParentFolder ¶
func (buo *BookUpdateOne) SetNillableParentFolder(s *string) *BookUpdateOne
SetNillableParentFolder sets the "ParentFolder" field if the given value is not nil.
func (*BookUpdateOne) SetNillablePress ¶
func (buo *BookUpdateOne) SetNillablePress(s *string) *BookUpdateOne
SetNillablePress sets the "Press" field if the given value is not nil.
func (*BookUpdateOne) SetNillablePublishedAt ¶
func (buo *BookUpdateOne) SetNillablePublishedAt(s *string) *BookUpdateOne
SetNillablePublishedAt sets the "PublishedAt" field if the given value is not nil.
func (*BookUpdateOne) SetNillableReadPercent ¶
func (buo *BookUpdateOne) SetNillableReadPercent(f *float64) *BookUpdateOne
SetNillableReadPercent sets the "ReadPercent" field if the given value is not nil.
func (*BookUpdateOne) SetNillableTitle ¶
func (buo *BookUpdateOne) SetNillableTitle(s *string) *BookUpdateOne
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*BookUpdateOne) SetNillableType ¶
func (buo *BookUpdateOne) SetNillableType(s *string) *BookUpdateOne
SetNillableType sets the "Type" field if the given value is not nil.
func (*BookUpdateOne) SetNillableZipTextEncoding ¶
func (buo *BookUpdateOne) SetNillableZipTextEncoding(s *string) *BookUpdateOne
SetNillableZipTextEncoding sets the "ZipTextEncoding" field if the given value is not nil.
func (*BookUpdateOne) SetNonUTF8Zip ¶
func (buo *BookUpdateOne) SetNonUTF8Zip(b bool) *BookUpdateOne
SetNonUTF8Zip sets the "NonUTF8Zip" field.
func (*BookUpdateOne) SetOwner ¶
func (buo *BookUpdateOne) SetOwner(s string) *BookUpdateOne
SetOwner sets the "Owner" field.
func (*BookUpdateOne) SetPageCount ¶
func (buo *BookUpdateOne) SetPageCount(i int) *BookUpdateOne
SetPageCount sets the "PageCount" field.
func (*BookUpdateOne) SetParentFolder ¶
func (buo *BookUpdateOne) SetParentFolder(s string) *BookUpdateOne
SetParentFolder sets the "ParentFolder" field.
func (*BookUpdateOne) SetPress ¶
func (buo *BookUpdateOne) SetPress(s string) *BookUpdateOne
SetPress sets the "Press" field.
func (*BookUpdateOne) SetPublishedAt ¶
func (buo *BookUpdateOne) SetPublishedAt(s string) *BookUpdateOne
SetPublishedAt sets the "PublishedAt" field.
func (*BookUpdateOne) SetReadPercent ¶
func (buo *BookUpdateOne) SetReadPercent(f float64) *BookUpdateOne
SetReadPercent sets the "ReadPercent" field.
func (*BookUpdateOne) SetTitle ¶
func (buo *BookUpdateOne) SetTitle(s string) *BookUpdateOne
SetTitle sets the "Title" field.
func (*BookUpdateOne) SetType ¶
func (buo *BookUpdateOne) SetType(s string) *BookUpdateOne
SetType sets the "Type" field.
func (*BookUpdateOne) SetZipTextEncoding ¶
func (buo *BookUpdateOne) SetZipTextEncoding(s string) *BookUpdateOne
SetZipTextEncoding sets the "ZipTextEncoding" field.
func (*BookUpdateOne) Where ¶
func (buo *BookUpdateOne) Where(ps ...predicate.Book) *BookUpdateOne
Where appends a list predicates to the BookUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Book is the client for interacting with the Book builders. Book *BookClient // SinglePageInfo is the client for interacting with the SinglePageInfo builders. SinglePageInfo *SinglePageInfoClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
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(). Book. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
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 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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
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 SinglePageInfo ¶
type SinglePageInfo struct { // ID of the ent. ID int `json:"id,omitempty"` // BookID holds the value of the "BookID" field. BookID string `json:"BookID,omitempty"` // PageNum holds the value of the "PageNum" field. PageNum int `json:"PageNum,omitempty"` // NameInArchive holds the value of the "NameInArchive" field. NameInArchive string `json:"NameInArchive,omitempty"` // URL holds the value of the "Url" field. URL string `json:"Url,omitempty"` // BlurHash holds the value of the "BlurHash" field. BlurHash string `json:"BlurHash,omitempty"` // Height holds the value of the "Height" field. Height int `json:"Height,omitempty"` // Width holds the value of the "Width" field. Width int `json:"Width,omitempty"` // ModeTime holds the value of the "ModeTime" field. ModeTime time.Time `json:"ModeTime,omitempty"` // FileSize holds the value of the "FileSize" field. FileSize int64 `json:"FileSize,omitempty"` // RealImageFilePATH holds the value of the "RealImageFilePATH" field. RealImageFilePATH string `json:"RealImageFilePATH,omitempty"` // ImgType holds the value of the "ImgType" field. ImgType string `json:"ImgType,omitempty"` // contains filtered or unexported fields }
SinglePageInfo is the model entity for the SinglePageInfo schema.
func (*SinglePageInfo) String ¶
func (spi *SinglePageInfo) String() string
String implements the fmt.Stringer.
func (*SinglePageInfo) Unwrap ¶
func (spi *SinglePageInfo) Unwrap() *SinglePageInfo
Unwrap unwraps the SinglePageInfo 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 (*SinglePageInfo) Update ¶
func (spi *SinglePageInfo) Update() *SinglePageInfoUpdateOne
Update returns a builder for updating this SinglePageInfo. Note that you need to call SinglePageInfo.Unwrap() before calling this method if this SinglePageInfo was returned from a transaction, and the transaction was committed or rolled back.
type SinglePageInfoClient ¶
type SinglePageInfoClient struct {
// contains filtered or unexported fields
}
SinglePageInfoClient is a client for the SinglePageInfo schema.
func NewSinglePageInfoClient ¶
func NewSinglePageInfoClient(c config) *SinglePageInfoClient
NewSinglePageInfoClient returns a client for the SinglePageInfo from the given config.
func (*SinglePageInfoClient) Create ¶
func (c *SinglePageInfoClient) Create() *SinglePageInfoCreate
Create returns a builder for creating a SinglePageInfo entity.
func (*SinglePageInfoClient) CreateBulk ¶
func (c *SinglePageInfoClient) CreateBulk(builders ...*SinglePageInfoCreate) *SinglePageInfoCreateBulk
CreateBulk returns a builder for creating a bulk of SinglePageInfo entities.
func (*SinglePageInfoClient) Delete ¶
func (c *SinglePageInfoClient) Delete() *SinglePageInfoDelete
Delete returns a delete builder for SinglePageInfo.
func (*SinglePageInfoClient) DeleteOne ¶
func (c *SinglePageInfoClient) DeleteOne(spi *SinglePageInfo) *SinglePageInfoDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SinglePageInfoClient) DeleteOneID ¶
func (c *SinglePageInfoClient) DeleteOneID(id int) *SinglePageInfoDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SinglePageInfoClient) Get ¶
func (c *SinglePageInfoClient) Get(ctx context.Context, id int) (*SinglePageInfo, error)
Get returns a SinglePageInfo entity by its id.
func (*SinglePageInfoClient) GetX ¶
func (c *SinglePageInfoClient) GetX(ctx context.Context, id int) *SinglePageInfo
GetX is like Get, but panics if an error occurs.
func (*SinglePageInfoClient) Hooks ¶
func (c *SinglePageInfoClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SinglePageInfoClient) Intercept ¶
func (c *SinglePageInfoClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `singlepageinfo.Intercept(f(g(h())))`.
func (*SinglePageInfoClient) Interceptors ¶
func (c *SinglePageInfoClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SinglePageInfoClient) MapCreateBulk ¶
func (c *SinglePageInfoClient) MapCreateBulk(slice any, setFunc func(*SinglePageInfoCreate, int)) *SinglePageInfoCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*SinglePageInfoClient) Query ¶
func (c *SinglePageInfoClient) Query() *SinglePageInfoQuery
Query returns a query builder for SinglePageInfo.
func (*SinglePageInfoClient) Update ¶
func (c *SinglePageInfoClient) Update() *SinglePageInfoUpdate
Update returns an update builder for SinglePageInfo.
func (*SinglePageInfoClient) UpdateOne ¶
func (c *SinglePageInfoClient) UpdateOne(spi *SinglePageInfo) *SinglePageInfoUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SinglePageInfoClient) UpdateOneID ¶
func (c *SinglePageInfoClient) UpdateOneID(id int) *SinglePageInfoUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SinglePageInfoClient) Use ¶
func (c *SinglePageInfoClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `singlepageinfo.Hooks(f(g(h())))`.
type SinglePageInfoCreate ¶
type SinglePageInfoCreate struct {
// contains filtered or unexported fields
}
SinglePageInfoCreate is the builder for creating a SinglePageInfo entity.
func (*SinglePageInfoCreate) Exec ¶
func (spic *SinglePageInfoCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SinglePageInfoCreate) ExecX ¶
func (spic *SinglePageInfoCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SinglePageInfoCreate) Mutation ¶
func (spic *SinglePageInfoCreate) Mutation() *SinglePageInfoMutation
Mutation returns the SinglePageInfoMutation object of the builder.
func (*SinglePageInfoCreate) Save ¶
func (spic *SinglePageInfoCreate) Save(ctx context.Context) (*SinglePageInfo, error)
Save creates the SinglePageInfo in the database.
func (*SinglePageInfoCreate) SaveX ¶
func (spic *SinglePageInfoCreate) SaveX(ctx context.Context) *SinglePageInfo
SaveX calls Save and panics if Save returns an error.
func (*SinglePageInfoCreate) SetBlurHash ¶
func (spic *SinglePageInfoCreate) SetBlurHash(s string) *SinglePageInfoCreate
SetBlurHash sets the "BlurHash" field.
func (*SinglePageInfoCreate) SetBookID ¶
func (spic *SinglePageInfoCreate) SetBookID(s string) *SinglePageInfoCreate
SetBookID sets the "BookID" field.
func (*SinglePageInfoCreate) SetFileSize ¶
func (spic *SinglePageInfoCreate) SetFileSize(i int64) *SinglePageInfoCreate
SetFileSize sets the "FileSize" field.
func (*SinglePageInfoCreate) SetHeight ¶
func (spic *SinglePageInfoCreate) SetHeight(i int) *SinglePageInfoCreate
SetHeight sets the "Height" field.
func (*SinglePageInfoCreate) SetImgType ¶
func (spic *SinglePageInfoCreate) SetImgType(s string) *SinglePageInfoCreate
SetImgType sets the "ImgType" field.
func (*SinglePageInfoCreate) SetModeTime ¶
func (spic *SinglePageInfoCreate) SetModeTime(t time.Time) *SinglePageInfoCreate
SetModeTime sets the "ModeTime" field.
func (*SinglePageInfoCreate) SetNameInArchive ¶
func (spic *SinglePageInfoCreate) SetNameInArchive(s string) *SinglePageInfoCreate
SetNameInArchive sets the "NameInArchive" field.
func (*SinglePageInfoCreate) SetNillableModeTime ¶
func (spic *SinglePageInfoCreate) SetNillableModeTime(t *time.Time) *SinglePageInfoCreate
SetNillableModeTime sets the "ModeTime" field if the given value is not nil.
func (*SinglePageInfoCreate) SetPageNum ¶
func (spic *SinglePageInfoCreate) SetPageNum(i int) *SinglePageInfoCreate
SetPageNum sets the "PageNum" field.
func (*SinglePageInfoCreate) SetRealImageFilePATH ¶
func (spic *SinglePageInfoCreate) SetRealImageFilePATH(s string) *SinglePageInfoCreate
SetRealImageFilePATH sets the "RealImageFilePATH" field.
func (*SinglePageInfoCreate) SetURL ¶
func (spic *SinglePageInfoCreate) SetURL(s string) *SinglePageInfoCreate
SetURL sets the "Url" field.
func (*SinglePageInfoCreate) SetWidth ¶
func (spic *SinglePageInfoCreate) SetWidth(i int) *SinglePageInfoCreate
SetWidth sets the "Width" field.
type SinglePageInfoCreateBulk ¶
type SinglePageInfoCreateBulk struct {
// contains filtered or unexported fields
}
SinglePageInfoCreateBulk is the builder for creating many SinglePageInfo entities in bulk.
func (*SinglePageInfoCreateBulk) Exec ¶
func (spicb *SinglePageInfoCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SinglePageInfoCreateBulk) ExecX ¶
func (spicb *SinglePageInfoCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SinglePageInfoCreateBulk) Save ¶
func (spicb *SinglePageInfoCreateBulk) Save(ctx context.Context) ([]*SinglePageInfo, error)
Save creates the SinglePageInfo entities in the database.
func (*SinglePageInfoCreateBulk) SaveX ¶
func (spicb *SinglePageInfoCreateBulk) SaveX(ctx context.Context) []*SinglePageInfo
SaveX is like Save, but panics if an error occurs.
type SinglePageInfoDelete ¶
type SinglePageInfoDelete struct {
// contains filtered or unexported fields
}
SinglePageInfoDelete is the builder for deleting a SinglePageInfo entity.
func (*SinglePageInfoDelete) Exec ¶
func (spid *SinglePageInfoDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SinglePageInfoDelete) ExecX ¶
func (spid *SinglePageInfoDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SinglePageInfoDelete) Where ¶
func (spid *SinglePageInfoDelete) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoDelete
Where appends a list predicates to the SinglePageInfoDelete builder.
type SinglePageInfoDeleteOne ¶
type SinglePageInfoDeleteOne struct {
// contains filtered or unexported fields
}
SinglePageInfoDeleteOne is the builder for deleting a single SinglePageInfo entity.
func (*SinglePageInfoDeleteOne) Exec ¶
func (spido *SinglePageInfoDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SinglePageInfoDeleteOne) ExecX ¶
func (spido *SinglePageInfoDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SinglePageInfoDeleteOne) Where ¶
func (spido *SinglePageInfoDeleteOne) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoDeleteOne
Where appends a list predicates to the SinglePageInfoDelete builder.
type SinglePageInfoGroupBy ¶
type SinglePageInfoGroupBy struct {
// contains filtered or unexported fields
}
SinglePageInfoGroupBy is the group-by builder for SinglePageInfo entities.
func (*SinglePageInfoGroupBy) Aggregate ¶
func (spigb *SinglePageInfoGroupBy) Aggregate(fns ...AggregateFunc) *SinglePageInfoGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SinglePageInfoGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*SinglePageInfoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoGroupBy) Scan ¶
func (spigb *SinglePageInfoGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SinglePageInfoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SinglePageInfoMutation ¶
type SinglePageInfoMutation struct {
// contains filtered or unexported fields
}
SinglePageInfoMutation represents an operation that mutates the SinglePageInfo nodes in the graph.
func (*SinglePageInfoMutation) AddField ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) AddFileSize ¶
func (m *SinglePageInfoMutation) AddFileSize(i int64)
AddFileSize adds i to the "FileSize" field.
func (*SinglePageInfoMutation) AddHeight ¶
func (m *SinglePageInfoMutation) AddHeight(i int)
AddHeight adds i to the "Height" field.
func (*SinglePageInfoMutation) AddPageNum ¶
func (m *SinglePageInfoMutation) AddPageNum(i int)
AddPageNum adds i to the "PageNum" field.
func (*SinglePageInfoMutation) AddWidth ¶
func (m *SinglePageInfoMutation) AddWidth(i int)
AddWidth adds i to the "Width" field.
func (*SinglePageInfoMutation) AddedEdges ¶
func (m *SinglePageInfoMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SinglePageInfoMutation) AddedField ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) AddedFields ¶
func (m *SinglePageInfoMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SinglePageInfoMutation) AddedFileSize ¶
func (m *SinglePageInfoMutation) AddedFileSize() (r int64, exists bool)
AddedFileSize returns the value that was added to the "FileSize" field in this mutation.
func (*SinglePageInfoMutation) AddedHeight ¶
func (m *SinglePageInfoMutation) AddedHeight() (r int, exists bool)
AddedHeight returns the value that was added to the "Height" field in this mutation.
func (*SinglePageInfoMutation) AddedIDs ¶
func (m *SinglePageInfoMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SinglePageInfoMutation) AddedPageNum ¶
func (m *SinglePageInfoMutation) AddedPageNum() (r int, exists bool)
AddedPageNum returns the value that was added to the "PageNum" field in this mutation.
func (*SinglePageInfoMutation) AddedWidth ¶
func (m *SinglePageInfoMutation) AddedWidth() (r int, exists bool)
AddedWidth returns the value that was added to the "Width" field in this mutation.
func (*SinglePageInfoMutation) BlurHash ¶
func (m *SinglePageInfoMutation) BlurHash() (r string, exists bool)
BlurHash returns the value of the "BlurHash" field in the mutation.
func (*SinglePageInfoMutation) BookID ¶
func (m *SinglePageInfoMutation) BookID() (r string, exists bool)
BookID returns the value of the "BookID" field in the mutation.
func (*SinglePageInfoMutation) ClearEdge ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) ClearField ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) ClearedEdges ¶
func (m *SinglePageInfoMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SinglePageInfoMutation) ClearedFields ¶
func (m *SinglePageInfoMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SinglePageInfoMutation) Client ¶
func (m SinglePageInfoMutation) 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 (*SinglePageInfoMutation) EdgeCleared ¶
func (m *SinglePageInfoMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SinglePageInfoMutation) Field ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) FieldCleared ¶
func (m *SinglePageInfoMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SinglePageInfoMutation) Fields ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) FileSize ¶
func (m *SinglePageInfoMutation) FileSize() (r int64, exists bool)
FileSize returns the value of the "FileSize" field in the mutation.
func (*SinglePageInfoMutation) Height ¶
func (m *SinglePageInfoMutation) Height() (r int, exists bool)
Height returns the value of the "Height" field in the mutation.
func (*SinglePageInfoMutation) ID ¶
func (m *SinglePageInfoMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*SinglePageInfoMutation) IDs ¶
func (m *SinglePageInfoMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*SinglePageInfoMutation) ImgType ¶
func (m *SinglePageInfoMutation) ImgType() (r string, exists bool)
ImgType returns the value of the "ImgType" field in the mutation.
func (*SinglePageInfoMutation) ModeTime ¶
func (m *SinglePageInfoMutation) ModeTime() (r time.Time, exists bool)
ModeTime returns the value of the "ModeTime" field in the mutation.
func (*SinglePageInfoMutation) NameInArchive ¶
func (m *SinglePageInfoMutation) NameInArchive() (r string, exists bool)
NameInArchive returns the value of the "NameInArchive" field in the mutation.
func (*SinglePageInfoMutation) OldBlurHash ¶
func (m *SinglePageInfoMutation) OldBlurHash(ctx context.Context) (v string, err error)
OldBlurHash returns the old "BlurHash" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldBookID ¶
func (m *SinglePageInfoMutation) OldBookID(ctx context.Context) (v string, err error)
OldBookID returns the old "BookID" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) 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 (*SinglePageInfoMutation) OldFileSize ¶
func (m *SinglePageInfoMutation) OldFileSize(ctx context.Context) (v int64, err error)
OldFileSize returns the old "FileSize" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldHeight ¶
func (m *SinglePageInfoMutation) OldHeight(ctx context.Context) (v int, err error)
OldHeight returns the old "Height" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldImgType ¶
func (m *SinglePageInfoMutation) OldImgType(ctx context.Context) (v string, err error)
OldImgType returns the old "ImgType" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldModeTime ¶
OldModeTime returns the old "ModeTime" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldNameInArchive ¶
func (m *SinglePageInfoMutation) OldNameInArchive(ctx context.Context) (v string, err error)
OldNameInArchive returns the old "NameInArchive" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldPageNum ¶
func (m *SinglePageInfoMutation) OldPageNum(ctx context.Context) (v int, err error)
OldPageNum returns the old "PageNum" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldRealImageFilePATH ¶
func (m *SinglePageInfoMutation) OldRealImageFilePATH(ctx context.Context) (v string, err error)
OldRealImageFilePATH returns the old "RealImageFilePATH" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldURL ¶
func (m *SinglePageInfoMutation) OldURL(ctx context.Context) (v string, err error)
OldURL returns the old "Url" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) OldWidth ¶
func (m *SinglePageInfoMutation) OldWidth(ctx context.Context) (v int, err error)
OldWidth returns the old "Width" field's value of the SinglePageInfo entity. If the SinglePageInfo 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 (*SinglePageInfoMutation) Op ¶
func (m *SinglePageInfoMutation) Op() Op
Op returns the operation name.
func (*SinglePageInfoMutation) PageNum ¶
func (m *SinglePageInfoMutation) PageNum() (r int, exists bool)
PageNum returns the value of the "PageNum" field in the mutation.
func (*SinglePageInfoMutation) RealImageFilePATH ¶
func (m *SinglePageInfoMutation) RealImageFilePATH() (r string, exists bool)
RealImageFilePATH returns the value of the "RealImageFilePATH" field in the mutation.
func (*SinglePageInfoMutation) RemovedEdges ¶
func (m *SinglePageInfoMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SinglePageInfoMutation) RemovedIDs ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) ResetBlurHash ¶
func (m *SinglePageInfoMutation) ResetBlurHash()
ResetBlurHash resets all changes to the "BlurHash" field.
func (*SinglePageInfoMutation) ResetBookID ¶
func (m *SinglePageInfoMutation) ResetBookID()
ResetBookID resets all changes to the "BookID" field.
func (*SinglePageInfoMutation) ResetEdge ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) ResetField ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) ResetFileSize ¶
func (m *SinglePageInfoMutation) ResetFileSize()
ResetFileSize resets all changes to the "FileSize" field.
func (*SinglePageInfoMutation) ResetHeight ¶
func (m *SinglePageInfoMutation) ResetHeight()
ResetHeight resets all changes to the "Height" field.
func (*SinglePageInfoMutation) ResetImgType ¶
func (m *SinglePageInfoMutation) ResetImgType()
ResetImgType resets all changes to the "ImgType" field.
func (*SinglePageInfoMutation) ResetModeTime ¶
func (m *SinglePageInfoMutation) ResetModeTime()
ResetModeTime resets all changes to the "ModeTime" field.
func (*SinglePageInfoMutation) ResetNameInArchive ¶
func (m *SinglePageInfoMutation) ResetNameInArchive()
ResetNameInArchive resets all changes to the "NameInArchive" field.
func (*SinglePageInfoMutation) ResetPageNum ¶
func (m *SinglePageInfoMutation) ResetPageNum()
ResetPageNum resets all changes to the "PageNum" field.
func (*SinglePageInfoMutation) ResetRealImageFilePATH ¶
func (m *SinglePageInfoMutation) ResetRealImageFilePATH()
ResetRealImageFilePATH resets all changes to the "RealImageFilePATH" field.
func (*SinglePageInfoMutation) ResetURL ¶
func (m *SinglePageInfoMutation) ResetURL()
ResetURL resets all changes to the "Url" field.
func (*SinglePageInfoMutation) ResetWidth ¶
func (m *SinglePageInfoMutation) ResetWidth()
ResetWidth resets all changes to the "Width" field.
func (*SinglePageInfoMutation) SetBlurHash ¶
func (m *SinglePageInfoMutation) SetBlurHash(s string)
SetBlurHash sets the "BlurHash" field.
func (*SinglePageInfoMutation) SetBookID ¶
func (m *SinglePageInfoMutation) SetBookID(s string)
SetBookID sets the "BookID" field.
func (*SinglePageInfoMutation) SetField ¶
func (m *SinglePageInfoMutation) 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 (*SinglePageInfoMutation) SetFileSize ¶
func (m *SinglePageInfoMutation) SetFileSize(i int64)
SetFileSize sets the "FileSize" field.
func (*SinglePageInfoMutation) SetHeight ¶
func (m *SinglePageInfoMutation) SetHeight(i int)
SetHeight sets the "Height" field.
func (*SinglePageInfoMutation) SetImgType ¶
func (m *SinglePageInfoMutation) SetImgType(s string)
SetImgType sets the "ImgType" field.
func (*SinglePageInfoMutation) SetModeTime ¶
func (m *SinglePageInfoMutation) SetModeTime(t time.Time)
SetModeTime sets the "ModeTime" field.
func (*SinglePageInfoMutation) SetNameInArchive ¶
func (m *SinglePageInfoMutation) SetNameInArchive(s string)
SetNameInArchive sets the "NameInArchive" field.
func (*SinglePageInfoMutation) SetOp ¶
func (m *SinglePageInfoMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SinglePageInfoMutation) SetPageNum ¶
func (m *SinglePageInfoMutation) SetPageNum(i int)
SetPageNum sets the "PageNum" field.
func (*SinglePageInfoMutation) SetRealImageFilePATH ¶
func (m *SinglePageInfoMutation) SetRealImageFilePATH(s string)
SetRealImageFilePATH sets the "RealImageFilePATH" field.
func (*SinglePageInfoMutation) SetURL ¶
func (m *SinglePageInfoMutation) SetURL(s string)
SetURL sets the "Url" field.
func (*SinglePageInfoMutation) SetWidth ¶
func (m *SinglePageInfoMutation) SetWidth(i int)
SetWidth sets the "Width" field.
func (SinglePageInfoMutation) Tx ¶
func (m SinglePageInfoMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SinglePageInfoMutation) Type ¶
func (m *SinglePageInfoMutation) Type() string
Type returns the node type of this mutation (SinglePageInfo).
func (*SinglePageInfoMutation) URL ¶
func (m *SinglePageInfoMutation) URL() (r string, exists bool)
URL returns the value of the "Url" field in the mutation.
func (*SinglePageInfoMutation) Where ¶
func (m *SinglePageInfoMutation) Where(ps ...predicate.SinglePageInfo)
Where appends a list predicates to the SinglePageInfoMutation builder.
func (*SinglePageInfoMutation) WhereP ¶
func (m *SinglePageInfoMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SinglePageInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
func (*SinglePageInfoMutation) Width ¶
func (m *SinglePageInfoMutation) Width() (r int, exists bool)
Width returns the value of the "Width" field in the mutation.
type SinglePageInfoQuery ¶
type SinglePageInfoQuery struct {
// contains filtered or unexported fields
}
SinglePageInfoQuery is the builder for querying SinglePageInfo entities.
func (*SinglePageInfoQuery) Aggregate ¶
func (spiq *SinglePageInfoQuery) Aggregate(fns ...AggregateFunc) *SinglePageInfoSelect
Aggregate returns a SinglePageInfoSelect configured with the given aggregations.
func (*SinglePageInfoQuery) All ¶
func (spiq *SinglePageInfoQuery) All(ctx context.Context) ([]*SinglePageInfo, error)
All executes the query and returns a list of SinglePageInfos.
func (*SinglePageInfoQuery) AllX ¶
func (spiq *SinglePageInfoQuery) AllX(ctx context.Context) []*SinglePageInfo
AllX is like All, but panics if an error occurs.
func (*SinglePageInfoQuery) Clone ¶
func (spiq *SinglePageInfoQuery) Clone() *SinglePageInfoQuery
Clone returns a duplicate of the SinglePageInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SinglePageInfoQuery) Count ¶
func (spiq *SinglePageInfoQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SinglePageInfoQuery) CountX ¶
func (spiq *SinglePageInfoQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SinglePageInfoQuery) Exist ¶
func (spiq *SinglePageInfoQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SinglePageInfoQuery) ExistX ¶
func (spiq *SinglePageInfoQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SinglePageInfoQuery) First ¶
func (spiq *SinglePageInfoQuery) First(ctx context.Context) (*SinglePageInfo, error)
First returns the first SinglePageInfo entity from the query. Returns a *NotFoundError when no SinglePageInfo was found.
func (*SinglePageInfoQuery) FirstID ¶
func (spiq *SinglePageInfoQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first SinglePageInfo ID from the query. Returns a *NotFoundError when no SinglePageInfo ID was found.
func (*SinglePageInfoQuery) FirstIDX ¶
func (spiq *SinglePageInfoQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SinglePageInfoQuery) FirstX ¶
func (spiq *SinglePageInfoQuery) FirstX(ctx context.Context) *SinglePageInfo
FirstX is like First, but panics if an error occurs.
func (*SinglePageInfoQuery) GroupBy ¶
func (spiq *SinglePageInfoQuery) GroupBy(field string, fields ...string) *SinglePageInfoGroupBy
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 { BookID string `json:"BookID,omitempty"` Count int `json:"count,omitempty"` } client.SinglePageInfo.Query(). GroupBy(singlepageinfo.FieldBookID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SinglePageInfoQuery) IDs ¶
func (spiq *SinglePageInfoQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of SinglePageInfo IDs.
func (*SinglePageInfoQuery) IDsX ¶
func (spiq *SinglePageInfoQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SinglePageInfoQuery) Limit ¶
func (spiq *SinglePageInfoQuery) Limit(limit int) *SinglePageInfoQuery
Limit the number of records to be returned by this query.
func (*SinglePageInfoQuery) Offset ¶
func (spiq *SinglePageInfoQuery) Offset(offset int) *SinglePageInfoQuery
Offset to start from.
func (*SinglePageInfoQuery) Only ¶
func (spiq *SinglePageInfoQuery) Only(ctx context.Context) (*SinglePageInfo, error)
Only returns a single SinglePageInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SinglePageInfo entity is found. Returns a *NotFoundError when no SinglePageInfo entities are found.
func (*SinglePageInfoQuery) OnlyID ¶
func (spiq *SinglePageInfoQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only SinglePageInfo ID in the query. Returns a *NotSingularError when more than one SinglePageInfo ID is found. Returns a *NotFoundError when no entities are found.
func (*SinglePageInfoQuery) OnlyIDX ¶
func (spiq *SinglePageInfoQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SinglePageInfoQuery) OnlyX ¶
func (spiq *SinglePageInfoQuery) OnlyX(ctx context.Context) *SinglePageInfo
OnlyX is like Only, but panics if an error occurs.
func (*SinglePageInfoQuery) Order ¶
func (spiq *SinglePageInfoQuery) Order(o ...singlepageinfo.OrderOption) *SinglePageInfoQuery
Order specifies how the records should be ordered.
func (*SinglePageInfoQuery) Select ¶
func (spiq *SinglePageInfoQuery) Select(fields ...string) *SinglePageInfoSelect
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 { BookID string `json:"BookID,omitempty"` } client.SinglePageInfo.Query(). Select(singlepageinfo.FieldBookID). Scan(ctx, &v)
func (*SinglePageInfoQuery) Unique ¶
func (spiq *SinglePageInfoQuery) Unique(unique bool) *SinglePageInfoQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*SinglePageInfoQuery) Where ¶
func (spiq *SinglePageInfoQuery) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoQuery
Where adds a new predicate for the SinglePageInfoQuery builder.
type SinglePageInfoSelect ¶
type SinglePageInfoSelect struct { *SinglePageInfoQuery // contains filtered or unexported fields }
SinglePageInfoSelect is the builder for selecting fields of SinglePageInfo entities.
func (*SinglePageInfoSelect) Aggregate ¶
func (spis *SinglePageInfoSelect) Aggregate(fns ...AggregateFunc) *SinglePageInfoSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SinglePageInfoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SinglePageInfoSelect) Scan ¶
func (spis *SinglePageInfoSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SinglePageInfoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SinglePageInfoUpdate ¶
type SinglePageInfoUpdate struct {
// contains filtered or unexported fields
}
SinglePageInfoUpdate is the builder for updating SinglePageInfo entities.
func (*SinglePageInfoUpdate) AddFileSize ¶
func (spiu *SinglePageInfoUpdate) AddFileSize(i int64) *SinglePageInfoUpdate
AddFileSize adds i to the "FileSize" field.
func (*SinglePageInfoUpdate) AddHeight ¶
func (spiu *SinglePageInfoUpdate) AddHeight(i int) *SinglePageInfoUpdate
AddHeight adds i to the "Height" field.
func (*SinglePageInfoUpdate) AddPageNum ¶
func (spiu *SinglePageInfoUpdate) AddPageNum(i int) *SinglePageInfoUpdate
AddPageNum adds i to the "PageNum" field.
func (*SinglePageInfoUpdate) AddWidth ¶
func (spiu *SinglePageInfoUpdate) AddWidth(i int) *SinglePageInfoUpdate
AddWidth adds i to the "Width" field.
func (*SinglePageInfoUpdate) Exec ¶
func (spiu *SinglePageInfoUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SinglePageInfoUpdate) ExecX ¶
func (spiu *SinglePageInfoUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SinglePageInfoUpdate) Mutation ¶
func (spiu *SinglePageInfoUpdate) Mutation() *SinglePageInfoMutation
Mutation returns the SinglePageInfoMutation object of the builder.
func (*SinglePageInfoUpdate) Save ¶
func (spiu *SinglePageInfoUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SinglePageInfoUpdate) SaveX ¶
func (spiu *SinglePageInfoUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SinglePageInfoUpdate) SetBlurHash ¶
func (spiu *SinglePageInfoUpdate) SetBlurHash(s string) *SinglePageInfoUpdate
SetBlurHash sets the "BlurHash" field.
func (*SinglePageInfoUpdate) SetBookID ¶
func (spiu *SinglePageInfoUpdate) SetBookID(s string) *SinglePageInfoUpdate
SetBookID sets the "BookID" field.
func (*SinglePageInfoUpdate) SetFileSize ¶
func (spiu *SinglePageInfoUpdate) SetFileSize(i int64) *SinglePageInfoUpdate
SetFileSize sets the "FileSize" field.
func (*SinglePageInfoUpdate) SetHeight ¶
func (spiu *SinglePageInfoUpdate) SetHeight(i int) *SinglePageInfoUpdate
SetHeight sets the "Height" field.
func (*SinglePageInfoUpdate) SetImgType ¶
func (spiu *SinglePageInfoUpdate) SetImgType(s string) *SinglePageInfoUpdate
SetImgType sets the "ImgType" field.
func (*SinglePageInfoUpdate) SetModeTime ¶
func (spiu *SinglePageInfoUpdate) SetModeTime(t time.Time) *SinglePageInfoUpdate
SetModeTime sets the "ModeTime" field.
func (*SinglePageInfoUpdate) SetNameInArchive ¶
func (spiu *SinglePageInfoUpdate) SetNameInArchive(s string) *SinglePageInfoUpdate
SetNameInArchive sets the "NameInArchive" field.
func (*SinglePageInfoUpdate) SetNillableBlurHash ¶
func (spiu *SinglePageInfoUpdate) SetNillableBlurHash(s *string) *SinglePageInfoUpdate
SetNillableBlurHash sets the "BlurHash" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableBookID ¶
func (spiu *SinglePageInfoUpdate) SetNillableBookID(s *string) *SinglePageInfoUpdate
SetNillableBookID sets the "BookID" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableFileSize ¶
func (spiu *SinglePageInfoUpdate) SetNillableFileSize(i *int64) *SinglePageInfoUpdate
SetNillableFileSize sets the "FileSize" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableHeight ¶
func (spiu *SinglePageInfoUpdate) SetNillableHeight(i *int) *SinglePageInfoUpdate
SetNillableHeight sets the "Height" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableImgType ¶
func (spiu *SinglePageInfoUpdate) SetNillableImgType(s *string) *SinglePageInfoUpdate
SetNillableImgType sets the "ImgType" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableModeTime ¶
func (spiu *SinglePageInfoUpdate) SetNillableModeTime(t *time.Time) *SinglePageInfoUpdate
SetNillableModeTime sets the "ModeTime" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableNameInArchive ¶
func (spiu *SinglePageInfoUpdate) SetNillableNameInArchive(s *string) *SinglePageInfoUpdate
SetNillableNameInArchive sets the "NameInArchive" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillablePageNum ¶
func (spiu *SinglePageInfoUpdate) SetNillablePageNum(i *int) *SinglePageInfoUpdate
SetNillablePageNum sets the "PageNum" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableRealImageFilePATH ¶
func (spiu *SinglePageInfoUpdate) SetNillableRealImageFilePATH(s *string) *SinglePageInfoUpdate
SetNillableRealImageFilePATH sets the "RealImageFilePATH" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableURL ¶
func (spiu *SinglePageInfoUpdate) SetNillableURL(s *string) *SinglePageInfoUpdate
SetNillableURL sets the "Url" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetNillableWidth ¶
func (spiu *SinglePageInfoUpdate) SetNillableWidth(i *int) *SinglePageInfoUpdate
SetNillableWidth sets the "Width" field if the given value is not nil.
func (*SinglePageInfoUpdate) SetPageNum ¶
func (spiu *SinglePageInfoUpdate) SetPageNum(i int) *SinglePageInfoUpdate
SetPageNum sets the "PageNum" field.
func (*SinglePageInfoUpdate) SetRealImageFilePATH ¶
func (spiu *SinglePageInfoUpdate) SetRealImageFilePATH(s string) *SinglePageInfoUpdate
SetRealImageFilePATH sets the "RealImageFilePATH" field.
func (*SinglePageInfoUpdate) SetURL ¶
func (spiu *SinglePageInfoUpdate) SetURL(s string) *SinglePageInfoUpdate
SetURL sets the "Url" field.
func (*SinglePageInfoUpdate) SetWidth ¶
func (spiu *SinglePageInfoUpdate) SetWidth(i int) *SinglePageInfoUpdate
SetWidth sets the "Width" field.
func (*SinglePageInfoUpdate) Where ¶
func (spiu *SinglePageInfoUpdate) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoUpdate
Where appends a list predicates to the SinglePageInfoUpdate builder.
type SinglePageInfoUpdateOne ¶
type SinglePageInfoUpdateOne struct {
// contains filtered or unexported fields
}
SinglePageInfoUpdateOne is the builder for updating a single SinglePageInfo entity.
func (*SinglePageInfoUpdateOne) AddFileSize ¶
func (spiuo *SinglePageInfoUpdateOne) AddFileSize(i int64) *SinglePageInfoUpdateOne
AddFileSize adds i to the "FileSize" field.
func (*SinglePageInfoUpdateOne) AddHeight ¶
func (spiuo *SinglePageInfoUpdateOne) AddHeight(i int) *SinglePageInfoUpdateOne
AddHeight adds i to the "Height" field.
func (*SinglePageInfoUpdateOne) AddPageNum ¶
func (spiuo *SinglePageInfoUpdateOne) AddPageNum(i int) *SinglePageInfoUpdateOne
AddPageNum adds i to the "PageNum" field.
func (*SinglePageInfoUpdateOne) AddWidth ¶
func (spiuo *SinglePageInfoUpdateOne) AddWidth(i int) *SinglePageInfoUpdateOne
AddWidth adds i to the "Width" field.
func (*SinglePageInfoUpdateOne) Exec ¶
func (spiuo *SinglePageInfoUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SinglePageInfoUpdateOne) ExecX ¶
func (spiuo *SinglePageInfoUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SinglePageInfoUpdateOne) Mutation ¶
func (spiuo *SinglePageInfoUpdateOne) Mutation() *SinglePageInfoMutation
Mutation returns the SinglePageInfoMutation object of the builder.
func (*SinglePageInfoUpdateOne) Save ¶
func (spiuo *SinglePageInfoUpdateOne) Save(ctx context.Context) (*SinglePageInfo, error)
Save executes the query and returns the updated SinglePageInfo entity.
func (*SinglePageInfoUpdateOne) SaveX ¶
func (spiuo *SinglePageInfoUpdateOne) SaveX(ctx context.Context) *SinglePageInfo
SaveX is like Save, but panics if an error occurs.
func (*SinglePageInfoUpdateOne) Select ¶
func (spiuo *SinglePageInfoUpdateOne) Select(field string, fields ...string) *SinglePageInfoUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SinglePageInfoUpdateOne) SetBlurHash ¶
func (spiuo *SinglePageInfoUpdateOne) SetBlurHash(s string) *SinglePageInfoUpdateOne
SetBlurHash sets the "BlurHash" field.
func (*SinglePageInfoUpdateOne) SetBookID ¶
func (spiuo *SinglePageInfoUpdateOne) SetBookID(s string) *SinglePageInfoUpdateOne
SetBookID sets the "BookID" field.
func (*SinglePageInfoUpdateOne) SetFileSize ¶
func (spiuo *SinglePageInfoUpdateOne) SetFileSize(i int64) *SinglePageInfoUpdateOne
SetFileSize sets the "FileSize" field.
func (*SinglePageInfoUpdateOne) SetHeight ¶
func (spiuo *SinglePageInfoUpdateOne) SetHeight(i int) *SinglePageInfoUpdateOne
SetHeight sets the "Height" field.
func (*SinglePageInfoUpdateOne) SetImgType ¶
func (spiuo *SinglePageInfoUpdateOne) SetImgType(s string) *SinglePageInfoUpdateOne
SetImgType sets the "ImgType" field.
func (*SinglePageInfoUpdateOne) SetModeTime ¶
func (spiuo *SinglePageInfoUpdateOne) SetModeTime(t time.Time) *SinglePageInfoUpdateOne
SetModeTime sets the "ModeTime" field.
func (*SinglePageInfoUpdateOne) SetNameInArchive ¶
func (spiuo *SinglePageInfoUpdateOne) SetNameInArchive(s string) *SinglePageInfoUpdateOne
SetNameInArchive sets the "NameInArchive" field.
func (*SinglePageInfoUpdateOne) SetNillableBlurHash ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableBlurHash(s *string) *SinglePageInfoUpdateOne
SetNillableBlurHash sets the "BlurHash" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableBookID ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableBookID(s *string) *SinglePageInfoUpdateOne
SetNillableBookID sets the "BookID" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableFileSize ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableFileSize(i *int64) *SinglePageInfoUpdateOne
SetNillableFileSize sets the "FileSize" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableHeight ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableHeight(i *int) *SinglePageInfoUpdateOne
SetNillableHeight sets the "Height" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableImgType ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableImgType(s *string) *SinglePageInfoUpdateOne
SetNillableImgType sets the "ImgType" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableModeTime ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableModeTime(t *time.Time) *SinglePageInfoUpdateOne
SetNillableModeTime sets the "ModeTime" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableNameInArchive ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableNameInArchive(s *string) *SinglePageInfoUpdateOne
SetNillableNameInArchive sets the "NameInArchive" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillablePageNum ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillablePageNum(i *int) *SinglePageInfoUpdateOne
SetNillablePageNum sets the "PageNum" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableRealImageFilePATH ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableRealImageFilePATH(s *string) *SinglePageInfoUpdateOne
SetNillableRealImageFilePATH sets the "RealImageFilePATH" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableURL ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableURL(s *string) *SinglePageInfoUpdateOne
SetNillableURL sets the "Url" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetNillableWidth ¶
func (spiuo *SinglePageInfoUpdateOne) SetNillableWidth(i *int) *SinglePageInfoUpdateOne
SetNillableWidth sets the "Width" field if the given value is not nil.
func (*SinglePageInfoUpdateOne) SetPageNum ¶
func (spiuo *SinglePageInfoUpdateOne) SetPageNum(i int) *SinglePageInfoUpdateOne
SetPageNum sets the "PageNum" field.
func (*SinglePageInfoUpdateOne) SetRealImageFilePATH ¶
func (spiuo *SinglePageInfoUpdateOne) SetRealImageFilePATH(s string) *SinglePageInfoUpdateOne
SetRealImageFilePATH sets the "RealImageFilePATH" field.
func (*SinglePageInfoUpdateOne) SetURL ¶
func (spiuo *SinglePageInfoUpdateOne) SetURL(s string) *SinglePageInfoUpdateOne
SetURL sets the "Url" field.
func (*SinglePageInfoUpdateOne) SetWidth ¶
func (spiuo *SinglePageInfoUpdateOne) SetWidth(i int) *SinglePageInfoUpdateOne
SetWidth sets the "Width" field.
func (*SinglePageInfoUpdateOne) Where ¶
func (spiuo *SinglePageInfoUpdateOne) Where(ps ...predicate.SinglePageInfo) *SinglePageInfoUpdateOne
Where appends a list predicates to the SinglePageInfoUpdate builder.
type SinglePageInfos ¶
type SinglePageInfos []*SinglePageInfo
SinglePageInfos is a parsable slice of SinglePageInfo.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Book is the client for interacting with the Book builders. Book *BookClient // SinglePageInfo is the client for interacting with the SinglePageInfo builders. SinglePageInfo *SinglePageInfoClient // User is the client for interacting with the User builders. User *UserClient // 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) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // 用户称呼 Name string `json:"name,omitempty"` // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // 用户名 Username string `json:"username,omitempty"` // 登录密码 Password string `json:"password,omitempty"` // 最后登录时间 LastLogin time.Time `json:"last_login,omitempty"` // Age holds the value of the "age" field. Age int `json:"age,omitempty"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) Unwrap ¶
Unwrap unwraps the User 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 (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAge ¶
func (uc *UserCreate) SetAge(i int) *UserCreate
SetAge sets the "age" field.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetLastLogin ¶
func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate
SetLastLogin sets the "last_login" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableLastLogin ¶
func (uc *UserCreate) SetNillableLastLogin(t *time.Time) *UserCreate
SetNillableLastLogin sets the "last_login" field if the given value is not nil.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetUsername ¶
func (uc *UserCreate) SetUsername(s string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddAge ¶
func (m *UserMutation) AddAge(i int)
AddAge adds i to the "age" field.
func (*UserMutation) AddField ¶
func (m *UserMutation) 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 (*UserMutation) AddedAge ¶
func (m *UserMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) 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 (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) Age ¶
func (m *UserMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) 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 (*UserMutation) ClearField ¶
func (m *UserMutation) 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 (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) 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 (*UserMutation) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) 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 (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) 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 (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) LastLogin ¶
func (m *UserMutation) LastLogin() (r time.Time, exists bool)
LastLogin returns the value of the "last_login" field in the mutation.
func (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) OldAge ¶
func (m *UserMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" field's value of the User entity. If the User 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 (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) 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 (*UserMutation) OldLastLogin ¶
OldLastLogin returns the old "last_login" field's value of the User entity. If the User 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 (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the User entity. If the User 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 (*UserMutation) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the User entity. If the User 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 (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) 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 (*UserMutation) ResetAge ¶
func (m *UserMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) 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 (*UserMutation) ResetField ¶
func (m *UserMutation) 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 (*UserMutation) ResetLastLogin ¶
func (m *UserMutation) ResetLastLogin()
ResetLastLogin resets all changes to the "last_login" field.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) 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 (*UserMutation) SetLastLogin ¶
func (m *UserMutation) SetLastLogin(t time.Time)
SetLastLogin sets the "last_login" field.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.User.Query(). Select(user.FieldName). Scan(ctx, &v)
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAge ¶
func (uu *UserUpdate) AddAge(i int) *UserUpdate
AddAge adds i to the "age" field.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAge ¶
func (uu *UserUpdate) SetAge(i int) *UserUpdate
SetAge sets the "age" field.
func (*UserUpdate) SetCreatedAt ¶
func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
SetCreatedAt sets the "created_at" field.
func (*UserUpdate) SetLastLogin ¶
func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate
SetLastLogin sets the "last_login" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableAge ¶
func (uu *UserUpdate) SetNillableAge(i *int) *UserUpdate
SetNillableAge sets the "age" field if the given value is not nil.
func (*UserUpdate) SetNillableCreatedAt ¶
func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserUpdate) SetNillableLastLogin ¶
func (uu *UserUpdate) SetNillableLastLogin(t *time.Time) *UserUpdate
SetNillableLastLogin sets the "last_login" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillablePassword ¶
func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdate) SetNillableUsername ¶
func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetUsername ¶
func (uu *UserUpdate) SetUsername(s string) *UserUpdate
SetUsername sets the "username" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAge ¶
func (uuo *UserUpdateOne) AddAge(i int) *UserUpdateOne
AddAge adds i to the "age" field.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetAge ¶
func (uuo *UserUpdateOne) SetAge(i int) *UserUpdateOne
SetAge sets the "age" field.
func (*UserUpdateOne) SetCreatedAt ¶
func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
SetCreatedAt sets the "created_at" field.
func (*UserUpdateOne) SetLastLogin ¶
func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne
SetLastLogin sets the "last_login" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableAge ¶
func (uuo *UserUpdateOne) SetNillableAge(i *int) *UserUpdateOne
SetNillableAge sets the "age" field if the given value is not nil.
func (*UserUpdateOne) SetNillableCreatedAt ¶
func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastLogin ¶
func (uuo *UserUpdateOne) SetNillableLastLogin(t *time.Time) *UserUpdateOne
SetNillableLastLogin sets the "last_login" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePassword ¶
func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdateOne) SetNillableUsername ¶
func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetUsername ¶
func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
SetUsername sets the "username" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
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.
Source Files ¶
- book.go
- book_create.go
- book_delete.go
- book_query.go
- book_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- runtime.go
- singlepageinfo.go
- singlepageinfo_create.go
- singlepageinfo_delete.go
- singlepageinfo_query.go
- singlepageinfo_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go